LOF/de

(Difference between revisions)
Jump to: navigation, search
(Funktion)
(Remarks)
Line 15: Line 15:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <span class="f_Header">Anmerkungen</span> =
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="609" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="609" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
Line 23: Line 23:
  
 
| valign="top" width="100%" style="width: 434px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 434px; border: 1px solid rgb(0, 0, 0);" |  
(Byte) Filenumber, which identifies an opened file
+
(Byte) Filenumber, die  which identifies an opened file
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"

Revision as of 07:21, 1 March 2013

Contents

Funktion

Gibt die Länge einer Datei in Bytes zurück.

 

 

Syntax

lFileLength = LOF (#bFileNumber)

 

 

Anmerkungen

bFileNumber

(Byte) Filenumber, die which identifies an opened file

LFileLength

(Long) Variable, which assigned with the Length of the file (1-based)

 

This function returns the length of an opened file. If an error occurs, 0 is returned. Check DOS-Error in variable gbDOSError.

 

 

See also

INITFILESYSTEM , OPEN , CLOSE, FLUSH , PRINT, LINE INPUT, LOC, EOF , FREEFILE , FILEATTR , SEEK , BSAVE , BLOAD ,KILL , DISKFREE , DISKSIZE , GET , PUT , FILEDATE , FILETIME , FILEDATETIME , DIR , FILELEN , WRITE , INPUT

 

 

ASM

Calls

_FileLOF

 

Input

r24: filenumber

X: Pointer to Long-variable, which gets th result

Output

r25: Errorcode

C-Flag: Set on Error

 

 

Example


'open the file in BINARY mode
Open "test.biN" For Binary As #2
Put #2 , B ' write a byte
Put #2 , W ' write a word
Put #2 , L ' write a long
Ltemp = Loc(#2)+ 1 ' get the position of the next byte
Print Ltemp ;" LOC"' store the location of the file pointer
Print Lof(#2);" length of file"
Print Fileattr(#2);" file mode"' should be 32 for binary
Put #2 , Sn ' write a single
Put #2 , Stxt ' write a string
 
Flush #2 ' flush to disk
Close #2

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language