On Wed, 7 Jun 2000 [EMAIL PROTECTED] wrote:
> I'm using your work-around, but I'd sure like something better. That
> work-around has two major problems:
> 1) The error message I usually get is "Can't open directory." This is a
> legal directory name! I can catch some but not all errors this way.
> 2) This makes a lot of assumptions about what MetaCard's doing, and what
> I'm doing. Change the statement to 'get commonDir() & "/" & userName();set
> the directory to it;answer the result'. Now, on success, the result will be
> userName(), not the value of 'it'. So I need to know a lot of history (and
> the order in which MetaCard executes the two functions) to determine what's
> an error.
>
> At a bare minimum this behavior needs to be documented. I spent a lot of
> time fighting this because:
> 1) 'set the directory to "my simple command line example" works differently
> from 'set the directory to
> myRealFunctionWhichIsNotVisibleToTheCommandLine()"' so I couldn't see what
> was going on.
> 2) 'Answer the result' clears the result (always, it can't return a value
> or an error), which made me think that 'set the directory' was clearing the
> result from the previous call to 'set the directory'
> 3) I can't find any discussion of what does and does not clear the result.
> (i.e. answer always set it to empty, set the directory only sets it on
> error, get/put never changes it.)
Well, at least you need to know that "ask" and "answer" are just
stacks, and so opening them causes handlers to be executed. The fact
that the result is cleared at the end of a handler *is* documented.
As a general rule, you should always check or save the result away in
the statement immediately following any command that may set it. The
doc should advise that you do this.
Regards,
Scott
********************************************************
Scott Raney [EMAIL PROTECTED] http://www.metacard.com
MetaCard: You know, there's an easier way to do that...
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.