Additional question
Jan Schenkel
janschenkel at yahoo.com
Wed Mar 31 00:52:39 EST 2004
--- Glen Bojsza <gbojsza at mac.com> wrote:
> Jan,
>
> Thanks for the clue...
>
> I seem to be able to check each explicit variable
> name for keys to see
> if it is an array. But when I try to use it with a
> combine command I
> get an error?
>
> So, if aname is composed of 2 variable names for
> example trial and
> score.
>
> combine trial with space -- generates an error
>
> get transpose(trial)
> combine it with space -- works and gives the
> associated values
>
> I want to be able to "cycle" through the aname list
> and manipulate the
> individual arrays - in this given case -- trial and
> score.
>
> Is it necessary to use the "do" function for this
> type of routines as
> well?
>
> **I heard that the "do" command degrades
> performance??
>
> Anyways, thanks for your help.
>
> regards,
>
> Glen
>
Hi Glen,
You'll need to use 'do' again to cycle through the
names ; unless you know the names in advance, but then
you could avoid the whole 'do' by using a lengthy
switch statement.
Just to show how flexible this can be, here's a bit of
code that I use to extract part of a bigger array into
a smaller array :
--
repeat for each line tSubKey in tSubKeys
put the keys of tBigDataA into tKeys
filter tKeys with tSubKey & ",*"
put "t" & tSubKey & "A" into tArrayName
do "local" && tArrayName
repeat for each line tKey in tKeys
put item 2 to -1 of tKey into tShortKey
put tBigDataA[tKey] into tData
do "put tData into" && tArrayName & "[tShortKey]"
end repeat
end repeat
--
As for 'do' degrading performance, it's absolutely
true, but sometimes it's the only way to make things
work -- and a slightly slower solution is better than
no solution at all, right ?
Best regards,
Jan Schenkel.
PS : I prefer having the questions and answers on the
list, as others might be facing the same problem and
not know where to start ; plus, you might not have to
wait until I get round to answering.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
More information about the use-livecode
mailing list