Lof()
Syntax
Length = Lof()Description
Lof stands for 'Length Of File'. It will return the length of the current file.
file$ = OpenFileRequester("Select a file","","Text (.txt)|*.txt|All files (*.*)|*.*",0) If file$ If ReadFile(0,file$) length = Lof() ; get the length of opened file *MemoryID = AllocateMemory(length) ; allocate the needed memory If *MemoryID bytes = ReadData(*MemoryID, length) ; read all data into the memory block Debug "Number of bytes read: " + Str(bytes) EndIf CloseFile(0) EndIf EndIf
Supported OS
All