Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bumin
Partner - Creator II
Partner - Creator II

how to use the goto command in a macro

Hi,

I want to skip some lines in a macro. Therefore I want to use the goto command.

Qlikview doesn't accept the code the line "goto Step2".

How is the syntax for goto?

my macro code

Sub BABPrint()

' Definition zu druckende Herbergen

    Set JHs = ActiveDocument.Fields("HausID").GetPossibleValues

    Set JHsBezeichnung = ActiveDocument.Fields("HausShortName").GetPossibleValues

   

goto Step2

    For i = 0 to JHs.count -1

        ActiveDocument.Fields("HausID").Select JHs.item(i).Text

        ActiveDocument.Fields("HausShortName").Select JHsBezeichnung.item(i).Text

       

        BAB_StartBericht()

      

        ActiveDocument.Fields("HausShortName").Select ""

    Next

Step2:

ActiveDocument.Fields("HausID").Select "32*"
BAB_StartBerichtSpezial("320#321") 

end sub

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I believe there is no GoTo label statement in VBScript. The GoTo keyword is used only as part of the On Error statement for disabling error handling, as follows:

1

On Error GoTo 0

To control the execution flow, you'll need to use If..Then..Else, Select..Case and other flow control statements.



edit: Or comment that part of your script code you want to skip

View solution in original post

2 Replies
swuehl
MVP
MVP

I believe there is no GoTo label statement in VBScript. The GoTo keyword is used only as part of the On Error statement for disabling error handling, as follows:

1

On Error GoTo 0

To control the execution flow, you'll need to use If..Then..Else, Select..Case and other flow control statements.



edit: Or comment that part of your script code you want to skip

bumin
Partner - Creator II
Partner - Creator II
Author

thanks for the answer

I have put comment in  this part