'檔名sourcedb.ini檔案
private declare function getprivateprofilestring lib "kernel32" alias
lpdefault as string, byval lpreturnedstring as string, byval nsize as long, byval
lpfilename as string) as long
private declare function writeprivateprofilestring lib "kernel32" alias
lpstring as any, byval lpfilename as string) as long
'以下兩個函式,讀/寫ini檔案,固定節點setting,in_key為寫入/讀取的主鍵
'僅僅針對是非值
'y:yes,n:no,e:error
public function getinitf(byval in_key as string) as boolean
on error goto getinitferr
getinitf = true
dim getstr as string
getstr = vba.string(128, 0)
getstr = vba.replace(getstr, vba.chr(0), "")
if getstr = "1" then
getinitf = true
getstr = ""
else
goto getinitferr
end if
exit function
getinitferr:
err.clear
getinitf = false
getstr = ""
end function
public function writeinitf(byval in_key as string, byval in_data as boolean) as boolean
on error goto writeinitferr
writeinitf = true
if in_data = true then
else
end if
exit function
writeinitferr:
err.clear
writeinitf = false
end function
'以下兩個函式,讀/寫ini檔案,不固定節點,in_key為寫入/讀取的主鍵
'針對字串值
'空值表示出錯
on error goto getinistrerr
if vba.trim(in_key) = "" then
goto getinistrerr
end if
dim getstr as string
getstr = vba.string(128, 0)
getstr = vba.replace(getstr, vba.chr(0), "")
if getstr = "" then
goto getinistrerr
else
getinistr = getstr
getstr = ""
end if
exit function
getinistrerr:
err.clear
getinistr = ""
getstr = ""
end function
on error goto writeinistrerr
writeinistr = true
goto writeinistrerr
else
end if
exit function
writeinistrerr:
err.clear
writeinistr = false
end function
讀寫INI檔案的四個函式
檔名sourcedb.ini檔案 private declare function getprivateprofilestring lib kernel32 alias lpdefault as string,byval lpreturnedstring as string,byval nsize ...
VC中用函式讀寫ini檔案的方法
ini檔案 即initialization file 這種型別的檔案中通常存放的是一個程式的初始化資訊。ini檔案由若干個節 section 組成,每個section由若干鍵 key 組成,每個key可以賦相應的值。讀寫ini檔案實際上就是讀寫某個的section中相應的key的值,而這隻要藉助幾個...
VC中用函式讀寫ini檔案的方法
ini檔案 即initialization file 這種型別的檔案中通常存放的是一個程式的初始化資訊。ini檔案由若干個節 section 組成,每個section由若干鍵 key 組成,每個key可以賦相應的值。讀寫ini檔案實際上就是讀寫某個的section中相應的key的值,而這隻要藉助幾個...
VC中用 函式 讀寫ini檔案的方法
vc中用函式讀寫ini檔案的方法 2007 05 31 15 23 ini檔案 即initialization file 這種型別的檔案中通常存放的是一個程式的初始化資訊。ini檔案由若干個節 section 組成,每個section由若干鍵 key 組成,每個key可以賦相應的值。讀寫ini檔案實...
hive排序函式四個by的總結
order by 全域性排序 一個reducer,執行一個job。total job 1,可以在執行日誌中看到 number of reucers 1.用在select語句的後面。sort by 分割槽內排序 每個reducer內部進行排序,對全域性結果集來說不是排序。隨機分割槽,防止資料傾斜。設定...