Windows Issues

From: Patrick Dughi (dughi@imaxx.net)
Date: 01/03/01


        This is about the offline editor I'm still klunking away at, so if
you're not intereted, you can skip the message.

        I'm attempting to make an old-style .ini file for my program, with
one small diversion from normal; I don't want to depend on knowing what's
in the file.  Instead, I want to be assured that a given set of standard
entries exist, and then, load up all other entries as is convienent.

Example:

Affects = {"Blind=>1","Fly=>2","Sneak=>4"...} etc.

  My constant gathering class allocates a space for a new list which can
be accessed via 'affects':
        string_to_number_list = constant_class.find("Affects")

  However, I want to make it so it automatically loads in any list, not
just the ones I know about.. so if I make one about races:

Races = {"human=>1","bear=>2","troll=>3","whiny democrat=4"...} it will
grab that one up too.

        So, what I need is a set of functions which read a standard
windows ini-type file, and return a) all the section names, and b) all the
key name/values for a given seciton.  This is no problem, these are
purported to exist.

        The question I wanted to ask was if anyone had ever gotten the
GetPrivateProfileSectionNames() or GetPrivateProfileSection() functions to
operate properly. So far, the only (two) commands I can get to work are
WritePrivateProfileString and ReadPrivateProfileString.  Both of which are
great, but require foreknowledge of the section and key name.

        Unfortunately documentation and examples on these functions are so
far out of date to be literally unusable (not only do the references
contradict themselves, the examples don't compile, and in many cases don't
even use the correct # arguments).  Not that it's difficult to generate
versions of the functions I can use, just that it's annoying :)

        And no, i don't want to save it in the registery, because I want
to make it easy to package/send a custom ini file for a given mud.

                                                        PjD

p.s. This doesn't mean i've given up on XML, or anything, just that I need
to learn more about it before I even begin.  I'm pragmatic - i'll
concentrate for now on what works.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/03/01 PST