Damn right. :) It's awesome
We're still having some minor problems with it. GetPrivateProfileString is supposed to return a null-delimited string containing either section names or key names, if either of those paramaters is null. Well, I'm having a hard time getting the code to recognize when the user wants to specify a null value.
Here's the syntax of our command:
$int(<filename>,<section>,<key>)
And here's the section of our MacroParser entry that checks to see if the second or third argument is null:
Code: Select all
if (szArg3=="null") {
DebugSpew("INI -- Arg3 was null.");
num=GetPrivateProfileString(szArg2,NULL,"NOTFOUND",szTemp,MAX_STRING,szArg1);
} else if (szArg2=="null") {
DebugSpew("INI -- Arg2 was null.");
num=GetPrivateProfileString(NULL,NULL,"NOTFOUND",szTemp,MAX_STRING,szArg1);
} else {
num=GetPrivateProfileString(szArg2,szArg3,"NOTFOUND",szTemp,MAX_STRING,szArg1);
}
So, in theory, when I supply:
$int("thefile.ini","thesection","null")
I should see in the debugspew file: "INI -- Arg3 was null."
And I should get a return value of all the key names in "thefile.ini".
But I don't. And it returns 'NOTFOUND' -- which is what I specify as the default return when a section or key isn't in the INI file.
So... ???
If we can't get this working, then we won't be able to do things like messing with the Bazaar INI file, because we need to be able to return the list of keys. Oh -- that's another thing: how would the szOutput string deal with null characters? Will I need to replace the null delimiter with something else; a pipe character maybe?
I'd appreciate any help anyone can supply with this. Would LOVE to get this set up to manipulate the Bazaar file.