data grid code (color)

Sadhu Nadesan sadhu at castandcrew.com
Tue Apr 14 21:04:36 EDT 2009


hmmm... it occurs to me I could shorten this code by putting either the 
ssn or 'not found' into a variable and then have the line calling the 
dispatch command appear only once .. but that is not relevant to the 
problem.  upon reading it i see it's just bulkier than it has to be.

Sadhunathan Nadesan wrote:
>
> repeat with whichLine = 1 to the dgNumberOfLines of group "data grid 1" of card "data grid card"
>   put the dgIndexOfLine[whichLine] of group "data grid 1" of card "data grid card" into whichIndex  
>   if (foundSSN) then
>     dispatch "SetDataOfIndex" to group "data grid 1" of card "data grid card" \
>       with whichIndex, "col 9", employeeSSN  
>   else
>     dispatch "SetDataOfIndex" to group "data grid 1" of card "data grid card" \
>       with whichIndex, "col 9", "Not Found"
>     ## set the backgroundColor of graphic 1 of me to "red" - generates an error
>   end if
> end repeat
>   



More information about the use-livecode mailing list