Need Read Line Help.

Blitz3D Forums/Blitz3D Beginners Area/Need Read Line Help.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The easiest way is to use types. The following code creates a new aline (which is a blitz type defined to contain a single string) for each line of the file it reads. Once the lines have been read into memory using blitz types, it is very easy to loop through the document using the For Each method:

Type aline
	Field	astring$
End Type

filein=ReadFile("c:\testing.html") 

While Not Eof(filein)
	a.aline=New aline
	a\astring=ReadLine(filein)
Wend
CloseFile(filein)

For a.aline=Each aline
	Print a\aline
Next