Page 1 of 1

extracting text from data grid

Posted: Mon May 31, 2010 7:44 am
by Tiger6920S
Good Morning!

I am new on Revolution and have some problems with data grid.
I am searching for a way to get several data from a column. For example I have a column with costs of some products and I have to sum up these costs but I don't know how to get the data for this specific column.

Could you help me please?

Thx!

Re: extracting text from data grid

Posted: Mon May 31, 2010 5:20 pm
by lohill
Tiger,
Are you familiar with dgData and/or dgText?
For example: 'put the dgText of group "DataGrid 1" into tData' will put all the data from the grid into a variable from which you can pull out the data line by line and column by column.

For the brave: 'put the dgData of group "DataGrid 1" into tArray' will put all the data into an array from which you can extract individual items. It took me a while to get used to this one.

Hope this gets you started,
Larry

Re: extracting text from data grid

Posted: Mon May 31, 2010 9:15 pm
by Tiger6920S
Hey Larry,
I know dgData and dgText but I don't know how to get what I want out of the variable...

Re: extracting text from data grid

Posted: Mon May 31, 2010 10:55 pm
by lohill
dgText is the easiest to work with in that case. if you have previously set the itemDelimiter to tab you can just say:
'put item 3 of line 5 of tData into myVar' and you have the contents of cell 3 of line 5 in that variable.

Once the DataGrid is in tData, you have lines delimited by Returns and 'cells' within line delimited by Tabs. Those 'cells' (delimited by tabs) contain words which are delimited by spaces.
Depending on your data you can say things like:
answer word 2 of item 3 of line 6 of tData


Have fun,
Larry

Re: extracting text from data grid

Posted: Thu Jun 03, 2010 7:03 am
by Tiger6920S
Great!
Thank you very much!