Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
command searchMe tString
local tIndexList, tRecord, tHLIndexes
put the dgIndexes of me into tIndexList
repeat for each item tIndex in tIndexList
put getDataOfIndex(tIndex) into tRecord
repeat for each element tElement in tRecord
if tElement contains tString then
put tIndex & comma after tHLIndexes
exit repeat
end if
end repeat
end repeat
delete the last char of tHLIndexes
set the dgHilitedIndexes of me to tHLIndexes
end searchMe
on mouseUp
local tSearchString
ask "Search Term?"
if it is not empty then put it into tSearchString
dispatch "searchMe" to group "DataGrid1" with tSearchString
end mouseUp
the problem is that I need to narrow down the search only in the first column named "NO" .
Any suggestions?
command searchMe tString
local tIndexList, tRecord, tHLIndexes
put the dgIndexes of me into tIndexList
repeat for each item tIndex in tIndexList
put the dgDataOfIndex[tIndex] of me into tRecord
## We only check this columns of each record:
if tRecord["NO"] contains tString then
put tIndex & comma after tHLIndexes
exit repeat
end if
end repeat
delete the last char of tHLIndexes
set the dgHilitedIndexes of me to tHLIndexes
end searchMe
Out of my head, but should work!
(Famous last words )
command searchMe tString
local tIndexList, tRecord, tHLIndexes
put the dgIndexes of me into tIndexList
repeat for each item tIndex in tIndexList
put the dgDataOfIndex[tIndex] of me into tRecord
## We only check this columns of each record:
if tRecord["NO"] contains tString then
put tIndex & comma after tHLIndexes
exit repeat
end if
end repeat
delete the last char of tHLIndexes
set the dgHilitedIndexes of me to tHLIndexes
end searchMe
Out of my head, but should work!
(Famous last words )