Just EXACTLY what the message says:
In VBScript, the call to MSGBOX
is *NOT* a function call. It is a call to a SUB
And, again, when you call a SUB, you are *NOT* supposed to use parentheses! Period.
So *techinically*, ALL of your code there is WRONG. None of those calls should use ANY parentheses:
msgbox "Na reda pred nego napishete do, na reda sled msgbox-a loop, a na sledvashia red - EndLoop."
msgbox "Predi da pusnete, znaite che triabva TaskManager, za da se spre tova", 0+16+4096
Why does the code SOMETIMES work? Because of the definition of an *EXPRESSION*.
In VBScript, as in most computer languages, any expression can become a sub-expression by putting parentheses around it:
3 + 4
( 3 + 4 )
7 * ( 3 + 4 )
( 7 * ( 3 + 4 )
( "test" )
"test" & 3.1415
( "test" & 3.1415 )
ALL of those are legal expressions. But the ones in red have *extra* parentheses around them. The parentheses don't hurt, but they aren't needed.
So you *CAN* code simply:
msgbox "Some message"
But because of the rules of expressions you can also code
msgbox ("Some message")
It is important to understand that the parentheses there are *NOT* part of the msgbox
call! They are *ONLY* part of the expression!
Now, when you need to call with more than one argument, you *CAN* call it thus:
msgbox "Some message", 0+16+4096
*AND* you could also call it thus:
msgbox ("Some message"), 0+16+4096
msgbox "Some message", (0+16+4096)
msgbox ("Some message"),(0+16+4096)
What you CAN NOT DO is call it thus:
msgbox ( "Some message", 0+16+4096 )
( "Some message", 0+16+4096 )
is *NOT* an expression!!!
Strangely enough, VBScript *DOES* have a way for you to treat a SUB *as if* it is a function:
CALL msgbox ( "Some message", 0+16+4096 )