Hi,

> I have a script that 'do(es) another script.
> The called script assembles a string and returns
> it to the caller by placing the string word as
> the last line in the script.  Fine.
> 
> But the called script has numerous places where
> an error can occur and I would like to return
> a partially assembled string at that point.
> How to do this?  'return only works in a function
> and 'halt doesn't seem to allow the script to return
> the last evaluated argument.
> 
> In psuedocode what I want is:
> 
> if (some condition)
> [
> return "string1"
> ]
> 
> but I obviously can't use 'return and the following:
> 
> if (some condition)
> [
> "string1"
> halt
> ]
> 
> does not return "string1" to the caller.
> 
> There doesn't appear to be a 'goto call where I can just
> go to the end of the script either.
> 
> How are you guys accomplishing this sort of thing?  (And more
> philosophically - why can't you use 'return in a script?)
> 
> TIA,
> 
> Rodney
> 
> 

you can try:

result: catch [
    do script
]

and in script:

if some-condition [
    throw string1
]

Reply via email to