Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!Dortmund.Germany.EU.net!Germany.EU.net!howland.reston.ans.net!spool.mu.edu!news.cs.indiana.edu!shulick@guava.ucs.indiana.edu
From: "Sam Hulick" <shulick@guava.ucs.indiana.edu>
Subject: Inform: Capital "an", "a", etc...
Message-ID: <1995Sep1.203123.15302@news.cs.indiana.edu>
Organization: Vallen Software
Date: Fri, 1 Sep 1995 20:31:14 -0500
Lines: 72


Well, how strange..  Inform supports "print (a) obj" but not "print (A)
obj".  Either way, it doesn't use PrintOrRun(obj, article).  Anyway,
here is my problem.  I am making An and CAn ("an" and "An" respectively)
which will print out the obj's "article" property either capitalized or
not.  This is no problem.  In fact, the An() routine is done and works
great.  The problem is CAn.

[ An o;
   PrintOrRun(o, article, 1); print " "; PrintShortName(o);
];

[ CAn o;
   ... uhhhh 
];

If article were GUARANTEED to be just a string, I could easily
capitalize it.  But it's not.  It could be a routine:

   ...
   article [;
      if (self has general) print "a"; else print "the";
   ], ....

So what do I do now?  I could do something lame and make a global called
"cap_mode" and do this:

[ CAn o;
   cap_mode = 1;
   PrintOrRun(o, article, 1); print " "; PrintShortName(o);
];

   ...
   article [;
      if (self has general)
      { if (cap_mode == 1) print "A"; else print "a"; }
      else { if (cap_mode == 1) print "The"; else print "the"; }
   ], ...

Anyone have any ideas?

This will all be used with my 'visited creature' routine.  What I do is,
replace the Locale routine with my own, so when you first meet a
creature, it will say:

Room One
A neat room, blah blah blah.

You see a snake here.


Then after you have seen the snake, it says in the future:

You see the snake here.


It basically does this by giving the creature 'visited'.  So my article
routines actually look like this:

       article [;
          if (self hasnt visited) print "a"; else print "the";
       ],

Anyway, if anyone has any suggestions for this capitalization problem
(because of article being a routine, nota string), let me know.
 Thanks

-- 
--- Sam Hulick ------------- shulick@indiana.edu ---------------------
Systems Consultant        | Homepage:
Indiana College Placement |    http://copper.ucs.indiana.edu/~shulick/
  and Assessment Center   | PGP public key available on request
