Hello SilentNinja2,
Even though I didn't test it, the set of code above was intended to represent a complete solution to the project that you proposed. The line that "blanks" the UserSentence is intended to prevent the opening of programs by Hal, if the code-set is inserted early enough in the script.
Specifically regarding your question, the "program opening" commands occur in the Enhanced_Main.brn file, in Zabaware's "default" folder. Here is an excerpt from that database:
" START THE PROGRAM ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" RUN THE PROGRAM ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" OPEN THE PROGRAM","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" EXECUTE THE PROGRAM ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" I WANT TO WORK IN ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" I WANT TO PLAY ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
" I WANT TO PLAY IN ","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"
" START THE PROGRAM ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
" RUN THE PROGRAM ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
" OPEN THE PROGRAM ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
" EXECUTE THE PROGRAM ","","","<RUNIT>","","",2,#TRUE#,#FALSE#,"</RUNIT>"
The syntax and structure of the above database entries allow Hal to "trap" the names of desired programs between the <RUNIT> </RUNIT> tags (which work just like HTML tags) and cause Hal to attempt to open them. The Enhanced_Main.brn is called from the script, of course, and this call can be prevented in several ways, including the one that I suggest.
If you want to see every instance in which this file name is called from within the .uhp script, open the .uhp script as if to edit it, and then search for the string "Enhanced_Main" using the word processor or Ultra-Hal-Editor search/find function. I think that you will only find one or two instances of calls to this particular database.
For a complete explanation of the structure of the entries in this database, check out my previous postings (use the forum search function for "Ferguson" and/or "database"). My postings about Basics of UltraHal Programming Part II or Editing Files or Enhanced Brain 216 may be helpful.
If you decide to write a block of code using a completely different approach than the one I took, it would be very kind of you if you could post it, to help other programmers.
I hope that you are getting a lot of enjoyment from Ultra Hal! Have a great day!
Sincerely,
Don