A shorter way to express this?

David Glass dglass at graymattercomputing.com
Fri Feb 17 00:36:17 EST 2012


You could do something like:

put 1 into tArrayIndex
repeat for each line linData in field data
   put item 1 of linData into tDataArray[tArrayIndex]["first name"]
   put item 2 of linData into tDataArray[tArrayIndex]["last name"]
   ...
   add 1 to tArrayIndex
end repeat


On 02/16/2012 9:14 PM, Michael Chean wrote:
> Hi:
>
> I'm watching the tutorials (rewatching #3) and I was wondering whether some
> statements can be shortened.
>
> For instance
>
> repeat with x = 1 to the number of lines in field data
>       put item 1 of line x of field data into tDataArray[x]["first name"]
>       put item 2 of line x of field data into tDataArray[x]["last name"]
>       ...
> end repeat
>
> is there something like:
>       with field data
>           put item 1 of line x into tDataArray[x]['first name']
>          ...
>       endwith
>
> Just wondering.
>
> Mike

-- 
David Glass - Gray Matter Computing
graymattercomputing.com
Help Desk: http://www.graymattercomputing.com/helpdesk
559-303-4915




More information about the use-livecode mailing list