Using Arrays

Van Brollini analog_test at runbox.com
Fri Jun 3 21:50:57 EDT 2011


----- Start Original Message -----
Sent: Fri, 3 Jun 2011 19:36:36 -0600
From: Mike Bonner <bonnmike at gmail.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Subject: Re: Using Arrays

> dgtext isn't an array value, to do what you want you need to get the dgdata
> 
> For example, if you have a simple table grid with 2 columns, col1 and col2
> with 3 records, to get the array back out do
> 
> *get the dgdata of group "yourdatagridgroupname" *
> *put it into tArray*

works fine


> 
> At this point, knowing whats in the grid if you
> 
> *put the keys of tArray*
> since there are 3 records, the keys will be 1, 2 and 3 will be displayed in
> the message box.

works fine

 If you then *put the keys of tArray[1]* you will see the
> column keys, col1 and col2,

works fine

 so to get a specific cell is as you've been
> trying to do with the dgtext  tarray[1]["col1"] will get the data from row 1
> col 1.
> 


I still don't see where you have told me how to access a specific element in the array. What am I missing?


> if you get the dgtext, it should react like a tab delimited flat file.  So
> if you
> 
> *get the dgtext of group "mydatagridgroup"*
> *put it*
> 
> it should display all rows and columns of the datagrid in the message box
> 


yes this does this.


> On Fri, Jun 3, 2011 at 7:09 PM, Van Brollini <analog_test at runbox.com> wrote:
> 
> > I have a datagrid of 1250 by 28 that has been successfully uploaded during
> > the creation of the datagrid.
> >
> > I can use this line
> > put the dgText of group "DGTester" into tArray
> > to move the datagrid into an array.  During debug process with breakpoint,
> > this is successful.
> >
> > Now when I try to read, modify, compute results I get nothing.
> >
> > I have used get tArray[1][16] to query the array and get NULL.
> > I have tried to put "3.79e-6" into tArray[1][16] and the whole array ends
> > up NULL.
> >
> > What do I need to do to access individual elements of the array, modify
> > them and put their answers back into the array.  In C this is a piece of
> > cake, however, LiveCode is not releasing her secrets to me as yet.
> >
> > Thanks
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

----- End Original Message -----




More information about the use-livecode mailing list