|
Post by honky on Jun 4, 2021 9:28:48 GMT
Good morning all, One who knows is better than a hundred who seek. The question: How to transfer the lines of a texteditor into a array ? Thank you for. I know the number of lines The problem: I load a file that I display in a texteditor. I add data in the lines of the texteditor. I would like to transfer the new content of the texteditor to an array, and each row of the texteditor to be in an index of the array I do this:
dim tabul$(100) #w.te, "!contents? string$" t=1 for x=1 to len(string$) tabul$(t)=tabul$(t)+mid$(string$,x,1) if mid$(string$,x,1)=chr$(13) then t=t+1 next x for x=1 to n print tabul$(x) next x
it works but it adds a small rectangle to me at the end of each line, why? And he adds an empty line between each line, why? I don't want small rectangles or empty lines.
|
|
|
Post by Rod on Jun 4, 2021 12:19:05 GMT
The lines are terminated with a pair of characters not just one. They terminate with CrLf chr 13 and chr 10 You can use word$() with CrLf as the separator to get the lines back.
|
|
|
Post by honky on Jun 4, 2021 12:45:55 GMT
Rows always contain 7 datas (7 words) How do I modify my test line: "if mid$(string$,x,1)=chr$(13) then t=t+1" In:
#w.te, "!contents? string$" t=1 for x=1 to len(string$) tabul$(t)=tabul$(t)+mid$(string$,x,1) if mid$(string$,x,1)=chr$(13) then t=t+1 if tabul$(t)="" then t=t-1 next x
|
|
|
Post by honky on Jun 4, 2021 14:06:50 GMT
|
|