How to use GoTo in VbScript

Results 1 to 4 of 4

Thread: How to use GoTo in VbScript

  1. #1
    Join Date
    Dec 1969

    Default How to use GoTo in VbScript

    I need to validate the input of the users. So for exemple if a user doesn&#039t enter anything in a field i want to redirect it to a special line that i called EmptyField and give them an error message or something like this. When I use the "GoTo" command it gives me an error message.<BR>I do :<BR><BR>GoTo EmptyField<BR>SOME CODE SOME CODE<BR>and then I wrote:<BR><BR>EmptyField:<BR> BLABLABLABLA MY CODE<BR><BR>hOW SHOULD i USE THIS?<BR><BR><BR>thanks,<BR><BR>Aude<BR>

  2. #2
    KPW Guest

    Default DON'T!

    After a quick check of MSDN, it doesn&#039t look like GoTo is even a part of VBScript. You shouldn&#039t use GoTo anyway, except in VB COM objects in the context of "On Error GoTo errHandler" (or something like that).<BR><BR>Instead of trying to use GoTo statements, you should be calling subroutines or functions.

  3. #3
    Alphabet Guest

    Default On Error Goto 0

    As far as I know, this "On Error Goto 0" is the only Goto in VBScript.<BR>It is the opposite of "On Error Resume Next".<BR><BR><BR>

  4. #4
    balletchick Guest

    Default RE: How to use GoTo in VbScript

    RTFM, please...<BR><BR>There is no GOTO in VBScript.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts