Datagrid - dgNumberOfLines not working in iOS
Posted: Sat Dec 04, 2010 6:07 pm
put the dgNumberOfLines of group "DataGrid" on Card "Card02" into theLineNo
Have tried every which way from Sunday to get Datagrid to work, with no luck.
We're using datagrid as a storage location for a 'database' or list of our site locations. 375 of them. Which our program steps though to find a matching site. IE: 0621, will display the site info for site 0621. Simple right. Works fine in Mac OS as an Application and in the LiveCode Development language, but not on the iOS device. It does not return the "dgNumberOfLines" which is requested before looping through the datagrid one item at a time.
What would appear to be a simple task just doesn't work. Am I missing something. Mind you I've added a LOT of code just to fine my error, (debug) but I don't think it is a programming error.
So most of this code shouldn't be needed.
Card 1 contains the input fields for the search, right now we are just working with one MailCode.
Card 2 contains the datagrid of 375ish data lines.
Card 3 displays the search results. Again this works fine in Mac OS, but nothing is ever displayed in iOS.
Logic error? Coding Error? Or LiveCode Error?
Anyone with ideas on why this doesn't work? Again I know a lot of the code really isn't needed I'm debugging here!
~David
-------------------------------------
set the dgFocus of group "DataGrid" on Card "Card02" to true
set the dgHilitedLines of group "DataGrid" on Card "Card02" to "1"
select of group "DataGrid" on Card "Card02"
put the dgNumberOfLines of group "DataGrid" on Card "Card02" into Field "MyNumberOfRecords" on Card "Card01"
put the dgNumberOfLines of group "DataGrid" on Card "Card02" into theLineNo
put Field "InputMailCode" on Card "Card01" into MailCodeSearch
put MailCodeSearch into field "MySearchFor" on Card "Card01"
show (1) cards
ClearDisplayOnCard03
if the length of MailCodeSearch = 4 then
repeat with LineCount = 1 to theLineNo
put LineCount into field "MyRecordCount" on Card "Card01"
set the dgHilitedLines of group "DataGrid" on Card "Card02" to LineCount
put the dgHilitedLines of group "DataGrid" on Card "Card02" into theLine
put the dgDataOfLine[theLine] of group "DataGrid" on Card "Card02" into theDataA
if MailCodeSearch = theDataA["MailCode"] then
put theDataA["Group"] into Field "Group" on Card "Card03"
put theDataA["MailCode"] into Field "MailCode" on Card "Card03"
put theDataA["FacilityName"] into Field "FacilityName" on Card "Card03"
put theDataA["FacilityAddress"] into Field "FacilityAddress" on Card "Card03"
put theDataA["City"] into Field "City" on Card "Card03"
put theDataA["State"] into Field "State" on Card "Card03"
put theDataA["Zip"] into Field "Zip" on Card "Card03"
put theDataA["Phone"] into Field "Phone" on Card "Card03"
put theDataA["FAX"] into Field "FAX" on Card "Card03"
put theDataA["MDCPSRegion"] into Field "MDCPSRegion" on Card "Card03"
put theDataA["ITSRegion"] into Field "ITSRegion" on Card "Card03"
put theDataA["VotingDistrict"] into Field "VotingDistrict" on Card "Card03"
put theDataA["SupportTeam"] into Field "SupportTeam" on Card "Card03"
go to Card "Card03"
exit repeat
end if
end repeat
end if
end mouseUp
On ClearDisplayOnCard03
put "Searching" into Field "Group" on Card "Card03"
put empty into Field "MailCode" on Card "Card03"
put empty into Field "FacilityName" on Card "Card03"
put empty into Field "FacilityAddress" on Card "Card03"
put empty into Field "City" on Card "Card03"
put empty into Field "State" on Card "Card03"
put empty into Field "Zip" on Card "Card03"
put empty into Field "Phone" on Card "Card03"
put empty into Field "FAX" on Card "Card03"
put empty into Field "MDCPSRegion" on Card "Card03"
put empty into Field "ITSRegion" on Card "Card03"
put empty into Field "VotingDistrict" on Card "Card03"
put empty into Field "SupportTeam" on Card "Card03"
end ClearDisplayOnCard03
---------------
Have tried every which way from Sunday to get Datagrid to work, with no luck.
We're using datagrid as a storage location for a 'database' or list of our site locations. 375 of them. Which our program steps though to find a matching site. IE: 0621, will display the site info for site 0621. Simple right. Works fine in Mac OS as an Application and in the LiveCode Development language, but not on the iOS device. It does not return the "dgNumberOfLines" which is requested before looping through the datagrid one item at a time.
What would appear to be a simple task just doesn't work. Am I missing something. Mind you I've added a LOT of code just to fine my error, (debug) but I don't think it is a programming error.
So most of this code shouldn't be needed.
Card 1 contains the input fields for the search, right now we are just working with one MailCode.
Card 2 contains the datagrid of 375ish data lines.
Card 3 displays the search results. Again this works fine in Mac OS, but nothing is ever displayed in iOS.
Logic error? Coding Error? Or LiveCode Error?
Anyone with ideas on why this doesn't work? Again I know a lot of the code really isn't needed I'm debugging here!
~David
-------------------------------------
set the dgFocus of group "DataGrid" on Card "Card02" to true
set the dgHilitedLines of group "DataGrid" on Card "Card02" to "1"
select of group "DataGrid" on Card "Card02"
put the dgNumberOfLines of group "DataGrid" on Card "Card02" into Field "MyNumberOfRecords" on Card "Card01"
put the dgNumberOfLines of group "DataGrid" on Card "Card02" into theLineNo
put Field "InputMailCode" on Card "Card01" into MailCodeSearch
put MailCodeSearch into field "MySearchFor" on Card "Card01"
show (1) cards
ClearDisplayOnCard03
if the length of MailCodeSearch = 4 then
repeat with LineCount = 1 to theLineNo
put LineCount into field "MyRecordCount" on Card "Card01"
set the dgHilitedLines of group "DataGrid" on Card "Card02" to LineCount
put the dgHilitedLines of group "DataGrid" on Card "Card02" into theLine
put the dgDataOfLine[theLine] of group "DataGrid" on Card "Card02" into theDataA
if MailCodeSearch = theDataA["MailCode"] then
put theDataA["Group"] into Field "Group" on Card "Card03"
put theDataA["MailCode"] into Field "MailCode" on Card "Card03"
put theDataA["FacilityName"] into Field "FacilityName" on Card "Card03"
put theDataA["FacilityAddress"] into Field "FacilityAddress" on Card "Card03"
put theDataA["City"] into Field "City" on Card "Card03"
put theDataA["State"] into Field "State" on Card "Card03"
put theDataA["Zip"] into Field "Zip" on Card "Card03"
put theDataA["Phone"] into Field "Phone" on Card "Card03"
put theDataA["FAX"] into Field "FAX" on Card "Card03"
put theDataA["MDCPSRegion"] into Field "MDCPSRegion" on Card "Card03"
put theDataA["ITSRegion"] into Field "ITSRegion" on Card "Card03"
put theDataA["VotingDistrict"] into Field "VotingDistrict" on Card "Card03"
put theDataA["SupportTeam"] into Field "SupportTeam" on Card "Card03"
go to Card "Card03"
exit repeat
end if
end repeat
end if
end mouseUp
On ClearDisplayOnCard03
put "Searching" into Field "Group" on Card "Card03"
put empty into Field "MailCode" on Card "Card03"
put empty into Field "FacilityName" on Card "Card03"
put empty into Field "FacilityAddress" on Card "Card03"
put empty into Field "City" on Card "Card03"
put empty into Field "State" on Card "Card03"
put empty into Field "Zip" on Card "Card03"
put empty into Field "Phone" on Card "Card03"
put empty into Field "FAX" on Card "Card03"
put empty into Field "MDCPSRegion" on Card "Card03"
put empty into Field "ITSRegion" on Card "Card03"
put empty into Field "VotingDistrict" on Card "Card03"
put empty into Field "SupportTeam" on Card "Card03"
end ClearDisplayOnCard03
---------------