On 7/6/00 2:31 am, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> How do I detect an error in a "Set Directory" statement?
>
> It appears that 'set the directory to "My Dir"; answer the result' will return
> an empty string on success, an error message on failure. This behavior makes
> sense.
>
> But 'set the directory to myFunction(); answer the result' appears to return
> the result of myFunction on success, and an error message on failure. I found
> this unacceptable because myFunction may return something that looks like an
> error.
>
> I'm assuming that 'the result' was getting confused by the function call. So
> I tried 'get myFunction(); set the directory to it; answer the result'. This
> form returns the value of 'it' on success, an error message on failure. So I
> have the same problem as with the function call.
Right: the function itself will set the result, and if setting the directory
works the result will not be altered. Only on failure of setting the
directory will the result be changed to indicate failure. Its borderline
that this might be considered a bug, but anyhow its easy to work around:
get myFunction()
put the result into tCheckResult
set the directory to it
if the result is not tCheckResult then
--we have an error
end if
Regards,
Kevin
Kevin Miller <[EMAIL PROTECTED]> <http://www.xworlds.com/>
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909. Fax: +44 (0)1639 830 707.
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.