PLEASE ANSWER ASAP!!!!!!!
PLEASE ANSWER ASAP!!!!!!!
how do you go back to the main moduel thing or the starting of the program after youre in a SUB??
Yeah, if it's an issue with code, maybe you can post the code that's giving you problems.
I don't know if this is what you're looking for, but you might be able to use a DO/LOOP to return to your choices if it's a menu in your program.
The code/pseudocode above will keep looping through the choices and after running a subroutine if a particular choice is made, will return to the choices.
I don't know if this is what you're looking for, but you might be able to use a DO/LOOP to return to your choices if it's a menu in your program.
Code: Select all
DO
'Code that display's menu and gets user input.
SELECT CASE userInput
CASE 'choice that calls a particular SUB
doSomething
CASE 'choice that sets a value or calls another SUB
something = 1
doSomethingElse
CASE ELSE 'default choice
something = 0
END SELECT
END SELECT
LOOP
Hi,
If i understand correctly you want to know how you're code goes back to the main module when you are running the code.
Say I have a sub named DisplayText, I would call it in my main module like so
Now when DisplayText is called it runs the code in DisplayText until it gets to the end of the sub (END SUB), or unless you use EXIT SUB. So say I have this code in DisplayText
Now once the code in the sub has finished running it will go back to the main module and move to the next line of code.
Hope this helps
If i understand correctly you want to know how you're code goes back to the main module when you are running the code.
Say I have a sub named DisplayText, I would call it in my main module like so
Code: Select all
call DisplayText()
Code: Select all
sub DisplayText()
Print "Hello, please type your name"
input usertext$
if usertext$ = "q" then
exit sub
else
print "You enter " + usertext$
end if
end sub
Code: Select all
print "Before sub"
call DisplayText
print "After sub"