ok, I would suggest a few things
1. Indent your loops
2. Don't make your subroutines the same as REAL commands (make them do_command or something like that)
3. Take out the return after hotool and make all of the "gosub hotool" lines "goto hotool"
4. Even though your end command is in a subroutine, put another in. This should separate your subroutines from your main code, this stops the program from accidentally running into subroutines and executing them when they aren't supposed to
*NOTE: You may want to consider using functions rather than subroutines for your different commands.
ok now for your if commands
what the first one in every set says basically if the input is THIS then do that but if it isn't THIS then go back.
this begins to contradict itself with other if's structured the same way (it will always go back to hotool if it isn't the first one)
try using the select command. This is like a multi-if then statement. Not sure of the syntax I think it is:
select VARIABLE
case VALUE1:COMMAND:endcase
case VALUE2:COMMAND:endcase
case VALUE3:COMMAND:endcase
endselect
the variable in this case would be the input string
the value1,2,and 3, would be the different commands "print" "exit" etc. the command section is where you put all the things that should be done if the variable equals the value.
now to answer your question of why you had to type the same thing multiple times, I will follow your programs logic starting from hotool and assuming that the command is cls.
input hot$
gosub hotool
input hot$
return=>returns to the line AFTER the gosub was called
gosub hotool
input hot$
return to the next case
gosub hotool
input hot$
return to the next case
gosub hotool
input hot$
return to the next line
hot$ IS "cls" so cls
As you can see, because of the use of gosubs, rather than goto, you are constantly jumping back and forth.
You could even probably put the input command into your do loop and omit the gosub/goto hotool altogether, then at the end of your command subroutines just return.
Hope these tips help!
Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?