vickerps Posted March 5, 2004 Share Posted March 5, 2004 Ok i am guilty of use the goto command I agree that it shouldn't be used any more but I am wondering how right to different path for example if you choose yes to a text box you are a ask and the script goes in a completely different direction to if you choose no Link to comment Share on other sites More sharing options...
ezzetabi Posted March 5, 2004 Share Posted March 5, 2004 (edited) $answer = MsgBox(3,"So?","Do you want to do the thing?") Select Case $answer = 6 GoSub,ansno Case $answer = 7 GoSub,anscan Case $answer = 2 GoSub,ansyes EndSelect exit Func ansno() ;--------The user pressed no EndFunc Func ansyes() ;--------The user pressed yes EndFunc Func anscanc() ;--------The user pressed cancel EndFunc Edited March 5, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
vickerps Posted March 5, 2004 Author Share Posted March 5, 2004 Thanks for the quick reply What do you do if there a sub paths ? $answer = MsgBox(3,"So?","Do you want to do the thing?") Select Case $answer = 6 GoSub,ansno Case $answer = 7 GoSub,anscan Case $answer = 2 GoSub,ansyes EndSelect exit Func ansno() ;--------The user pressed no $answer = MsgBox(3,"So?","Do you want to do another thing?") EndFunc Func ansyes() ;--------The user pressed yes EndFunc Func anscanc() ;--------The user pressed cancel EndFunc Link to comment Share on other sites More sharing options...
ben_josephs Posted March 5, 2004 Share Posted March 5, 2004 Or $answer = MsgBox ( 3, "Hmm?", "Yes or No?" ) if $answer = 6 then MsgBox ( 0, "", "You said Yes." ) elseif $answer = 7 then MsgBox ( 0, "", "You said No." ) elseif $answer = 2 then MsgBox ( 0, "", "You said Maybe." ) endif Link to comment Share on other sites More sharing options...
ezzetabi Posted March 5, 2004 Share Posted March 5, 2004 just nest ... Every func is a separate program.. Link to comment Share on other sites More sharing options...
vickerps Posted March 5, 2004 Author Share Posted March 5, 2004 Is there any more example of "Gosub" anywhere because when i try i keep getting a error Do you have to declare Func or somethingexample of script. GoSub, terminal Func terminal() ;----does somethingError createdGoSub, terminalERRORError:unknown function name Link to comment Share on other sites More sharing options...
GrahamS Posted March 5, 2004 Share Posted March 5, 2004 V3 does not contain a GoSub command. What you do is write the function name with round brackets after it, e.g. terminal() Func terminal() ;----does something EndFunc ; Don't forget this! GrahamS Link to comment Share on other sites More sharing options...
vickerps Posted March 5, 2004 Author Share Posted March 5, 2004 figure it out via the examples Thankyou Thou Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now