View unanswered posts | View active topics It is currently Mon Nov 24, 2014 8:35 pm






Reply to topic  [ 2 posts ] 
problem in file access 
Author Message
Rookie

Joined: Tue Jun 05, 2012 2:31 pm
Posts: 11
Post problem in file access
hello all;
i have problem with saving char on the file
please help me
and i don't know where the file saved
Code:
void write()
{
  TFileIOResult dIOResult ;
  Delete(FILENAME, dIOResult);

   TFileIOResult nIOResult ;
   TFileHandle LIGHTFILE ;
   int FileSize = index ;
   int i;

   OpenWrite ( LIGHTFILE , nIOResult , FILENAME , FileSize );

   for (i=0;i < index ;i ++)
   {
     WriteByte ( LIGHTFILE , nIOResult ,arr[i] );
   }

   Close ( LIGHTFILE , nIOResult );
}

that's the true way or not


Tue Jul 03, 2012 8:28 am
Profile
Expert

Joined: Tue Feb 28, 2012 3:10 pm
Posts: 195
Post Re: problem in file access
filesize = index? what is index?

Where/how is the variable FILENAME defined? I would also suggest you check the value of dIOResult after the OpenWrite to make sure it is 'no error'. From the robotc help file; "sFileName must be a valid NXT file name"

As far as I know, the NXT wants the filename to be something.DAT, and it will appear in the 'my files' menu on the NXT or in any remote file utility such as the 'robot->NXT brick->file management utility' in robotc.

_________________
Mike aka Spiked3
http://www.spiked3.com


Tue Jul 03, 2012 12:35 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.