Finding list items within a table field

Mark Schonewille m.schonewille at economy-x-talk.com
Sun Jul 14 11:03:11 EDT 2013


I answered your question on Stackoverflow.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com

We have time for new software development projects. Contact me for a quote.






On 14 jul 2013, at 17:00, Keith Clarke wrote:

> Hi folks,
> I've posted this question to Stack Overflow - http://stackoverflow.com/questions/17639968/livecode-find-list-items-within-a-table-field - but it seems very quiet over there on LiveCode matters, so apologies for t the cross-posting.
> 
> I'm trying to use LiveCode to clean up some contact data. I have two lists:
> 	SourceList: a list of tab-delimited contact records in a LiveCode table field;
> 	FlagList: a list of strings, such as 'test' that I want to check for within the SourceList.
> Ideally, I want to highlight 'hits' in both the FlagList rows and the matching characters in the items in the rows of the SourceList, but I'm struggling with errors on my first pass. 
> 
> On loading the SourceList from file, I'm trying to set the colour of any FlagList field rows that are found in the SourceList.
> 
> Here's the script on the 'Load SourceList' button...
> 
> on mouseUp
>   answer file "Select text file to Clean" with type "txt"
>   if it <> "" then
>      put empty into field "SourceList"
>      put it into field "SourceFile"
>      put it into theFilePath
>      put URL ("file:" & theFilePath) into field "SourceList"
> 
>  repeat for each line f in field "FlagList"
> 
>     repeat for each line l in field "SourceList"
> 
>        repeat for each item i in l
>            if i contains f then set the foregroundColor of f to "red"
>        end repeat
> 
>     end repeat
> 
>  end repeat
> 
>   else     
>      --no file was selected, or cancel was pressed
>      beep
>      end if
> end mouseUp
> 
> I think I'm making a basic error, so grateful for any guidance. 
> Best, 
> Keith..
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list