Function EN Version 4.60

@ReadAttachedFile

Attachments Database Import Note

Syntax

@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;LENGTH3);
@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;TEXT3);
@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;TEXTLIST3);
@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;LENGTH3;STATUS4);
@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;TEXT3;STATUS4);
@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;TEXTLIST3;STATUS4);

Description

Reads a record of length FN LENGTH3 from the file attachment identified by OBJECTFILEHANDLE OBJECTFILEHANDLE1. This record is returned as a variable of the data type specified by 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 @ReadAttachedFile, reading continues with the character immediately following that delimiter string.
If @ReadAttachedFile 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: @ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;LENGTH3)

DBHANDLE1:=@OpenDB("TESTDB\\TESTDB1.NSF");
NOTEID:=8450;
NOTEHANDLE1:=@OpenNoteByID(DBHANDLE1;NOTEID;NOTEHANDLE1);

FNATTACHMENTNUMBER2:=1;
MODE3:="RB";
OBJECTFILEHANDLE1:=@OpenAttachedFile(NOTEHANDLE1;FNATTACHMENTNUMBER2;MODE3);

RETTYPE2:="A";
LENGTH3:=10;
READ_TEXT:=@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;LENGTH3);
@LogReport(READ_TEXT);
OBJECTFILEHANDLE1:=@CloseAttachedFile(OBJECTFILEHANDLE1);

NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
DBHANDLE1:=@CloseDB(DBHANDLE1);

The DB with the OSPATH "TESTDB\\TESTDB1.NSF" is opened.
The document with NOTEID 8450 is opened.
The first file attachment of this document is opened.
The first 10 bytes of this file attachment are read as TEXT and output to the APILOG.
The file attachment is closed again.
The document is closed again.
The DB is closed again.

Example: @ReadOSFile(FILEHANDLE1;RETTYPE2;TEXT3)

DBHANDLE1:=@OpenDB("TESTDB\\TESTDB1.NSF");
NOTEID:=8450;
NOTEHANDLE1:=@OpenNoteByID(DBHANDLE1;NOTEID;NOTEHANDLE1);

FNATTACHMENTNUMBER2:=1;
MODE3:="RB";
OBJECTFILEHANDLE1:=@OpenAttachedFile(NOTEHANDLE1;FNATTACHMENTNUMBER2;MODE3);

RETTYPE2:="A";
TEXT3:="*";
READ_TEXT:=@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;TEXT3);
@LogReport(READ_TEXT);
OBJECTFILEHANDLE1:=@CloseAttachedFile(OBJECTFILEHANDLE1);

NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
DBHANDLE1:=@CloseDB(DBHANDLE1);

The DB with the OSPATH "TESTDB\\TESTDB1.NSF" is opened.
The document with NOTEID 8450 is opened.
The first file attachment of this document is opened.
Data is read from this file attachment up to the first "*" character, returned as TEXT, and output to the APILOG.
The file attachment is closed again.
The document is closed again.
The DB is closed again.

Example: @ReadOSFile(FILEHANDLE1;RETTYPE2;TEXTLIST3)

DBHANDLE1:=@OpenDB("TESTDB\\TESTDB1.NSF");
NOTEID:=8450;
NOTEHANDLE1:=@OpenNoteByID(DBHANDLE1;NOTEID;NOTEHANDLE1);

FNATTACHMENTNUMBER2:=1;
MODE3:="RB";
OBJECTFILEHANDLE1:=@OpenAttachedFile(NOTEHANDLE1;FNATTACHMENTNUMBER2;MODE3);

RETTYPE2:="A";
TEXTLIST3:="*":@Newline;
READ_TEXT:=@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;TEXTLIST3);
@LogReport(READ_TEXT);
OBJECTFILEHANDLE1:=@CloseAttachedFile(OBJECTFILEHANDLE1);

NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
DBHANDLE1:=@CloseDB(DBHANDLE1);

The DB with the OSPATH "TESTDB\\TESTDB1.NSF" is opened.
The document with NOTEID 8450 is opened.
The first file attachment of this document is opened.
Data is read from this file attachment up to the first "*" character or @Newline, returned as TEXT, and output to the APILOG.
The file attachment is closed again.
The document is closed again.
The DB is closed again.

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

DBHANDLE1:=@OpenDB("TESTDB\\TESTDB1.NSF");
NOTEID:=8450;
NOTEHANDLE1:=@OpenNoteByID(DBHANDLE1;NOTEID;NOTEHANDLE1);

FNATTACHMENTNUMBER2:=1;
MODE3:="RB";
OBJECTFILEHANDLE1:=@OpenAttachedFile(NOTEHANDLE1;FNATTACHMENTNUMBER2;MODE3);

RETTYPE2:="A";
LENGTH3:=10;
READ_TEXT:=@ReadAttachedFile(OBJECTFILEHANDLE1;RETTYPE2;LENGTH3;STATUS4);
@LogReport(READ_TEXT);
OBJECTFILEHANDLE1:=@CloseAttachedFile(OBJECTFILEHANDLE1);

NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
DBHANDLE1:=@CloseDB(DBHANDLE1);

The DB with the OSPATH "TESTDB\\TESTDB1.NSF" is opened.
The document with NOTEID 8450 is opened.
The first file attachment of this document is opened.
The first 10 bytes of this file attachment are read as TEXT and output to the APILOG.
The current read status is returned in STATUS4 returned
The file attachment is closed again.
The document is closed again.
The DB is closed again.

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