Nicola,
In your first post, it work without #lookahead because "call Help" is before "sub help()". The compiler do not have to look ahead to know what "help()" is made of.
In your second post, I think you misunderstood how GOSUB work.
It might be good to look at the help for those... "gosub", "#lookahead".
For "call" I didn't see it in the help, seems that it is optional to use it.
"call Help" is the same as "Help".
//---------------------------
#lookahead // Here it is needed because greet(), ciao(), and help() are called before any declaration
use console
string tx = "Text 1"
call Help '"call" is optional
call ciao
gosub greetSub 'invoke local subroutines >>>inside<<< a procedure
call greet(tx)
greet("text 2")
wait
return 0 'End of program
greetSub:
print "in greetSub via GOSUB" & cr
ret 'Return to the line after the gosub greetSub was invoked
//---------------------------
sub help()
print("in sub help" & cr)
end sub
//---------------------------
sub ciao()
print("in sub ciao" & cr)
end sub
//---------------------------
sub greet(string tx)
print("in sub greet -[" & tx & "]" & cr)
end sub
//---------------------------
use console
//---------------------------
sub help()
print("in sub help" & cr)
end sub
//---------------------------
sub ciao()
print("in sub ciao" & cr)
end sub
//---------------------------
sub greet(string tx)
print("in sub greet -[" & tx & "]" & cr)
end sub
//---------------------------
'#lookahead // Here it is not needed because greet(), ciao(), and help() are preeceeding and known by the compiler
string tx = "Text 1"
call Help '"call" is optional
call ciao
gosub greetSub 'invoke local subroutines >>>inside<<< a procedure
call greet(tx)
greet("text 2")
wait
return 0 'End of program
greetSub:
print "in greetSub via GOSUB" & cr
ret 'Return to the line after the gosub greetSub
//---------------------------