|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function strGPA(strKeyName As String, strDefaultValue As String)
' Procedure : strGPA
' Description: This code returns a parameter from an INI file.
' Copyright: Chris Greaves Inc.
' Inputs: A key name, a default value (may be null)
' Returns: STRING.
' Assumes: The file and section names are given by the string constant strcApplication.
' Side Effects: None.
' Tested: By the calls shown below.
' Transient variable used by the internal function.
Dim strReturnedString As String
Dim nSize As Long
' Build a suitable file name based on the applications 5-character identifier.
Dim strFileName As String
strFileName = strGetEnvironmentFileName(strcApplication)
Call GetLargePrivateProfileString(strcApplication, strKeyName, strDefaultValue, strReturnedString, nSize, strFileName) ' file does not exist
' If no data returned and we WERE given a default value, store that value and return it
If strReturnedString = "" Then
Call strPPA(strKeyName, strDefaultValue)
strGPA = strDefaultValue
Else
strGPA = strReturnedString
End If
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |