3
我正在嘗試使用LiveCode清理一些聯繫人數據。我有兩個列表:LiveCode在表格字段中查找列表項
- SOURCELIST:在一個LiveCode表字段製表符分隔的聯繫人記錄列表;
- FlagList:我想檢查SourceList中的字符串列表,例如'test'。
理想情況下,我想突出顯示FlagList行中的'hits'和SourceList行中項目中的匹配字符,但是我在第一次傳遞時遇到了錯誤。在從文件加載SourceList時,我試圖設置在SourceList中找到的任何FlagList字段行的顏色。
這裏的「負荷SOURCELIST」按鈕的腳本...
on mouseUp
answer file "Select text file to Clean" with type "txt"
if it <> "" then
put empty into field "Source"
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
我覺得我在做一個基本的錯誤,所以感謝任何指導。
太棒了!感謝馬克 - 這是一種享受。謝謝澄清,'f'在這種情況下變成了一個變量。我認爲現在可以看到如何從中建立。 –
如果你喜歡答案,你也可以按向上指向的三角形;-) – Mark
哦,要有足夠高的聲譽,能夠促進有用的答案! ;-) –