Forum Discussion

Kamal_chennai's avatar
Kamal_chennai
Contributor
9 years ago

How to use LABEL and GOTO Label in Script

Hi Guys,

 

Happy to see you all after long time.

 

In keyword We have Option LABEL and GOTO Label and its working Great. But i want to use that LABEL and GOTO LABEL in script. is that anyway to do it?

 

I might be use function recursion, but If we use LABEL GOTO LABEL then it will be fine

 

Thanks,

Kamal

2 Replies

  • ory_z's avatar
    ory_z
    Contributor

    Generally speaking when writing scripts you don't need labels and gotos because it's much easier to construct logical junctions, repeat code (via functions) etc.

     

    I'd say that if you are looking for a way to accomplish this you should try changing your way of thinking when composing scripts. If you give a more concrete example in pseudo code I may be able to answer with a solution example.

     

    Also see - http://community.smartbear.com/t5/Functional-Web-Testing/Goto-in-VBScript/td-p/69616

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi Kamal,

     

    You really need to avoid GOTO instruction. GOTO is forbidden now in programmation schools.

     

    As it was said, the script must begin at a specific point and end at another. Simply, naturaly.

    To make things GOTO do, create methods, create variables, call them, use loops and such things.

     

    But GOTO is the devil.

     

    Mehdi