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