home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Mother of All Windows Books
/
CD-MOM.iso
/
cd_mom
/
newsletr
/
vbz
/
vbz1-3
/
ini.bas
< prev
next >
Wrap
BASIC Source File
|
1993-06-24
|
1KB
|
29 lines
DefInt A-Z
Declare Sub WritePrivateProfileString Lib "Kernel" (ByVal Section$, ByVal Entry$, ByVal Default$, ByVal IniFile$)
Declare Function GetPrivateProfileString Lib "Kernel" (ByVal Section$, Entry As Any, Default As Any, ByVal Buff$, ByVal BuffLen, ByVal IniFile$)
Function GetIniLong& (IniFile$, Section$, Entry$, Default&)
GetIniLong& = Val(GetIniString$(IniFile$, Section$, Entry$, Format$(Default&)))
End Function
Function GetIniString$ (IniFile$, Section$, Entry$, Default$)
Buff$ = Space$(255)
nChars = GetPrivateProfileString(Section$, ByVal Entry$, ByVal Default$, Buff$, 255, IniFile$)
If nChars > 0 Then
GetIniString$ = Left$(Buff$, nChars)
Else
GetIniString$ = ""
End If
End Function
Sub SetIniLong (IniFile$, Section$, Entry$, Default&)
SetIniString IniFile$, Section$, Entry$, Format$(Default&)
End Sub
Sub SetIniString (IniFile$, Section$, Entry$, Default$)
WritePrivateProfileString Section$, Entry$, Default$, IniFile$
End Sub