VB3 - Reading & Writing Fron INI Files 
Author Message
 VB3 - Reading & Writing Fron INI Files

Can someone please direct me to a source to get the very
basics of reading from and writing to ini files?  I have
downloaded Ken Peterson's KPINI but without the basics it
doesn't do me much good.  I'd really appreciate a pointer or
two.

Thanks.



Tue, 20 Oct 1998 03:00:00 GMT  
 VB3 - Reading & Writing Fron INI Files

Quote:

>Can someone please direct me to a source to get the very
>basics of reading from and writing to ini files?  I have
>downloaded Ken Peterson's KPINI but without the basics it
>doesn't do me much good.  I'd really appreciate a pointer or
>two.
>Thanks.

Hi

Here is a function which will help u get information from an INI file.
Pass this function the INI file name, the section name and the item
and it will return the string from the INI file.  

The function is named sTOOLS_GetStringFromINI 'cause the function
returns a string (s) and is located in a common TOOLS.BAS file.

Function sTOOLS_GetStringFromINI (rsFileName As String, rsAppName As
String, rsKeyName As String) As String

    On Error GoTo LogonBAS_GetStringFromIniErr

    Dim sDefaults       As String
    Dim sReturnString   As String
    Dim nRetValue       As Integer
    Dim nSize           As Integer

    sTOOLS_GetStringFromINI = ""

    sReturnString = Space(128)
    nSize = Len(sReturnString)
    sDefaults = ""
    nRetValue = GetPrivateProfileString(rsAppName, rsKeyName,
sDefaults, sReturnString, nSize, rsFileName)
    sTOOLS_GetStringFromINI = Left(sReturnString, nRetValue)

End Function



Mon, 26 Oct 1998 03:00:00 GMT  
 VB3 - Reading & Writing Fron INI Files

Quote:

>Can someone please direct me to a source to get the very
>basics of reading from and writing to ini files?  I have
>downloaded Ken Peterson's KPINI but without the basics it
>doesn't do me much good.  I'd really appreciate a pointer or
>two.
>Thanks.

Hi

Here is a function which will help u get information from an INI file.
Pass this function the INI file name, the section name and the item
and it will return the string from the INI file.  

The function is named sTOOLS_GetStringFromINI 'cause the function
returns a string (s) and is located in a common TOOLS.BAS file.

Function sTOOLS_GetStringFromINI (rsFileName As String, rsAppName As
String, rsKeyName As String) As String

    On Error GoTo LogonBAS_GetStringFromIniErr

    Dim sDefaults       As String
    Dim sReturnString   As String
    Dim nRetValue       As Integer
    Dim nSize           As Integer

    sTOOLS_GetStringFromINI = ""

    sReturnString = Space(128)
    nSize = Len(sReturnString)
    sDefaults = ""
    nRetValue = GetPrivateProfileString(rsAppName, rsKeyName,
sDefaults, sReturnString, nSize, rsFileName)
    sTOOLS_GetStringFromINI = Left(sReturnString, nRetValue)

End Function



Mon, 26 Oct 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Learning to Read&Write to ini files

2. reading & writing to INI files

3. ! read only ini file (vb3)

4. Reading strings from an INI file, with VB3

5. Read/Write INI Files w/Access 7.0

6. Ini-file, read write and empty lines.

7. Reading and writing from and to ini files

8. read/write an .ini file

9. Reading and writing to an INI file?

10. Reading and Writing to .ini files - help please.

11. Read and Write to INI files

12. Reading/writing to an INI file

 

 
Powered by phpBB® Forum Software