Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Visual Dbase > Re: dBase - Win...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 53 of 132
Post > Topic >>

Re: dBase - Windows API

by "Michael Nuwer" <michael@[EMAIL PROTECTED] > Jun 12, 2004 at 05:52 PM

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!
 




 2 Posts in Topic:
dBase - Windows API
samuraikm <samuraikm@[  2004-06-11 22:57:05 
Re: dBase - Windows API
"Michael Nuwer"  2004-06-12 17:52:12 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 10:16:28 CST 2008.