Axe Software Forums
  Quest Developer Forum
  Command statements vs procedures


Author Topic:   Command statements vs procedures
gamer1962 posted 19-06-2002 08:39 BST     
Is there an advantage to writing procedures over command statements or visa versa.
Alex posted 19-06-2002 20:20 BST          
I don't understand your question - procedures and command statements are two different things. Procedures are blocks of script commands, and command statements define what happens when the player types in a particular thing.
gamer1962 posted 21-06-2002 01:21 BST          
sorry about that, I noticed that commands can have complicated scripts with them. Some of the examples in the help file show both the a command written out to handle the entire scenario and a command that calls a procedure to handle the same entire scenario. I believe it was the "eat" command that showed the command statement handling the entire command and then another method with the "eat" command calling a procedure to handle the command. Obviously there is a no differance in the outcome but I thought there maybe standards of game writing that dictates when to use which method. Basically I didnt want to get a few pages of code written and then find that I should have use procedures instead of commands and have to rewrite them into procedures.
Alex posted 22-06-2002 17:11 BST          
Either way is handled in exactly the same way in Quest, so it's entirely up to you. I recommend only using a procedure where you need to call exactly the same code from more than one place, so usually the best thing to do is to have all the code as part of the "command" line.