Newbie question

Anonymous
27 Feb 2004, 19:22
I'm really enjoying the software so far, but I'm too much of a newbie.

I'm trying to make a command work, but so far no luck.
I know I'm doing something wrong, but mainly I just want this response (The button does not seem to do anything. It appears to be broken.|n|nYou think for a minute, "Where did I put that remote?") to the user either typing "use button" or "push button".

Thanks

Here is my code:

define object <On/Off Button>
alt <Button; Television Button; TV Button>
look <It looks like an On/Off button for the television.>
take msg <The button seems quite attached to the television set.>
speak <Do you think you are in some crazy future house where every inanimate object responds to voice commands? Well, you're not!>
examine <The button seems very worn from years of use. It would be suprising if the button still worked at all.>
article <it>
command <use #@On/Off Button#; push #@On/Off Button#>
msg <The button does not seem to do anything. It appears to be broken.|n|nYou think for a minute, "Where did I put that remote?">
use anything msg <That does not seem to accomplish anything.>
use on anything msg <The button can only be used itself. You cannot use it on something else. Did you try just using the button?>
type <TLTscenery>
properties <noTake=The button seems quite attached to the television set.; noWear=Are you just insane? That button couldn't cover anything on your body!>

end define

Anonymous
27 Feb 2004, 20:32
I figured it out:

command <use #@text#> {
if (#@text# = On/Off Button) then msg <The button does not seem to do anything. _
It appears to be broken.|n|nYou think for a minute, "Where did I put that remote?">
else exec <use #text#; normal> }




I still don't really understand the difference between the #....# and the #@....#. Can someone explain it to me yet again. I have read the documents and when I do, I believe I understand it, but how I was raised the only true way to understand something is to be able to explain it to someone else and right now I'm at a loss for words.

codingmasters
29 Feb 2004, 06:22
#...# contains a string variable, while #@...# hold an object name variable (I think)

Matthew G.

Alex
29 Feb 2004, 10:26
The difference is explained in http://www.axeuk.com/quest/developer/as ... mmands.htm , about 3/4 down under "Two ways of referring to a string variable".

There's also a bit in the QDK manual at http://www.axeuk.com/quest/developer/as ... mmands.htm .