Re: Long Lines Question

Boyd Sweeney (starnet!apple!puzzler.nichols.com!sweeneyb)
Mon, 14 Feb 1994 08:41:49 -0500

>I have some long lines in my script that I would like to put on two lines
>so all of the text is readable and doesn't extend beyond the screen. How
>do I do this? I have tried using a '\' and it seems to work. Is this
>correct or is there a better way?
>
>Example:
>
> if field "Work Area" of card "Aster*x Words Blank Screen" \
> of stack "Scenario A Simulation" is not empty then
>
>I am specifying the stack and card names because the above script is for a
>button on a different stack (ie: multiple stacks are open concurrently).
>I know I could also shorten the names, but I would like to leave them
>descriptive so it will be easier for maintenance.
>
>Any comments?
>
Yes, the backslash is the proper character to use for line continuations.
I also like to make my coding as descriptive as possible, and seldom use
the shortened form of metatalk commands.

One thing that you might want to consider. If you're checking or setting
the values of several objects that reside in another stack, it might be
beneficial to set the global variable "defaultStack" to the name of that
stack. Referenced objects are always searched for in the defaultStack,
so that you would not have to specify a "path" to them. When you're
finished with objects in the other stack, set the defaultStack back to
the current stack.

I try to keep all references to a stack's objects in the stacks script.
For your example, I'd have a "Check_Work" handler in the "Scenario A
Simulation" that returns a true of false value, and I would reference
it as follows.
send "Check_Work" to stack "Scenario A Simulation"
if (the result is true) then

***************************************************************
* Boyd Sweeney Scientist, Nichols Research Corporation *
* sweeneyb@puzzler.nichols.com (205) 883-1170x1775 *
***************************************************************