Contents of the INI_IO.TXT file
October 11th, 1992
Raymond W. Six
VB/DOS equivelants to "GetPrivateProfileString" ,"GetPrivateProfileInt"
Windows INI files are very popular for storing program configuration
information and other data. This type of file format probably gets
some of its popularity from the fact that these files can be easily
edited with any ASCII text editor (including both the Windows Notepad
and the DOS 5.0 editor). The fact that Windows provides APIs to
handle all the related I/O makes using INI files extremely easy
under Visual Basic for Windows.
But, now with the arrival of Visual Basic for DOS; how can VB/DOS
programmers use this type of file format. Since Windows API calls
will not be available under VB/DOS - programmers must either 'roll
their own' functions for accessing INI format files, or go back to
using their own proprietary file formats.
I'm just starting to get hooked on using INI files in Visual Basic,
but have recently purchased VB/DOS. I wished to continue use INI
style files, and a result I have 'rolled my own' functions that
are equivelant to the two INI-related Windows API calls that I use
most. These being: "GetPrivateProfileString", "GetPrivateProfile-
Int" and "WritePrivateProfileString".
I have decided to make these functions available to anyone else
who has need for them. No royalties, no special copyright notice
The accompanying code is hereby dumped into the "Public Domain".
Use and abuse as you please. No warranties expressed or implied
intended. No deposit, No return. Read my lips - "No new taxes".
A bird in hand is safer than one overhead. etc.
- Raymond W. Six
Released on CompuServe MSBASIC forum
on October 11th, 1992
P.S. The code attached includes a corrected versions of the
"GetPrivateProfileString" and "GetPrivateProfileInt", and
add the "WritePrivateProfileString" function.