Mar 23, 2006 #1 Takusaan Programmer Sep 20, 2000 29 US I have created a scanning Application in VFP 6.0. And I want my scanner to use the ini file that I specified.
I have created a scanning Application in VFP 6.0. And I want my scanner to use the ini file that I specified.
Mar 23, 2006 #2 bborissov Programmer May 3, 2005 5,167 BG Here two function that I used for this: FUNCTION ReadIniString(cSection, cEntry, cIniFile) LOCAL ret_val DECLARE INTEGER GetPrivateProfileString IN Win32API AS GetPrivStr ; String cSection, String cKey, String cDefault, String @cBuffer, ; Integer nBufferSize, String cINIFile m.ret_val = SPACE(1024) GetPrivStr(m.cSection, m.cEntry,"",@ret_val,1024,m.cIniFile) CLEAR DLLS GetPrivateProfileString RETURN STRTRAN(ALLTRIM(ret_val), CHR(0), "") FUNCTION WriteIniString(cSection, cEntry, cString, cIniFile) DECLARE INTEGER WritePrivateProfileString IN Win32API AS WritePrivStr ; String cSection, String cKey, String cValue, String cINIFile WritePrivStr(m.cSection,m.cEntry,m.cString,m.cIniFile) CLEAR DLLS WritePrivateProfileString RETURN "" *** Usage: WriteIniString([Main],[TestEntry],[AbraKadabra],[MyIniFile.Ini]) ? ReadIniString([Main], [TestEntry], [MyIniFile.Ini]) [/code] Borislav Borissov Upvote 0 Downvote
Here two function that I used for this: FUNCTION ReadIniString(cSection, cEntry, cIniFile) LOCAL ret_val DECLARE INTEGER GetPrivateProfileString IN Win32API AS GetPrivStr ; String cSection, String cKey, String cDefault, String @cBuffer, ; Integer nBufferSize, String cINIFile m.ret_val = SPACE(1024) GetPrivStr(m.cSection, m.cEntry,"",@ret_val,1024,m.cIniFile) CLEAR DLLS GetPrivateProfileString RETURN STRTRAN(ALLTRIM(ret_val), CHR(0), "") FUNCTION WriteIniString(cSection, cEntry, cString, cIniFile) DECLARE INTEGER WritePrivateProfileString IN Win32API AS WritePrivStr ; String cSection, String cKey, String cValue, String cINIFile WritePrivStr(m.cSection,m.cEntry,m.cString,m.cIniFile) CLEAR DLLS WritePrivateProfileString RETURN "" *** Usage: WriteIniString([Main],[TestEntry],[AbraKadabra],[MyIniFile.Ini]) ? ReadIniString([Main], [TestEntry], [MyIniFile.Ini]) [/code] Borislav Borissov
Mar 23, 2006 Thread starter #3 Takusaan Programmer Sep 20, 2000 29 US Thanks again Borislav!!! Upvote 0 Downvote