Hello,
I am using getFile to load file content to a string. It is also possible to return the number of lines in the file as it loads?
Function Dialog2
UPDATE
I managed to solve this using tok. I don't feel it is a very efficient or clean solution but it is working as needed.
Thank you
Matthew
I am using getFile to load file content to a string. It is also possible to return the number of lines in the file as it loads?
Function Dialog2
str fileTxt n
if OpenSaveDialog(0 n "Text files[]*.txt[]Image files[]*.bmp;*.gif[]All Files[]*.*[]")
,fileTxt.getfile(n)
,if string.len(fileTxt)
,out fileTxt
str n a fileTxt
ARRAY(str) arr
int d nt inc
,,if OpenSaveDialog(0 n "Text files[]*.txt[]Image files[]*.bmp;*.gif[]All Files[]*.*[]")
,,,a=fileTxt.getfile(n)
nt = tok(a arr)
for(d 0 nt)
,inc=inc+1
out F"The number of lines is {inc}"
UPDATE
I managed to solve this using tok. I don't feel it is a very efficient or clean solution but it is working as needed.
Thank you
Matthew