LOC/de

From MCS Wiki AVR
< LOC(Difference between revisions)
Jump to: navigation, search
 
(Anmerkungen)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== (**COPIED FROM ENGLISH PAGE**) === <span class="f_Header">Action</span> =
+
= <span class="f_Header">Funktion</span> =
  
Returns the position of last read or written Byte of the file
+
Gibt die Position des zuletzt gelesenen oder geschriebenen Bytes eines Files zurück.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
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" style="border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" style="border: 1px solid rgb(0, 0, 0);" |  
(Byte) File number, which identifies an opened file
+
(Byte) File number, des geöffneten Files
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 30: Line 30:
  
 
| valign="top" style="border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" style="border: 1px solid rgb(0, 0, 0);" |  
(Long) Variable, assigned with the Position of last read or written Byte (1-based)
+
(Long) Variable, der die Position des letzten gelesenen oder geschriebenen Bytes zugewiesen wird (1-based)
  
 
|}
 
|}
Line 36: Line 36:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
This function returns the position of the last read or written Byte. If an error occurs, 0 is returned. Check DOS-Error in variable gbDOSError. If the file position pointer is changed with the command SEEK, this function can not be used till the next read/write operation.
+
Diese Funktion gibt die Position des zuletzt gelesenen oder geschriebenen Bytes zurück. Im Fehlerfall ist der Rückgabewert 0.
  
<span style="font-family: Arial;">&nbsp;</span>
+
Überprüfen Sie die Fehlernummer aus der Variable gbDOSERROR.
  
This function differs from VB. In VB the byte position is divided by 128.
+
Wurde der Datei-Positions-Zeiger mit dem Befehl SEEK versetzt, kann diese Funktion nicht verwendet werden bis erneut eine Lese-/Schreib-Operation ausgeführt wurde.  
 +
 
 +
 
 +
<span style="font-family: Arial;">&nbsp;</span>
  
 +
Diese Funktion unterscheidet sich von VB. In VB ist die Byte-Position durch 128 geteilt.
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">See also</span> =
+
= <span class="f_Header">Siehe auch</span> =
  
 
[[INITFILESYSTEM]] , [[OPEN]] , [[CLOSE]], [[FLUSH]] , [[PRINT]], [[LINE INPUT]], [[LOF]] , [[EOF]] , [[FREEFILE]] , [[FILEATTR]] , [[SEEK]] , [[BSAVE]] , [[BLOAD]] ,[[KILL]] , [[DISKFREE]] , [[DISKSIZE]] , [[GET]] , [[PUT]] , [[FILEDATE]] , [[FILETIME]] , [[FILEDATETIME]] , [[DIR]] , [[FILELEN]] , [[WRITE]] , [[INPUT]]
 
[[INITFILESYSTEM]] , [[OPEN]] , [[CLOSE]], [[FLUSH]] , [[PRINT]], [[LINE INPUT]], [[LOF]] , [[EOF]] , [[FREEFILE]] , [[FILEATTR]] , [[SEEK]] , [[BSAVE]] , [[BLOAD]] ,[[KILL]] , [[DISKFREE]] , [[DISKSIZE]] , [[GET]] , [[PUT]] , [[FILEDATE]] , [[FILETIME]] , [[FILEDATETIME]] , [[DIR]] , [[FILELEN]] , [[WRITE]] , [[INPUT]]
Line 72: Line 76:
  
 
| valign="top" width="37%" style="width: 230px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="37%" style="width: 230px; border: 1px solid rgb(0, 0, 0);" |  
r24: filenumber
+
r24: Filenummer
  
 
| valign="top" width="100%" style="width: 319px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 319px; border: 1px solid rgb(0, 0, 0);" |  
X: Pointer to Long-variable, which gets th result
+
X-Zeiger auf Variable(LONG) die das Ergebnis erhält.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 82: Line 86:
  
 
| valign="top" width="37%" style="width: 230px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="37%" style="width: 230px; border: 1px solid rgb(0, 0, 0);" |  
r25: Errorcode
+
r25: Fehlercode
  
 
| valign="top" width="100%" style="width: 319px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 319px; border: 1px solid rgb(0, 0, 0);" |  
C-Flag: Set on Error
+
C-Flag: Bei einem Fehler gesetzt.
  
 
|}
 
|}
Line 95: Line 99:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Example</span> =
+
= <span class="f_Header">Beispiel</span> =
  
 
<br/><source lang="bascomavr">
 
<br/><source lang="bascomavr">

Latest revision as of 11:38, 28 February 2013

Contents

Funktion

Gibt die Position des zuletzt gelesenen oder geschriebenen Bytes eines Files zurück.

 

 

Syntax

lLastReadWritten = LOC (#bFileNumber)

 

 

Anmerkungen

bFileNumber

(Byte) File number, des geöffneten Files

lLastReadWritten

(Long) Variable, der die Position des letzten gelesenen oder geschriebenen Bytes zugewiesen wird (1-based)

 

Diese Funktion gibt die Position des zuletzt gelesenen oder geschriebenen Bytes zurück. Im Fehlerfall ist der Rückgabewert 0.

Überprüfen Sie die Fehlernummer aus der Variable gbDOSERROR.

Wurde der Datei-Positions-Zeiger mit dem Befehl SEEK versetzt, kann diese Funktion nicht verwendet werden bis erneut eine Lese-/Schreib-Operation ausgeführt wurde.


 

Diese Funktion unterscheidet sich von VB. In VB ist die Byte-Position durch 128 geteilt.  

 

Siehe auch

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

 

 

ASM

Calls

_FileLoc

 

Input

r24: Filenummer

X-Zeiger auf Variable(LONG) die das Ergebnis erhält.

Output

r25: Fehlercode

C-Flag: Bei einem Fehler gesetzt.

 


 

Beispiel


'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