EasyManuals Logo

Texas Instruments TI-89 Developer's Guide

Texas Instruments TI-89
1398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #615 background imageLoading...
Page #615 background image
Appendix A: System Routines — Files
573
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
FSetPos
Declaration:
FSWORD
FSetPos
(FILES *
fsPtr
, FSWORD
pos
)
Category(ies):
Files
Description:
Set the position of the next read or write for an opened file, return the new
position (which may be less if the EOF is exceeded).
Inputs:
fsPtr
Pointer to FILES structure previously opened with
FOpen
.
pos
File position (0 being the first byte in the file) to set.
Outputs:
New file position.
Assumptions:
The FILES structure pointed to by
fsPtr
must have been previously opened
with
FOpen
.
Side Effects:
None
Availability:
On AMS 2.00 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: FOpen, FGetPos, FEof
Example:
FILES f1;
char buf[20];
static char FTYPE2 = "DAT";
if (FS_OK == FOpen( "f3", &f1, FM_WRITE, FTYPE2 )) {
FWrite( "abc", 3, &f1 );
FSetPos( &f1, 0 );
FPutC( 'A', &f1 );
FSetPos( &f1, 5 ); /* should go to EOF pos */
FPutC( 'D', &f1 );
FClose( &f1 );
if (FS_OK == FOpen("f3", &f1, FM_APPEND, FTYPE2)) {
FWrite( "eF", 2, &f1 );
FSetPos( &f1, 0 );
FRead( &buf, 6, &f1 );
if (memcmp(buf, "AbcDeF", 6))
Disp ("ERROR: file error");
FClose( &f1 );
}
}

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals