Posts: 2
Threads: 1
Likes Received:
0 in 0 posts
Likes Given: 0
Joined: Jun 2024
Reputation:
0
the line of code
lunghezza = Array.GetItemCount(contenuto) ' mi da' lunghezza = 0 ERRORE
give me a lunghezza equal zero = 0
Posts: 2
Threads: 1
Likes Received:
0 in 0 posts
Likes Given: 0
Joined: Jun 2024
Reputation:
0
contenuto = File.ReadContents(filePath)
contenuto = A
B
C
lunghezza = Array.GetItemCount(contenuto)
lunghezza = 0
Posts: 21
Threads: 0
Likes Received:
30 in 16 posts
Likes Given: 16
Joined: Nov 2023
Reputation:
6
File.ReadContents() doesn't automatically put each line in an array element.
If you put a TextWindow.WriteLine(contenuto) after the ReadContents you see all the lines.
If there are no empty lines in the file you can do something like:
for i=1 to 999 ' ' if there are not more then 999 lines in the file
contenuto[i]=File.ReadLine(filepath,i)
if contenuto[i]="" then
i=1000
else
lunghezza=i
endif
endfor