Re: XAP objects and counting

From: Peter Ajamian (pajamian@cheapsam.com)
Date: 01/14/00


Nick Watson wrote:
>
> I'm making to so that builders may specify a certain number of objects
> that
> may exist in the whole game, not just for the current objects loading.
> I'm
> using the ASCII XAP object files, I need to beable to open these, count
> the
> objects, and close them on boot up, I hda this done for the binary obj
> files, but can't figure it out for ASCII.  Any help?

You open an ascii file the same way you open a binary one, except you
use "r" instead of "rb", then use fgets to read in one line at time and
parse it, I would recommend a loop that reads in the line then
determines if that line has usefull info on it, if so, it would parse
out the data from the line then continue to the next line.  You close
the file in the exact same way as a binary file with fclose().

Regards, Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT