none
Display variable in msgbox RRS feed

  • Question

  • I am a beginner in VBS and I'm trying to write what should be a relatively simple script, I have stumbled into this problem. Say for instance I have the following code, on execution I get a message box pop-up every 24hrs showing me the date - as desired. Okay no problem...

    dim file
    
    filepath="C:\remind.txt"
    check = formatdatetime(now,vbshortdate)
    
    set file = createobject("scripting.filesystemobject")
    
    if file.fileexists(filepath) then
    	do
    	msgbox check
    	wscript.sleep 86400
    	loop
    else
    wscript.quit()
    end if

    Now let's say I change *msgbox check* to *msgbox (check, "Date Reminder")* I get error "Cannot use parentheses when calling a sub"... I believe I am using the correct msgbox syntax, so why then this error?



    • Edited by F_Gordon Monday, February 23, 2015 7:32 PM
    Monday, February 23, 2015 7:09 PM

Answers

All replies