This is weird?
Ok the problem is that even if the ini file does not exist lReturnCheck returns a value of 21 or 22 and sReturnValue has the ini File Name and 10 or so return characters.Code:sSectionName = "Hello Newman" sValueName = "Episode" sIniDefault = "c:\wherever\seinfield.ini" sIniFile = sIniDefault Dim lReturnCheck As Long Dim sReturnValue as String * 50 ' lReturnCheck = GetPrivateProfileString(sSectionName,sValueName,sIniDefault,sReturbValue,Len(sReturnValue),sIniFile) ' If lReturnCheck = 0 Then GetIniValue = "" Else GetIniValue = Trim(sReturnValue) End If
How come lReturnCheck isn't returning 0?




Reply With Quote