Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

try to call a sub routine from for...next

Goodafternoon,

I want to call a sub from a for..next routine.

for i=0 to NoOfRows('Artikel')

     Let Art = peek('ARTIKELNUMMER',$(i),'Artikel');

    

     CALL Inkoop($(Art));      //<-----Script fails with message: Error in scriptsentence:Call Inkoop(12345678)

NEXT i;

Sub Inkoop(Art)

     'Do something

End Sub;

Why does the code fail?

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

The reason is that the sub must be defined before you call it so move the code sub..end sub before the for next routine

Hope it helps

View solution in original post

2 Replies
alexandros17
Partner - Champion III
Partner - Champion III

The reason is that the sub must be defined before you call it so move the code sub..end sub before the for next routine

Hope it helps

Not applicable
Author

Thank you very much alexandros17.

that was the trigger.