02-13-2012, 03:19 PM
I created a function for this. Will need less code if using in several places.
Function FindItemInTextFile
example
Macro Macro1649
Function FindItemInTextFile
;/
function! $file_ $item
;Finds a line in a text file.
;Returns 1 if found, 0 if not.
str sData.getfile(file_)
if(!sData.len) ret
IStringMap m=CreateStringMap(1|2)
m.AddList(sData "[]")
if(m.Get(item)) ret 1
example
Macro Macro1649