home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. CD ROM (Annual Premium Edition)
/
premium.zip
/
premium
/
WINUTIL2
/
WB_41E.ZIP
/
INIEDIT.WB_
< prev
next >
Wrap
Text File
|
1992-04-28
|
3KB
|
97 lines
CR=strcat(Num2char(13),Num2char(10))
TAB=Num2Char(9)
DirChange(DirWindows(0))
canned="BYEBYE"
IniFiles=""
bSys386=0
:UP1
canned="byebye"
If IniFiles!="" then goto inied
IniFiles=FileItemize("*.INI")
:inied
TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
if TheFile=="" then goto newini
Sections=""
:UP2
canned="up1"
if Sections!="" then goto sected
Sections=IniItemizePvt("",TheFile)
:SECTED
Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
if Section=="" then goto AddSect
if stricmp(Section,"386Enh")==0 then bSys386=1
else bSys386=0
KeyValues=""
:UP3
canned="up2"
if KeyValues!="" then goto looped
Keys=IniItemizePvt(Section,TheFile)
if (bSys386) then Keys=StrReplace(Keys,"device%TAB%","")
then Keys=StrReplace(Keys,"Device%TAB%","")
then Keys=StrReplace(Keys,"DEVICE%TAB%","")
then Keys=StrReplace(Keys,"device","")
then Keys=StrReplace(Keys,"Device","")
then Keys=StrReplace(Keys,"DEVICE","")
KeyMax=ItemCount(Keys,TAB)
KeyIndex=0
:Loop
if KeyIndex==KeyMax then goto looped
KeyIndex=KeyIndex+1
ThisKey=ItemExtract(KeyIndex,Keys,TAB)
ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
goto Loop
:looped
Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
if Key=="" then goto AddKey
Key=ItemExtract(1,Key,"=")
Value=IniReadPvt(Section,Key,"???",TheFile)
goto entkey
:newini
canned="UP1"
TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
if (TheFile=="*.INI" || TheFile=="") then goto newini
IniFIles=""
goto AddSectNewIni
:AddSect
canned="up2"
:AddSectNewIni
Section=AskLine("Add New Section to INI File","Enter new section name for%CR% %TheFile%%CR% [?????]","")
Sections=""
goto AddKeyNewSect
:AddKey
canned="up3"
:AddKeyNewSect
Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR% %TheFile%%CR% [%Section%]","")
if (bSys386 && stricmp(Key,"device"==0)) then Message("Error","Cannot modify or add DEVICE= lines to [386Enh]%CR%with this WBT File")
then goto AddKeyNewSect
Value="(Undefined)"
KeyValues=""
goto EntKeyNewKey
:ENTKEY
canned="up3"
:EntKeyNewkey
NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR% [%Section%]%CR% %Key% = %Value%",Value)
if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
KeyValues=""
goto up3
:CANCEL
goto %Canned%
:BYEBYE
exit