Function EN Version 4.60

@SetPosAttachedFile

Attachments Database Export Import Note

Syntax

@SetPosAttachedFile(OBJECTFILEHANDLE1;POSITION2;MODE3);

Description

Sets the position in the file attachment identified by OBJECTFILEHANDLE OBJECTFILEHANDLE1 to the values specified in FN POSITION2 specified position (in bytes), taking into account mode TEXT MODE3.
The new position is returned.

MODE3:
S=Calculated from the start of the OSFILE
C=Current position + POSITION2
E=End position – POSITION2

Example: @SetPosAttachedFile(OBJECTFILEHANDLE1;POSITION2;MODE3)

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

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

MODE3:="S";
POSITION2:=10;
RetPos:=@SetPosAttachedFile(OBJECTFILEHANDLE1;POSITION2;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 OSPATH "TESTDB\\TESTDB1.NSF" is opened.
The document with NOTEID 8450 is opened.
The first file attachment of this document is opened.
The file attachment position is set to the byte following the 10th byte.
The next 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.
Sets the position to 10 bytes after the beginning ("S") of the file "C:\\TEST.TXT" and reads 10 bytes.

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