Ok I can see quite a few problems in there, so i'll try and explain what they are and why they are and let you fix it.
Remeber a Sub (exampe EnterFactory
starts as a Label has some code and then a return statement at the end of it. (look at your Examine_Desk: and Hall_Locked
EnterFactory:
< Code >
return
Remember also when the code within the sub is run the return command will make the program go back to the line the sub was called from using the Gosub Command.
Your nested if statements look somewhat dodgy (If I were you I would look at the select command above). Remember an If, Else, IF is two if commands and as such will have two endifs.
IF <Condition>
<Do Code>
endif
IF <Condition>
<Do Code>
else ` if the condition is not met
<Do Code>
endif
IF <Condition>
<Do Code>
else ` if the condition is not met
IF <Condition>
<Do Code>
endif
endif
The thing to remember is if you add an if after the else you will need to close that if off with an endif before closing the if that the else belonged to. (Make sense?)
Be careful with the varible names you use with your Input function.
Input returns a string (basically text, thats why if your ifs you have "" around your numbers, they are not values but are text) which is why the varible sInput$ you have been using has a $ on the end of it, it means this data is text rather then a number.
In your EnterFactory sub you have
It would be wise to avoid using a second string name to be returned from an input command. (just because it makes the program harder to follow for yourself) If you want to "save" what a player has input earlier in the program I would advise you do something like.
Input "Choosing the wrong item code prove bad for you later one!",Input$
sChosenItem$ = sInput$
Just try reading through you subs in the order the program will, follow them through and return to the line they were called from and try and debug any oddities.
If you have ICQ i'm on now 123 - 214 - 874 and would be happy to help out with any question you have.
- Prep
To be no more, sad cure.