Hello,
I am trying to save scanned data to a temporay file and I am having a problem.
The application is for the Symbol SPT 1500 rom version 3.0. At the begining
of the application, I have to check to see if this temp file exist. If it
does, I need to get a count on the number of records to display value on a
form. My problem is that after I do FileRead () through the file to get the
record number and afterward I try to write to it using FileWrite(), I get
this error "DataMgr.c line:4414, Err getting rec." If I don't do the
FileRead(), it writes fine.
I get the error message when i open the file in "fileModeUpdate" mode.
Does anyone have any idea what's wrong here.
my code is as follow:
#define RECORDSIZE 24;
Word bufferFileExist()
{
Err err=0;
char Temp[30];
bufferHandle = FileOpen(0,tmpBufferFile,'ABcd',appCreatorType,
fileModeAppend, &err);
ErrNonFatalDisplayIf(err, "Can't open buffer file");
if(bufferHandle)
{
do
{
FileRead(bufferHandle, Temp, RECORDSIZE, 1, &err);
if(FileEOF(bufferHandle)) continue;
gCounter++;
}while( !FileEOF(bufferHandle));
FileClearerr(bufferHandle);
}
return 1;
}
void putSkuInBufferFile(Char * aString)
{
Err err = 0;
char smTemp[30];
StrCopy(smTemp,"000"); StrCat(smTemp,","); StrCat(smTemp,aString);
StrCat(smTemp,","); //store and sku
StrCat(smTemp,"0001"); //quantity
StrCat(smTemp,",");
StrCat(smTemp,aTranRec.locationID); StrCat(smTemp,"|");
//aTranRec.locationID is 3 char s in length.
FileWrite(bufferHandle, smTemp, RECORDSIZE, 1, &err);
gCounter++; //continue;Counter++;
}
thanks,
Dan D.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html