📄 writeini.prg
字号:
******************
*Function WriteINI
******************
*!* This function reads an application INI file. Each of the strings below must end in a Null
*!* character - CHR(0). It is also important to use the @ to ensure that lcReturned is passed by reference.
*!* lcFile - Name of the INI file
*!* lcSection - Section in the INI file
*!* lcKey - Key in the INI file
*!* lcString - Value to be assigned to the key
***=writeini(CURDIR() +"txgl.ini", "user", "user1", "崔万军")
LPARAMETER lcFile, lcSection, lcKey, lcString
LOCAL lnResult
IF TYPE("lcFile") # "C" OR TYPE("lcSection") # "C" OR TYPE("lcKey") # "C" OR TYPE("lcString") # "C"
RETURN .F.
ENDIF
Declare Integer WritePrivateProfileString IN WIN32API String, String, String, String
lcSection = lcSection + IIF(RIGHT(lcSection,1) = CHR(0),"",CHR(0))
lcKey = lcKey + IIF(RIGHT(lcKey,1) = CHR(0),"",CHR(0))
lcString = lcString + IIF(RIGHT(lcString,1) = CHR(0),"",CHR(0))
lcFile = lcFile + IIF(RIGHT(lcFile,1) = CHR(0),"",CHR(0))
lnResult = WritePrivateProfileString(lcSection,lcKey,lcString,lcFile)
CLEAR DLLS WritePrivateProfileString
RETURN IIF(lnResult=1,.T.,.F.)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -