Function EN Version 1.91

@ReadOSFile

Import OSFile

Syntax

@ReadOSFile(FILEHANDLE1;RETTYPE2;LENGTH3);
@ReadOSFile(FILEHANDLE1;RETTYPE2;TEXT3);
@ReadOSFile(FILEHANDLE1;RETTYPE2;TEXTLIST3);
@ReadOSFile(FILEHANDLE1;RETTYPE2;LENGTH3;STATUS4);
@ReadOSFile(FILEHANDLE1;RETTYPE2;TEXT3;STATUS4);
@ReadOSFile(FILEHANDLE1;RETTYPE2;TEXTLIST3;STATUS4);

Description

Reads a record of length FN LENGTH3 from the OS file identified by FILEHANDLE FILEHANDLE1. This record is returned as a variable of the data type specified in TEXT RETTYPE2.
If TEXT/TEXTLIST TEXT3/TEXTLIST3 is specified, reading continues until the first occurrence of one of the delimiter strings specified in TEXT3/TEXTLIST3.
The returned string does not include the delimiter string that caused the read operation to stop. On the next call to @ReadOSFile, reading continues with the character immediately following that delimiter string.
If @ReadOSFile is called with the parameter NUMBER STATUS4, the current read status is returned in that parameter:

0=OK
1=End of file
2=Error

If STATUS4 is omitted, reaching the end of the file during a read attempt causes @ERROR END OF FILE to be returned as soon as no more bytes could be read. However, this error message is not returned if STATUS4 is specified.

RETTYPE2:
A=TEXT
B=BINARY (derzeit as RICHTEXT)
N=NUMBER
F=FLOAT
L=FLOAT (konvertierter long)
D=FLOAT (konvertiertes DWORD)
T=TIMEDATE

Example: @ReadOSFile(FILEHANDLE1;RETTYPE2;LENGTH3)

FILEHANDLE1:=@OpenOSFile("C:\\TEST.TXT";"RT");
@LogReport(@ReadOSFile(FILEHANDLE1;"A";20));
FILEHANDLE1:=@CloseOSFile(FILEHANDLE1);

Opens the file "C:\\TEST.TXT", reads 20 text characters, outputs them, and then closes it again.

Example: @ReadOSFile(FILEHANDLE1;RETTYPE2;TEXT3)

FILEHANDLE1:=@OpenOSFile("C:\\TEST.TXT";"RT");
@LogReport(@ReadOSFile(FILEHANDLE1;"A";"*"));
FILEHANDLE1:=@CloseOSFile(FILEHANDLE1);

Opens the file "C:\\TEST.TXT", reads the text from the file up to the first "*" character, outputs it, and then closes it again.

Example: @ReadOSFile(FILEHANDLE1;RETTYPE2;TEXTLIST3)

FILEHANDLE1:=@OpenOSFile("C:\\TEST.TXT";"RT");
@LogReport(@ReadOSFile(FILEHANDLE1;"A";"*":@Newline));
FILEHANDLE1:=@CloseOSFile(FILEHANDLE1);

Opens the file "C:\\TEST.TXT", reads the text from the file up to the first "*" character or @Newline, outputs it, and then closes it again.

Example: @ReadOSFile(FILEHANDLE1;RETTYPE2;LENGTH3;STATUS4)

FILEHANDLE1:=@OpenOSFile("C:\\TEST.TXT";"RT");
@LogReport(@ReadOSFile(FILEHANDLE1;"A";20;Status));
FILEHANDLE1:=@CloseOSFile(FILEHANDLE1);

Opens the file "C:\\TEST.TXT", reads 20 text characters, outputs them, and then closes it again.
Status contains the current read status.

Example: @ReadOSFile(FILEHANDLE1;RETTYPE2;TEXT3;STATUS4)

FILEHANDLE1:=@OpenOSFile("C:\\TEST.TXT";"RT");
@LogReport(@ReadOSFile(FILEHANDLE1;"A";"*"));
FILEHANDLE1:=@CloseOSFile(FILEHANDLE1);

Opens the file "C:\\TEST.TXT", reads the text from the file up to the first "*" character, outputs it, and then closes it again.
Status contains the current read status.

Example: @ReadOSFile(FILEHANDLE1;RETTYPE2;TEXTLIST3;STATUS4)

FILEHANDLE1:=@OpenOSFile("C:\\TEST.TXT";"RT");
@LogReport(@ReadOSFile(FILEHANDLE1;"A";"*":@Newline));
FILEHANDLE1:=@CloseOSFile(FILEHANDLE1);

Opens the file "C:\\TEST.TXT", reads the text from the file up to the first "*" character or @Newline, outputs it, and then closes it again.
Status contains the current read status.

Note : This text was machine-translated and may contain inaccuracies.