I am starting out with Revolution and I want to use Data Grids with a mySQL database. I have created a data grid on a card and put the following into the data grid group:
getProp uSelectedID
put the dgHilitedLines of me into theLine
put the dgDataOfLine[theLine] of me into myArray
put myArray["SuitcaseName"] into myAmount
return myAmount
end uSelectedID
Looking at the values in debug, I get a value of 2 for theLine, but myArray remains blank.
I assume that I have missed something somewhere, but what?
Any help would be appreciated.
Data Grid - getting current line data
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Data Grid - getting current line data
Your code looks right. If you print off the data in the Data Grid what does it look like?
How Can I See What The Data Grid's Internal Array Currently Looks Like?
How Can I See What The Data Grid's Internal Array Currently Looks Like?
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Data Grid - getting current line data
Thanks.
I have printed the contents and saw my mistake - I was not using the correct name for the field (I was using the column header as displayed rather than the column name!) What put me off the track of finding this was that the variables pane in debug mode was showing myArray a empty.
1
SCColour: `Black`
SCID: `1`
SCMake: `Tumi`
SCName: `Large Suiter`
2
SCColour: `Grey`
SCID: `2`
SCMake: `Delsey`
SCName: `Medium Suiter`
3
SCColour: `Grey`
SCID: `3`
SCMake: `Delsey`
SCName: `Small Suiter`
Again thanks for your help - I will press on with my learning.
I have printed the contents and saw my mistake - I was not using the correct name for the field (I was using the column header as displayed rather than the column name!) What put me off the track of finding this was that the variables pane in debug mode was showing myArray a empty.
1
SCColour: `Black`
SCID: `1`
SCMake: `Tumi`
SCName: `Large Suiter`
2
SCColour: `Grey`
SCID: `2`
SCMake: `Delsey`
SCName: `Medium Suiter`
3
SCColour: `Grey`
SCID: `3`
SCMake: `Delsey`
SCName: `Small Suiter`
Again thanks for your help - I will press on with my learning.