home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Mother of All Windows Books
/
CD-MOM.iso
/
cd_mom
/
utility
/
progman
/
commandp
/
cmdpost1.cp_
< prev
next >
Wrap
Text File
|
1992-11-01
|
24KB
|
621 lines
; CmdPost menu initialization code
; Initialize a few variables here.
cr=strcat(num2char(13),num2char(10))
crlf=cr
tab=num2char(9)
IniFile="WWW-PROD.INI"
IniSection="CmdPost"
AppName="Command Post"
Sounds(0) ;Turn sounds off awhile
a=Version()
HomeBase=DirHome()
Editor=inireadpvt(IniSection,"Editor","Notepad.exe",IniFile)
CopyMoveDefault=""
if (NetGetCaps(2)==0) then MenuChange("FileNetwork",@DISABLE)
; Setting up the View menu item here.
a=inireadpvt(IniSection,"ViewSetup","NO",IniFile)
if a=="NO" then goto DEFSETUP
ViewShortLong=inireadpvt(IniSection,"ViewShortLong","SHORT",IniFile)
if ViewShortLong=="SHORT" then MenuChange("ViewShort",@CHECK)
if ViewShortLong=="LONG" then MenuChange("ViewLong",@CHECK)
ViewBy=inireadpvt(IniSection,"ViewBy","NAME",IniFile)
if ViewBy=="NAME" then MenuChange("ViewByName",@CHECK)
if ViewBy=="DATE" then MenuChange("ViewByDate",@CHECK)
if ViewBy=="SIZE" then MenuChange("ViewBySize",@CHECK)
if ViewBy=="KIND" then MenuChange("ViewByKind",@CHECK)
if ViewBy=="UNSORTED" then MenuChange("ViewUnsorted",@CHECK)
ViewWhat=inireadpvt(IniSection,"ViewWhat","ALL",IniFile)
if ViewWhat=="ALL" then MenuChange("ViewAll",@CHECK)
if ViewWhat=="PARTIAL" then MenuChange("ViewPartial",@CHECK)
if ViewWhat=="PROGRAMS" then MenuChange("ViewPrograms",@CHECK)
SD3="*.*"
if ViewWhat=="PROGRAMS" then SD3="*.EXE *.COM *.BAT *.PIF"
if ViewWhat=="PARTIAL" then SD3=inireadpvt(IniSection,"Partial","*.*",IniFile)
SetDisplay(ViewShortLong,ViewBy,SD3)
drop(ViewShortLong,ViewBy,ViewWhat,SD3)
goto PRINTSETUP
:DEFSETUP
SetDisplay("SHORT","NAME","*.*")
MenuChange("ViewAll",@CHECK)
MenuChange("ViewByName",@CHECK)
MenuChange("ViewShort",@CHECK)
; Setup Print menu item...Kill it if no text printer
:PRINTSETUP
MenuChange("FilePrint", (inireadpvt(IniSection,"TextPrinter","",IniFile)=="NONE") *@DISABLE)
if IsRunning() then goto goombye
a=inireadpvt(IniSection,"AutoStart","NO",IniFile)
if a!="YES" then goto goombye
;if Display(3,"Auto Startup","Hit any key to bypass WIN.INI%CR%Run= and Load= processing") then goto goombye
f=DirGet()
a=iniread("windows","load","")
b=ItemCount(a," ")
d=0
:woop1
if d==b then goto dorun
d=d+1
c=ItemExtract(d,a," ")
if (strupper(FileRoot(c))=="CMDPOST") then goto woop1
e=FilePath(c)
if e!="" then DirChange(e)
Runicon(c,"")
goto woop1
:dorun
a=iniread("windows","run","")
b=ItemCount(a," ")
d=0
:woop2
if d==b then goto resetdir
d=d+1
c=ItemExtract(d,a," ")
if (strupper(FileRoot(c))=="CMDPOST") then goto woop2
e=FilePath(c)
if e!="" then DirChange(e)
Run(c,"")
goto woop2
:resetdir
DirChange(f)
:goombye
Sounds(1) ;Sounds on
drop(a,b,c,d,e,f)
; And the main menu starts.
&File
&Run...
r=CurrentFile()
if !IsKeyDown(@SHIFT) then r=askline("RUN","Enter file to run",r)
r=strcat(strtrim(r)," ")
i=strindex(r," ",0,@FWDSCAN)
a=strsub(r,1,i-1)
b=strtrim(strsub(r,i,strlen(r)-i+1))
run("%a%","%b%")
drop(a,b,r,i)
&Load...
r=CurrentFile()
if !IsKeyDown(@SHIFT) then l=askline("LOAD","Enter file to load",CurrentFile())
l=strcat(strtrim(l)," ")
i=strindex(l," ",0,@FWDSCAN)
a=strsub(r,1,i-1)
b=strtrim(strsub(r,i,strlen(r)-i+1))
runicon("%a%","%b%")
drop(a,b,i,l)
Bro&wse... \ {F3}
l=CurrentFile()
;if !IsKeyDown(@SHIFT) then l=strtrim(askline("Browse","Enter file to browse",l))
a=FileLocate("browser.exe")
if a=="" then a="%HomeBase%browser.exe"
run(a,l)
drop(a,l)
&Edit... \ {F4}
l=CurrentFile()
;if !IsKeyDown(@SHIFT) then l=askline("Edit","Enter file to edit",l)
if l=="" || l==" " then goto NULL
a=strscan(l,".\",0,@BACKSCAN)
if a==0 then l=strcat(l,".")
if a==0 then goto NULL
if strsub(l,a,1)!="." then l=strcat(l,".")
:NULL
run(Editor,strtrim(l))
drop(a,b,l)
&Copy... \ {F8}
r=OtherDir()
if r!=DirGet() then goto NEXT
if CopyMoveDefault!="" then r=CopyMoveDefault
:NEXT
s=strcat(DirItemize("")," ",FileItemize(""))
terminate(strlen(s)==1,"Copy Error","No files selected")
if !IsKeyDown(@SHIFT) then r=strtrim(askline("Copy",StrCat(s,CR,CR,"to"),r))
terminate(r=="","Copy Error","Cannot copy to null file name")
q=strindex(r,"\",0,@FWDSCAN) ; Directory Name in there??
CopyMoveDefault=r
if q==0 then SetDisplay("","","") ;Nope. Set flag to update directory
FileCopy(s,r,@TRUE)
OtherUpdate()
drop(r,s,q)
&Move/Rename... \ {F7}
r=OtherDir()
if r!=DirGet() then goto NEXT
if CopyMoveDefault!="" then r=CopyMoveDefault
:NEXT
s=strcat(DirItemize("")," ",FileItemize(""))
terminate(strlen(s)==1,"Move Error","No files selected")
if !IsKeyDown(@SHIFT) then r=strtrim(askline("Move",StrCat(s,CR,CR,"to"),r))
terminate(r=="","Move Error","Cannot move to null file name")
SetDisplay("","","") ;Set flag to update directory
CopyMoveDefault=r
FileMove(s,r,@TRUE)
OtherUpdate()
drop(r,s)
&Delete File... \ {DEL}
f=FileItemize("")
if IsKeyDown(@SHIFT) then goto doit
g=FileSize(f)
i=ItemCount(f," ")
terminate(strlen(f)==0,"delete","No files specified")
if askyesno("Delete %i% files: %g% bytes ",f)==@NO then exit
:doit
SetDisplay("","","") ;Set flag to update directory
FileDelete(f)
OtherUpdate() ; Well if the "other" CmdPost Window points to the
; same directory, it *IS* nice...
drop(f,g,b)
&Print...
s=FileItemize("")
terminate(strlen(s)==0,"Print Error","No files selected")
TextPrinter=inireadpvt(IniSection,"TextPrinter","ASK",IniFile)
if TextPrinter!="ASK" then goto NOASK1
r=AskYesNo("Attention",strcat("This print routine only works with standard printers.",CR,"Do you have a standard (NON-Postscript) printer?"))
if r==@YES then goto ASK1
iniwritepvt(IniSection,"TextPrinter","NONE",IniFile)
MenuChange("FilePrint",@DISABLE)
Exit
:ASK1
TextPrinter="NONE|LPT1|LPT2|LPT3"
TextPrinter=ItemSelect("Choose the STD text printer",TextPrinter,"|")
terminate(strlen(TextPrinter)==0,"Error","Nothing chosen")
iniwritepvt(IniSection,"TextPrinter",TextPrinter,IniFile)
:NOASK1
Terminate(TextPrinter=="NONE","ERROR","No Text Printers on system")
a=AskLine("Print",strcat(s,CR,CR,"to"),TextPrinter)
FileCopy(s,a,@FALSE)
_File &Info
call("wwwmenus.dll","FILEINFO")
&Freespace on Local Drives
call("wwwmenus.dll","FREESPACE")
_E&xit Windows \ ^X
EndSession()
|Find file
On DOS Path
a=AskLine("Locate file in path","Enter file name to locate",CurrentFile())
b=FileLocate(a)
terminate(b=="",a,"File Not Located")
if AskYesNo(b,"File Located.%CR%Change to that directory?")==@NO then exit
DirChange(FilePath(b))
SetDisplay("","","")
On Current Drive
Mask=Askline("Find File on drive","Enter file name to locate","*.bak")
FileList=""
tot=0
totdir=0
DirChange("\")
LocalList=FileItemize(Mask)
if LocalList=="" then goto skip11
tot = FileSize(LocalList)
totdir=1
LocalList=strcat(" ",strsub(LocalList,1,strlen(LocalList)-1))
locdir=DirGet()
LocalList=strreplace(LocalList," "," %locdir%")
FileList=LocalList
Drop(LocalList)
:Skip11
level=1
dir1=DirGet()
sub1 = DirItemize("*.*")
numdir1 = ItemCount(sub1, " ")
index1 = 0
:loop
If index%level% == numdir%level% Then Goto upalevel
index%level% = index%level% + 1
DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
LocDir = DirGet()
LocalList=FileItemize(Mask)
if LocalList=="" then goto skip22
totdir=totdir+1
tot = tot + FileSize(LocalList)
LocalList=strcat(" ",strsub(LocalList,1,strlen(LocalList)-1))
LocalList=strreplace(LocalList," "," %locdir%")
FileList=Strcat(FileList,LocalList)
drop(LocalList)
:skip22
level = level + 1
dir%level%=LocDir
sub%level% = DirItemize("*.*")
numdir%level% = ItemCount(sub%level%, " ")
index%level% = 0
goto loop
:upalevel
drop(dir%level%,sub%level%,index%level%,numdir%level%)
level=level-1
if level!=0 then goto loop
:done
; -----------
; Termination
; -----------
If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
tot = StrTrim(tot)
If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
tot = StrTrim(tot)
If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
tot = StrTrim(tot)
if FileList!="" then FileList=Strsub(FileList,2,strlen(FileList)-1)
level=ItemCount(FileList," ")
SelectedFile=ItemSelect("%totdir% SubDirs. %level% Files. %tot% bytes.",FileList," ")
if SelectedFile=="" then goto GOOMBYE
DirChange(FilePath(SelectedFile))
SetDisplay("","","")
:GOOMBYE
drop(tot,level,totdir,FileList,SelectedFile)
_&Hilite Files
By Names
a=AskLine("Hilite Files","Enter types of files to hilite",strcat("*.",FileExtension(CurrentFile())))
FileHilite(a,@TRUE)
By Attribute
:askagain
a="Enter an attribute to hilite. R A S or H"
b="Use CAPS to hilite if attribute is set,"
c="Use lowercase to hilite if not set."
a=strcat(a,CR,b,CR,c,CR,"Enter only one character. R A S or H")
drop(b,c)
a=AskLine("Hilite by Attribute",a,"A")
if strlen(a)!=1 then goto askagain
case=2
if (a=='R' || a=='A' || a=='S' || a=='H') then case=1
if (a=='r' || a=='a' || a=='s' || a=='h') then case=0
a=strupper(a)
if case==2 then goto askagain
d=FileItemize("*.*")
e=ItemCount(d," ")
f=0
:loop
f=f+1
if f>e then exit
q=ItemExtract(f,d," ")
g=FileAttrGet(q)
h=strscan(g,a,1,@FWDSCAN)
if h>0 then h=1
;display(3,"%a% %h%","%q% %g%:
if case==h then filehilite(q,@TRUE)
;beep
goto loop
&Unhilite Files
By Name
a=AskLine("Unhilite Files","Enter types of files to unhilite",strcat("*.",FileExtension(CurrentFile())))
FileHilite(a,@FALSE)
By Attribute
:askagain
a="Enter an attribute to hilite. R A S or H"
b="Use CAPS to hilite if attribute is set,"
c="Use lowercase to hilite if not set."
a=strcat(a,CR,b,CR,c,CR,"Enter only one character. R A S or H")
drop(b,c)
a=AskLine("Hilite by Attribute",a,"A")
if strlen(a)!=1 then goto askagain
case=2
if (a=='R' || a=='A' || a=='S' || a=='H') then case=1
if (a=='r' || a=='a' || a=='s' || a=='h') then case=0
a=strupper(a)
if case==2 then goto askagain
d=FileItemize("*.*")
e=ItemCount(d," ")
f=0
:loop
f=f+1
if f>e then exit
q=ItemExtract(f,d," ")
g=FileAttrGet(q)
h=strscan(g,a,1,@FWDSCAN)
if h>0 then h=1
;display(3,"%a% %h%","%q% %g%:
if case==h then filehilite(q,@FALSE)
;beep
goto loop
_File Attributes
View/Modify current file
DaFile=CurrentFile()
:REDO
attr=FileAttrGet(DaFile)
RD=2
AR=2
SY=2
HD=2
if strsub(attr,1,1)=="R" then RD=1
if strsub(attr,2,1)=="A" then AR=1
if strsub(attr,3,1)=="S" then SY=1
if strsub(attr,4,1)=="H" then HD=1
OldHD=HD
OldSY=SY
b=@YES
ATTR2Format=`WWWDLGED,4.0`
ATTR2Caption=`View/Modify Attributes`
ATTR2X=-1
ATTR2Y=-1
ATTR2Width=209
ATTR2Height=141
ATTR2NumControls=11
ATTR201=`6,4,198,DEFAULT,VARYTEXT,DaFile,"<FileName>"`
ATTR202=`12,32,64,DEFAULT,RADIOBUTTON,RD,"ReadOnly",1`
ATTR203=`12,44,64,DEFAULT,RADIOBUTTON,RD,"Read/Write",2`
ATTR204=`132,32,64,DEFAULT,RADIOBUTTON,AR,"Needs Archiving",1`
ATTR205=`132,44,64,DEFAULT,RADIOBUTTON,AR,"Archived",2`
ATTR206=`12,70,64,DEFAULT,RADIOBUTTON,HD,"Hidden",1`
ATTR207=`12,82,64,DEFAULT,RADIOBUTTON,HD,"Normal",2`
ATTR208=`132,70,64,DEFAULT,RADIOBUTTON,SY,"System",1`
ATTR209=`132,82,64,DEFAULT,RADIOBUTTON,SY,"Normal",2`
ATTR210=`24,114,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
ATTR211=`124,114,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",2`
Dialog("ATTR2")
If OldHD!=HD then b=AskYesNo("Attribute Changer","Note: Changing Hidden attribute is unusual%CR%Continue?")
if b==@NO then goto REDO
If OldSy!=SY then b=AskYesNo("Attribute Changer","Note: Changing System attribute is unusual%CR%Continue?")
if b==@NO then goto REDO
attr=""
if RD==1 then attr="R"
if RD==2 then attr='r'
if AR==1 then attr=strcat(attr,"A")
if AR==2 then attr=strcat(attr,"a")
if HD==1 then attr=strcat(attr,"H")
if HD==2 then attr=strcat(attr,"h")
if SY==1 then attr=strcat(attr,"S")
if SY==2 then attr=strcat(attr,"s")
FileAttrSet(DaFile,attr)
Drop(ATTR2Format,ATTR2Caption,ATTR2X,ATTR2Y,ATTR2Width,ATTR2Height)
Drop(ATTR2NumControls,ATTR201,ATTR202,ATTR203,ATTR204,ATTR205,ATTR206)
Drop(ATTR207,ATTR208,ATTR209,ATTR210,ATTR211,RD,AR,HD,SY,attr,OldHD)
Drop(OldSY,b,DaFile)
SetDisplay("","","")
Change hilited files
a=FileItemize("")
terminate(a=="","Attribute Changer","No files Hilited")
string=a
if strlen(string)<35 then goto REDO
string=strcat(strfix(string," ",35)," ...")
:REDO
RD=3
AR=3
SY=3
HD=3
b=@YES
ATTR1Format=`WWWDLGED,4.0`
ATTR1Caption=`File Attribute Changer`
ATTR1X=-1
ATTR1Y=-1
ATTR1Width=209
ATTR1Height=141
ATTR1NumControls=15
ATTR101=`4,4,194,DEFAULT,VARYTEXT,String,""`
ATTR102=`18,30,64,DEFAULT,RADIOBUTTON,RD,"ReadOnly",1`
ATTR103=`18,42,64,DEFAULT,RADIOBUTTON,RD,"Read/Write",2`
ATTR104=`18,54,64,DEFAULT,RADIOBUTTON,RD,"No Change",3`
ATTR105=`128,30,74,DEFAULT,RADIOBUTTON,AR,"Needs Archiving",1`
ATTR106=`128,42,64,DEFAULT,RADIOBUTTON,AR,"Archived",2`
ATTR107=`128,54,64,DEFAULT,RADIOBUTTON,AR,"No Change",3`
ATTR108=`18,78,64,DEFAULT,RADIOBUTTON,HD,"Hidden",1`
ATTR109=`18,90,64,DEFAULT,RADIOBUTTON,HD,"Normal",2`
ATTR110=`18,102,64,DEFAULT,RADIOBUTTON,HD,"No Change",3`
ATTR111=`128,78,64,DEFAULT,RADIOBUTTON,SY,"System",1`
ATTR112=`128,90,64,DEFAULT,RADIOBUTTON,SY,"Normal",2`
ATTR113=`128,102,64,DEFAULT,RADIOBUTTON,SY,"No Change",3`
ATTR114=`14,122,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
ATTR115=`128,122,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",2`
Dialog("ATTR1")
If HD!=3 then b=AskYesNo("Attribute Changer","Note: Changing Hidden attribute is unusual%CR%Continue?")
if b==@NO then goto REDO
If SY!=3 then b=AskYesNo("Attribute Changer","Note: Changing System attribute is unusual%CR%Continue?")
if b==@NO then goto REDO
attr=""
if RD==1 then attr="R"
if RD==2 then attr='r'
if AR==1 then attr=strcat(attr,"A")
if AR==2 then attr=strcat(attr,"a")
if HD==1 then attr=strcat(attr,"H")
if HD==2 then attr=strcat(attr,"h")
if SY==1 then attr=strcat(attr,"S")
if SY==2 then attr=strcat(attr,"s")
FileAttrSet(a,attr)
Drop(ATTR1Format,ATTR1Caption,ATTR1X,ATTR1Y,ATTR1Width,ATTR1Height)
Drop(ATTR1NumControls,ATTR101,ATTR102,ATTR103,ATTR104,ATTR105,ATTR106)
Drop(ATTR107,ATTR108,ATTR109,ATTR110,ATTR111,ATTR112,ATTR113,ATTR114)
Drop(ATTR115,RD,AR,HD,SY,attr,string)
SetDisplay("","","")
_Floppy Space
A:
message(strcat("Drive A ",DiskFree("A")),strcat("Selected Files ",FileSize(FileItemize(""))))
B:
message(strcat("Drive B ",DiskFree("B")),strcat("Selected Files ",FileSize(FileItemize(""))))
_&Network
Connect Drive to Net
AvailDrive=DiskScan(0)
DrvLen=strlen(AvailDrive)
if DrvLen==0 then goto NOMORE
AvailDrive=Strsub(AvailDrive,DrvLen-2,2)
NetPath=NetBrowse(0)
pswd=AskPassword("Enter password for",NetPath)
NetAddCon(NetPath,pswd,AvailDrive)
exit
:NOMORE
Message("Connect Drive to Net","No drives avail for assignment")
Disconnect
AvailDrive=DiskScan(4)
a=Itemcount(AvailDrive," ")
if a==0 then exit
i=1
DisList=""
:loop
b=ItemExtract(i,AvailDrive," ")
DisList=strcat(DisList,b,num2char(9),NetGetCon(b),"|")
i=i+1
if i<a then goto loop
AvailDrive=ItemSelect("Disconnect",DisList,"|")
AvailDrive=strsub(AvailDrive,1,1)
NetCancelCon(AvailDrive,0)
Net Dialog
NetDialog()
_Preferences
Show System/Hidden Files
a=strupper(inireadpvt(IniSection,"SysHide","0",IniFile))
c="YES"
if a==0 then c="NO"
b=AskYesNo("System/Hidden Files","Show System and Hidden files?%CR%Current answer=%c%%CR%Enter desired answer")
if a!=b then iniwritepvt(IniSection,"SysHide",b,IniFile)
IntControl(5,b,0,0,0) ;Controls system/hidden show flag
SetDisplay("","","")
Save CmdPost Window Positions
c=IntControl(2,0,0,0,0) ;This guy returns # of CP Windows open
b1="Do you wish to save the current CmdPost"
b2="window positions for future startups?"
b3="Note: You can save positions of combinations"
b4="of 1, 2, 3, and 4 window positions."
b5="Now saving window positions for %c% windows"
b1=strcat(b1,CR,b2,CR,CR,b3,CR,b4,CR,b5)
drop(b2,b3,b4,b5)
a=AskYesNo("CmdPost Window Positions",b1)
if a==@YES then IntControl(3,0,0,0,0) ;This causes all cp's to write
exit ;their position information
Auto Run= and Load= Options
a=strupper(inireadpvt(IniSection,"AutoStart","NO",IniFile))
b=AskYesNo("Auto Startup from WIN.INI","Auto start from WIN.INI RUN= and LOAD= lines?%CR%Current answer=%a%%CR%Enter desired answer")
if b==@YES then b=AskYesNo("Auto Startup from WIN.INI","Generally this option is set only%CR%when you make CmdPost your shell.%CR%Continue?")
if b==@NO then b="NO"
if b==@YES then b="YES"
if a!=b then iniwritepvt(IniSection,"AutoStart",b,IniFile)
CmdPost Window Titles
Window 1
c=strcat("Command Post ",version()," #")
a=1
Title%a%=inireadpvt(IniSection,"Title%a%","%c%%a%",IniFile)
b=AskLine("CmdPost Title #%a%","Enter name of #%a% CmdPost window.",Title%a%)
iniwritepvt(IniSection,"Title%a%",b,IniFile)
if WinExist(Title%a%) then WinTitle(Title%a%,b)
Window 2
c=strcat("Command Post ",version()," #")
a=2
Title%a%=inireadpvt(IniSection,"Title%a%","%c%%a%",IniFile)
b=AskLine("CmdPost Title #%a%","Enter name of #%a% CmdPost window.",Title%a%)
iniwritepvt(IniSection,"Title%a%",b,IniFile)
if WinExist(Title%a%) then WinTitle(Title%a%,b)
Window 3
c=strcat("Command Post ",version()," #")
a=3
Title%a%=inireadpvt(IniSection,"Title%a%","%c%%a%",IniFile)
b=AskLine("CmdPost Title #%a%","Enter name of #%a% CmdPost window.",Title%a%)
iniwritepvt(IniSection,"Title%a%",b,IniFile)
if WinExist(Title%a%) then WinTitle(Title%a%,b)
Window 4
c=strcat("Command Post ",version()," #")
a=4
Title%a%=inireadpvt(IniSection,"Title%a%","%c%%a%",IniFile)
b=AskLine("CmdPost Title #%a%","Enter name of #%a% CmdPost window.",Title%a%)
iniwritepvt(IniSection,"Title%a%",b,IniFile)
if WinExist(Title%a%) then WinTitle(Title%a%,b)
View Menu Startup Options
a=strupper(inireadpvt(IniSection,"ViewSetup","NO",IniFile))
b=AskYesNo("Remember View options","Should View menu options be remembered?%CR%Current answer=%a%%CR%Enter desired answer")
if b==@NO then b="NO"
if b==@YES then b="YES"
if a!=b then iniwritepvt(IniSection,"ViewSetup",b,IniFile)
Editor Options
Editor=strtrim(strupper(AskLine("Editor Selection","Enter desired editor",Editor)))
iniwritepvt(IniSection,"Editor",Editor,IniFile)
File Refresh
On
IniWritePvt(IniSection,"AutoUpdate",1,IniFile)
MenuChange("MainPreferencesFileRefreshOn",@CHECK)
MenuChange("MainPreferencesFileRefreshOff",@UNCHECK)
Off
IniWritePvt(IniSection,"AutoUpdate",0,IniFile)
MenuChange("MainPreferencesFileRefreshOn",@UNCHECK)
MenuChange("MainPreferencesFileRefreshOff",@CHECK)
Default DoubleClick Program
a=IniRead("Extensions","*","Browser.exe")
a=AskLine("Default startup program","Enter program to run for file when%CR%file extension is not defined",a)
iniwrite("Extensions","*",a)
Reset Assorted Options
iniwritepvt(IniSection,"DriveA","ASK",IniFile)
iniwritepvt(IniSection,"DriveB","ASK",IniFile)
iniwritepvt(IniSection,"TextPrinter","ASK",IniFile)
iniwritepvt("wallpaper","WallPaperDir","ASK","WWW-PROD.INI")
MenuChange("FilePrint",@ENABLE)
b1="CmdPost's saved information reset."
b2="You will be prompted to re-enter the"
b3="necessary information when it is required."
b1=strcat(b1,CR,b2,CR,b3)
Message("Information Reset",b1)
_&Extensions...
a=strtrim(CurrentFile())
i=strindex(a,".",0,@FWDSCAN)
terminate(i==0,"Association Error","Associated files must have an extension")
b=FileExtension(a)
c=iniread("extensions",b,"???.EXE ^.%b%")
d=askline("Associate","%b% files are associated with",c)
terminate(c==d,"","")
iniwrite("extensions",b,d)