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"
my code is 39k.
so i made a sample code with these functionalities
which is only 11k.
still the same old errors.
my modified code is as below:

 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;
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+=count;
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/

Reply via email to