Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating variable in ini file

101 views
Skip to first unread message

Leif Holm

unread,
Mar 20, 1999, 3:00:00 AM3/20/99
to
Ho is it possible to create a variable in an ini file or the config.fpw
file, and afterwards use this variable anywhere in my program.

There must be a command for this function, but I just dont' know the
it??????


Greetings

Leif Holm
Denmark
Email: leif...@get2net.dk


Tom Piper

unread,
Mar 20, 1999, 3:00:00 AM3/20/99
to
Hi Leif,

Leif Holm wrote in message <5SNI2.117$Ez6...@news.get2net.dk>...


>Ho is it possible to create a variable in an ini file or the config.fpw
>file, and afterwards use this variable anywhere in my program.
>
>There must be a command for this function, but I just dont' know the
>it??????


VFP ships with a prg called Registry.prg, which has Methods to Read and
Write to an INI file. Once you read a value from the file. You can store it
to a Property or memvar.

Best regards,
Tom


Rick Bean

unread,
Mar 20, 1999, 3:00:00 AM3/20/99
to
Tom,
Just to be clear, the registry program will read and write to the REGISTRY -
the preferred place to put 32-bit application configuration data. If he
really want to write to his own .INI file or the CONFIG.FPW file (considered
the "right" way to do things in 16-bit Win3.x apps), then he needs to
DECLARE and use the WinAPI procedures GetPrivateProfileString() and
WritePrivateProfileString().

Rick

Tom Piper wrote in message ...

Tom Piper

unread,
Mar 20, 1999, 3:00:00 AM3/20/99
to
Hi Rick,

Just to be clear: As I said, Registry.prg also contains classes which read
and write INI files. IMHO, there are several good reasons to continue to use
INI files, even in VFP5 and VFP6.

Best regards,
Tom

Rick Bean wrote in message ...

Rick Bean

unread,
Mar 22, 1999, 3:00:00 AM3/22/99
to
Hi Tom,
You are correct, I totally missed these classes in the REGISTRY.PRG.
[Although to be fair THEY DECLARE and use the WinAPI procedures
GetPrivateProfileString() and WritePrivateProfileString() - among others.]
I also agree that there are cases where .INI files still have a place, I was
just stating the "official" line about only using the registry to save off
configuration data.
0 new messages