if type("GetPrivateProfileString") <> "FP"
extern CLONG GetPrivateProfileString( CSTRING,;
CSTRING,;
CSTRING,;
CSTRING,;
CLONG,;
CSTRING ) ;
kernel32 from "GetPrivateProfileStringA"
endif
PROCEDURE GetValue
parameter cSection, cEntry
local cBuffer, cDefault, cIniFile
store space(INI_RETSIZE) to cBuffer, this.Value
if type("cSection") == "C" and type("cEntry") == "C"
this.Section = cSection
this.Entry = cEntry
cDefault = this.Default
cIniFile = this.IniFile
GetPrivateprofileString(cSection, cEntry, cDefault,;
cBuffer, INI_RETSIZE, cIniFile)
this.Value = trim(cBuffer)
endif
RETURN trim(this.Value)
You should have a look at INI.cc in the dUFLP it has all the code you need
to work with ini files
http://www.goldenstag.net/dbase/#dUFLP
Or get it at the author's site:
http://home.satx.rr.com/moursund/Datatech/ini7.zip
Also, you will get better help if you ask questions at this url:
news://dbaseTalk.com/dbase.programming
"samuraikm" <samuraikm@[EMAIL PROTECTED]
> wrote in message
news:Xns9505AC7267C76samuraikm@[EMAIL PROTECTED]
> Please help me with the following. Directly below are the old dBase 5.x
> program lines, how do I convert these to utilize the Windows API
> instead?
>
>
> if type("GetPrivateProfileString") <> "FP"
> extern CINT GetPrivateProfileString( CSTRING,;
> CSTRING,;
> CSTRING,;
> CPTR,;
> CINT,;
> CSTRING ) KRNL386.EXE
> endif
>
> * And then the below procedure
>
> PROCEDURE GetValue
> parameter cSection, cEntry
> this.value = space(INI_RETSIZE)
> if type("cSection") == "C" .and. type("cEntry") == "C"
> this.Section = cSection
> this.Entry = cEntry
> GetPrivateprofileString(this.Section, this.Entry, this.Default,;
> this.Value, INI_RETSIZE, this.IniFile)
> this.Value = trim(this.Value)
> if right(this.Value,1) = chr(0)
> this.Value = ltrim(left(" " + this.value, len(this.value)))
> endif
> endif
> RETURN trim(this.Value)
>
>
>
> Thanks in advance!


|