LINEINPUT/de

From MCS Wiki AVR
< LINEINPUT(Difference between revisions)
Jump to: navigation, search
((**COPIED FROM ENGLISH PAGE**) =)
(Anmerkungen)
 
(5 intermediate revisions by one user not shown)
Line 17: Line 17:
 
<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 25: Line 25:
  
 
| valign="top" width="100%" style="width: 482px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 482px; border: 1px solid rgb(0, 0, 0);" |  
(Byte) File number, which identifies an opened file
+
(Byte) Filenummer mit der die geöffnete Datei identifiziert wird.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 32: Line 32:
  
 
| valign="top" width="100%" style="width: 482px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 482px; border: 1px solid rgb(0, 0, 0);" |  
(String) A string, which is assigned with the next line from the file.
+
(String) Ein String dem die nächste Zeile einer Datei zugewiesen wird.
  
 
|}
 
|}
Line 38: Line 38:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
Only valid for files opened in mode INPUT. Line INPUT works only with strings. It is great for working on text files.
+
Gilt nur für Dateien die im INPUT-Modus geöffnet sind. LINEINPUT arbeitet nur mit Strings und eignet sich somit besonders für Textdateien.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 44: Line 44:
 
<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]], [[LOC]], [[LOF]] , [[EOF]] , [[FREEFILE]] , [[FILEATTR]] , [[SEEK]] , [[BSAVE]] , [[BLOAD]] , [[KILL]] ,[[DISKFREE]] , [[DISKSIZE]] , [[GET]] , [[PUT]] , [[FILEDATE]] , [[FILETIME]] , [[FILEDATETIME]] , [[DIR]] , [[FILELEN]] , [[WRITE]] , [[INPUT]]
 
[[INITFILESYSTEM]] , [[OPEN]] , [[CLOSE]], [[FLUSH]] , [[PRINT]], [[LOC]], [[LOF]] , [[EOF]] , [[FREEFILE]] , [[FILEATTR]] , [[SEEK]] , [[BSAVE]] , [[BLOAD]] , [[KILL]] ,[[DISKFREE]] , [[DISKSIZE]] , [[GET]] , [[PUT]] , [[FILEDATE]] , [[FILETIME]] , [[FILEDATETIME]] , [[DIR]] , [[FILELEN]] , [[WRITE]] , [[INPUT]]
Line 70: Line 70:
  
 
| valign="top" width="38%" style="width: 237px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="38%" style="width: 237px; border: 1px solid rgb(0, 0, 0);" |  
r24: filenumber
+
r24: Filenummer
  
 
| valign="top" width="60%" style="width: 274px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="60%" style="width: 274px; border: 1px solid rgb(0, 0, 0);" |  
X: Pointer to String to be written from file
+
X-Zeiger auf den String der beschrieben werden soll.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 80: Line 80:
  
 
| valign="top" width="38%" style="width: 237px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="38%" style="width: 237px; border: 1px solid rgb(0, 0, 0);" |  
r25: Stringlength
+
r25: Länge des Strings
  
 
| valign="top" width="60%" style="width: 274px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="60%" style="width: 274px; border: 1px solid rgb(0, 0, 0);" |  
Line 90: Line 90:
  
 
| valign="top" width="38%" style="width: 237px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="38%" style="width: 237px; border: 1px solid rgb(0, 0, 0);" |  
r25: Errorcode
+
r25: Fehlercode
  
 
| valign="top" width="60%" style="width: 274px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="60%" style="width: 274px; border: 1px solid rgb(0, 0, 0);" |  
C-Flag: Set on Error
+
C-Flag: Bei einem Fehler gesetzt.
  
 
|}
 
|}
Line 101: Line 101:
 
&nbsp;
 
&nbsp;
  
= <span class="f_Header">Example</span> =
+
= <span class="f_Header">Beispiel</span> =
  
 
<br/><source lang="bascomavr">
 
<br/><source lang="bascomavr">

Latest revision as of 13:40, 28 February 2013

Contents

Funktion

Liest eine Zeile einer geöffneten Datei.

 

 

Syntax

LINEINPUT #bFileNumber, sLineText

LINE_INPUT #bFileNumber, sLineText

 

 

Anmerkungen

BfileNumber

(Byte) Filenummer mit der die geöffnete Datei identifiziert wird.

SlineText

(String) Ein String dem die nächste Zeile einer Datei zugewiesen wird.

 

Gilt nur für Dateien die im INPUT-Modus geöffnet sind. LINEINPUT arbeitet nur mit Strings und eignet sich somit besonders für Textdateien.

 

 

Siehe auch

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

 

 

ASM

Calls

_FileLineInput

 

Input

r24: Filenummer

X-Zeiger auf den String der beschrieben werden soll.

 

r25: Länge des Strings

 

Output

r25: Fehlercode

C-Flag: Bei einem Fehler gesetzt.

 

 

Beispiel


'Ok we want to check if the file contains the written lines
Ff = Freefile()' get file handle
Open "test.txt" For Input As #ff ' we can use a constant for the file too
Print Lof(#ff); " length of file"
Print Fileattr(#ff); " file mode"' should be 1 for input
Do
LineInput #ff , S ' read a line
' line input is used to read a line of text from a file
Print S ' print on terminal emulator
Loop Until Eof(ff)<> 0
'The EOF() function returns a non-zero number when the end of the file is reached
'This way we know that there is no more data we can read
Close #ff

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