Newsgroups: rec.arts.int-fiction
Subject: [TADS] debugging help
From: argus@see.the.sig (T Raymond)
Message-ID: <Xns9136E54C910B8TjR12537@209.25.157.130>
User-Agent: Xnews/4.05.11
NNTP-Posting-Host: 208.51.229.7
Date: 10 Oct 2001 21:09:22 -0500
X-Trace: corp.newsgroups.com 1002766162 208.51.229.7 (10 Oct 2001 21:09:22 -0500)
Lines: 55
X-Comments: This message was posted through Newsfeeds.com
X-Comments2: IMPORTANT: Newsfeeds.com does not condone, nor support,  spam or any illegal or copyrighted postings.
X-Comments3: IMPORTANT: Under NO circumstances will postings containing illegal or copyrighted material through this service be tolerated!!
X-Report: Please report illegal or inappropriate use to <abuse@newsfeeds.com>
X-Abuse-Info: Please be sure to forward a copy of ALL headers, INCLUDING the body (DO NOT SEND ATTACHMENTS)
Organization: Newsfeeds.com http://www.newsfeeds.com 80,000+ UNCENSORED Newsgroups.
Path: news.duke.edu!newsgate.duke.edu!news-hog.berkeley.edu!ucberkeley!newsswitch.lcs.mit.edu!howland.erols.net!netnews.com!xfer02.netnews.com!newsfeed1.cidera.com!Cidera!local-out2.newsfeeds.com!corp.newsgroups.com
Xref: news.duke.edu rec.arts.int-fiction:93427

In one of my WIPs, I'm trying to create a few handy debugging
commands to allow me to easily change a property setting on an actor.

What I am trying to do is have a prompt so I can type in the actor
name, with a second prompt for the property name. Depending on
current state of the property (true/nil), switch the state.

For example, if floyd.isActive (he's on) and I want to toggle him off
for testing, I'd like to take the input:

Whose property do you want to change: floyd
What property do you want to change: isActive

have it test the current state of floyd.isActive,
then switch to the opposite state.

It seems I might have to put the two inputs together into another
variable, or be converting the input somehow? I'm a bit lost here.
What I've got for code is below, I'd appreciate any help.


tflagVerb: deepverb          //toggle property command
    verb = 'tflag'           //for debugging
    sdesc = "toggleflag"
    action(actor)=
    {local act, prop;
      "Whose property do you want to change: ";
          act := input();
       "What property do you want to change: ";
          prop := input();

       if (act.prop = true)
       {"\([Switching flag for <<act.prop>>, <<act.prop>> is now
	    	NIL.]\)";
         act.prop := nil;
       }
       else
       {"\([Switching flag for <<act.prop>>, <<act.prop>> is now
	    	TRUE.]\)";
         act := true;
       }
    }
;


Tom
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Tom Raymond                        af956 AT osfnDOTorg
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
