We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
random in a array
#4
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
[-] The following 1 user Likes WhTurner's post:
  • litdev
Reply


Messages In This Thread
random in a array - by francesco - 03-27-2026, 07:02 PM
RE: random in a array - by AbsoluteBeginner - 03-27-2026, 08:07 PM
RE: random in a array - by francesco - 03-29-2026, 08:47 AM
RE: random in a array - by WhTurner - 03-29-2026, 03:04 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)