
October 14th, 2003, 02:24 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
End of Statement Error when trying to read an ini file
I'm trying to use a standard GetPrivateProfileString function declaration to read an ini file, but whenever I compile it throws back an End of Statement error and points to line 1 char 16, which is the beginning of the word Function. Here's an example script I setup to test as an example. If anyone could tell me what's going on it would be much appreciated. Thanks.
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Public Function ReadINI(strsection As String, strkey As String, strfullpath As String) As String
Dim strbuffer As String
Let strbuffer$ = String$(750, Chr$(0&))
Let readini$ = Left$(strbuffer$, GetPrivateProfileString(strsection$, ByVal LCase$(strkey$), "", strbuffer, Len(strbuffer), strfullpath$))
End Function
Dim ScriptDirectory, iniSetting
ScriptDirectory = fso.GetAbsolutePathName(".")
MsgBox ScriptDirectory
iniSetting = ReadINI(SlideInfoSetup, outputPath, ScriptDirectory & "\fileLocations_PC.ini")
MsgBox iniSetting
|