How does 'Create Folder' give its result?

Jim Ault JimAultWins at yahoo.com
Thu Mar 16 18:20:24 EST 2006


On 3/16/06 1:48 PM, "Stephen Barncard" <stephenREVOLUTION at barncard.com>
wrote:
> Have you put the command in a 'try' structure?>
> Syntax: 
> try
>    statementList
> catch errorVariable   errorStatementsList
>    [finally   cleanupStatementsList]
> end try
>snip
> 
> Use the try control structure to execute a series of statements and
> handle any error messages in the catch section, instead of letting
> Revolution display the error window.

The "catch" with using [try-catch] with the [create folder] failure is that
it is not a Rev error, so no catch is triggered.  You do need to test the
result returned by the operating system.

A Rev error is one that is a operation such as
put 4 * marbleCount into totalMarbles
and marbleCount is not a number.  In this case, a try structure would work
and allow some alternate course of action without stopping the program.

Jim Ault
Las Vegas

> 
>> Graham Samuel wrote:
>> 
>>> Thanks for the reply, but my point is that the 'create folder'
>>> function doesn't appear to me to return anything in 'the result'
>>> when  an error occurs: 'the result' just goes on being empty - but
>>> the  command does apparently generate an error text because I can
>>> see it  in the message box.
>> 
>> The result is very fragile, and is usually emptied almost
>> immediately. To make sure you catch it, you have to check for it in
>> the very next line of script. Do you have any lines of script
>> between the "create" command and the result check?
>> 
>> --
>> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
>> HyperActive Software           |     http://www.hyperactivesw.com





More information about the Use-livecode mailing list