31142 lines/cards/records

Rob Cozens rcozens at pon.net
Wed Nov 20 12:20:00 EST 2002


>--- "Ivers, Doug E" <Doug_Ivers at lord.com> wrote:
>>  How do I define a constant array and insert values
>>  outside of all handlers at the top of a script?  Is
>>  it possible?
>>
>>  I tried this:
>>
>>  constant myArray_c[1] = "left"
>>  constant myArray_c[2] = "mid"
>>  constant myArray_c[3] = "right"
>>
>>
>>
>>  -- D
>>
>
>Hi Doug,
>
>In the Transcript dictionary it is explained that the
>'constant' command only works for numbers, characters,
>logical values and strings.
>So I'd say it isn't possible.

I think Jan is correct, Doug; but here is a workaround

constant left = 1
constant mid = 2
constant right = 3

put leftValue into myArray_c left]
put midValue into myArray_c[mid]
put rightValue into myArray_c[right]

get myArray[alignBy] -- assumes alignBy is "left", "mid", or "right"

Since I don't know the the details of what you are trying to 
accomplish, you may need to tweek it a bit.
-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)



More information about the use-livecode mailing list