hi ,
i tried aking changes you suggested. but it gives the
same old errors .
i.e."bus error" and "address error".sometime it gives
errors like"the application just wrote to an
unallocated chunk of memory"
i tried allocating memory to the buffer by making it
an array.but then it becomes a fixed array.if i do
buffer++ , it gives a compilation error "wrong type
argument to increment".when i comment out buffer++,run
the program and save something, it works fine.but when
i click on show button, the emulator hangs.funnily, on
one instance it compiled despite the uncommented
buffer++.
CODE:
case savebutton:
{
Err err;
Char *textp;
FieldType *fldp;
UInt16 objindex,len;
FileHand streamsave;
FormType *frmp;
frmp=FrmGetFormPtr(1000);
objindex=FrmGetObjectIndex(frmp,1004);
fldp=FrmGetObjectPtr(frmp,objindex);
textp=FldGetTextPtr(fldp);
len=FldGetTextLength(fldp);
streamsave=FileOpen(0,filename,filetype,filecreator,fileModeAppend,&err);
ErrAlert(err);
FileWrite(streamsave,textp,(StrLen(textp)+1),1,NULL);
FileClose(streamsave);
handled=true;
break;
}
case showbutton1:
{
char buffer[2];
FileHand streamshow;
FieldType *fldp;
UInt16 objindex;
FormType *frmp;
Int32 count;
frmp=FrmGetFormPtr(1000);
objindex=FrmGetObjectIndex(frmp,1004);
fldp=FrmGetObjectPtr(frmp,objindex);
streamshow=FileOpen(0,filename,filetype,filecreator,fileModeReadOnly,NULL);
while(! FileEOF(streamshow))
{
count=FileRead(streamshow,buffer,sizeof(Char),1,NULL);
//buffer++;
FldInsert(fldp,buffer,sizeof(buffer));
FileClose(streamshow);
handled=true;
break;
}
}
pls reply.
bye,
siddharth
________________________________________________________________________
For live cricket scores download Yahoo! Score Tracker
at: http://in.sports.yahoo.com/cricket/tracker.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/