EasyManuals Logo
Home>Casio>Calculator>ClassPad 300

Casio ClassPad 300 Programming Guide

Casio ClassPad 300
125 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 #120 background imageLoading...
Page #120 background image
If we look closely at the Contact class, we see it is just composed of CPStrings that hold
all the information for a contact. Therefore, the Contact class’s Read() function will just
be each one of these CPStrings calling its Read() function:
// Reads a contact from a file.
// Each CPString just calls its read function
void Contact::Read(CPReadFile& f)
{
firstName.Read(f);
lastName.Read(f);
phone1.Read(f);
phone2.Read(f);
email.Read(f);
address.Read(f);
}
As you can see, the Read() functions that you create will usually just call that class’s data
members’ Read() functions.
Writing to MCS
To write to MCS, you must create an instance of the CPWriteMCSFile class. The
following constructors are available:
CPWriteMCSFile (UCHAR type)
CPWriteMCSFile (const char *name, const char *path=NULL, UCHAR type=0)
If you use the first constructor, you must set the name and path of the file before trying to
write.
When you create a MCSWriteFile you do not provide a file size in the constructor. Upon
creation no memory will be allocated and any write functions you call will not actually
write to memory. The write functions will, however, compute the size of the object
written. The function Realize() can then be used to allocate the memory for the file. A
second call to the write functions will then write the file to memory. This method allows
you to write a file without determining how much space the file will require in memory
prior to creation.
CPWriteMCSFile does not have any functions that write to memory. Like
CPReadMCSFile, it inherits a few write functions from its base class CPWriteFile:
int WriteBytes(void *buffer, int nBytes);
virtual void WriteByte(char c);
void WriteWord(WORD w);
void WriteInt(int ii);
void WriteDouble(OBCD xx);
Here is a simple example of creating a CPMCSWriteFile and writing an int:
CPWriteMCSFile f(FILE_NAME, FOLDER_NAME);
f.WriteInt(8);
120

Table of Contents

Other manuals for Casio ClassPad 300

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Casio ClassPad 300 and is the answer not in the manual?

Casio ClassPad 300 Specifications

General IconGeneral
BrandCasio
ModelClassPad 300
CategoryCalculator
LanguageEnglish

Related product manuals