Here's another use of the INI file routines. (I realize now that i should be saying "environment interface" rather than INI, because you don't HAVE to be using INI files to make use of these functions; INI files are just my vehicle of choice. You could as easily be using the registry or a home-grown system, based for exemple on an Access database table).

I frequently have a need for a definition of White Space characters. In Word's Edit,Find dialogue you can use "^w" as a template for white space.

It's difficult to find a definition of White Space in the SR2 Help files.

MSKnowledgeBase says WhiteSpace is "space, non-breaking space, tab" space &rnk=7&src=DHCS_MSPSS_gn_SRCH&SPR=WRD97. To me that suggests ASCII(032), ASCII(160) and ASCII(009), but I wanted more flexibility.

At first I defined a global string variable and loaded it with a few characters, WhiteSpace as defined above plus hard and soft-line breaks ASCII(013) and ASCII(010), and the Table cell character ASCII(007), but then I ran into hassles where one application needed that definition, and another needed a shorter definition.

Then I essayed with a STATIC variable; I figured I could read the definition from an INI file and not have to read it again during the run-time of the application.

Theory is that anywhere in an application I can use "strGetWhiteSpace" and know that I'll get back a suitable string of characters, suitable for THAT application.

I hope I've got it right ....

<pre>Public Function strGetWhiteSpace() As String
' Procedure : strGetWhiteSpace
' Description: Return the application's definition of White Space characters.
' Copyright: Chris Greaves Inc.
' Inputs: None
' Returns: A string of white space characters
' Assumes: None.
' Side Effects: None.
' Tested: By the calls shown below.

' Using a STATIC should reduce the calls to the strGP (disk) function.
Static strStatWhiteSpace As String

If Len(strStatWhiteSpace) = 0 Then ' Presumably not been called before, so
Dim intI As Integer ' loop counter.
Dim strChar As String ' transient used to hold incoming characters.
For intI = 1 To 20 ' Maximum 20 definitions allowed.
strChar = strGp(strcApplication, strcApplication,_
"WhiteSpace" & Format(intI, "00"), "")
If strChar <> "" Then ' This definition still holds
strStatWhiteSpace = strStatWhiteSpace & Chr(Val(strChar))
Else ' this definition has been removed.
End If
Next intI
If strStatWhiteSpace = "" Then ' Build a default
strStatWhiteSpace = strStatWhiteSpace & strGetWhiteSpace & Chr(7) ' Table cell
strStatWhiteSpace = strStatWhiteSpace & strGetWhiteSpace & Chr(9) ' TAB
strStatWhiteSpace = strStatWhiteSpace & strGetWhiteSpace & Chr(10) ' Soft line break
strStatWhiteSpace = strStatWhiteSpace & strGetWhiteSpace & Chr(13) ' Hard line break
strStatWhiteSpace = strStatWhiteSpace & strGetWhiteSpace & Chr(32) ' Soft space
strStatWhiteSpace = strStatWhiteSpace & strGetWhiteSpace & Chr(160) ' Hard space
' Write the default to the INI file.
Call strPP(strcApplication, strcApplication, "WhiteSpace01", 7)
Call strPP(strcApplication, strcApplication, "WhiteSpace02", 9)
Call strPP(strcApplication, strcApplication, "WhiteSpace03", 10)
Call strPP(strcApplication, strcApplication, "WhiteSpace04", 13)
Call strPP(strcApplication, strcApplication, "WhiteSpace05", 32)
Call strPP(strcApplication, strcApplication, "WhiteSpace06", 160)
End If
End If
strGetWhiteSpace = strStatWhiteSpace
'Sub TESTstrGetWhiteSpace()
'MsgBox Len(strGetWhiteSpace)
'End Sub
End Function