MsgBox “” vs MsgBox() in VBScript

前端 未结 5 735
旧巷少年郎
旧巷少年郎 2020-12-09 15:32

I\'m trying to write a VBScript and I\'m using functions such as Randomize, and MsgBox. I\'m curious as to what is the difference of using () and not using them. For example

5条回答
  •  不知归路
    2020-12-09 15:55

    The difference between "" and () is:

    With "" you are not calling anything.
    With () you are calling a sub.

    Example with sub:

    Sub = MsgBox("Msg",vbYesNo,vbCritical,"Title")
    Select Case Sub
         Case = vbYes
              MsgBox"You said yes"
         Case = vbNo
              MsgBox"You said no"
     End Select
    

    vs Normal:

     MsgBox"This is normal"
    

提交回复
热议问题