home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / utils / command.zip / CP_INST.SFX / lha / CMDPOST.CPM < prev    next >
Text File  |  1990-08-04  |  24KB  |  617 lines

  1. ; Define addon menu   USER menus should go into CMDUSER.CPM...by convention...
  2. #NextFile CMDUSER.CPM
  3.  
  4.  
  5.  
  6. ; CmdPost menu      initialization code
  7.  
  8.     ; Initialize a few variables here.  You may dink the CP names below
  9.     ; Just keep the two names different.
  10.       
  11.     a=Version()
  12.         CP="CmdPost"
  13.  
  14.         ; *******TO CHANGE TITLES, USE THE Main.ResetOptions command - automagic now!
  15.     TitleFirst="Command Post - Window 1"   ; default name primary CP Window
  16.     TitleSecond= "Command Post - Window 2"   ; default name second CP Windows
  17.  
  18.         TitleFirst=iniread(CP,"TitleFirst",TitleFirst)
  19.         TitleSecond=iniread(CP,"TitleSecond",TitleSecond)
  20.         b=strsub(";",1,IsLicensed())
  21.         execute %b% TitleFirst="Command Post %a% - Eval Only"
  22.         execute %b% TitleSecond ="Command Post %a% # Eval Only"
  23.     crlf=strcat(num2char(13),num2char(10))
  24.     tab=num2char(9)
  25.  
  26. ; Knock out MS-DOS Executive
  27.         ErrorMode(@OFF)
  28.         WinHide("MS-DOS")
  29.         ErrorMode(@CANCEL)
  30.  
  31. ; Setting up the View menu item here.
  32.  
  33.         ViewShortLong=iniread(CP,"ViewShortLong","SHORT")
  34.  
  35.         MenuChange("ViewShort", (ViewShortLong=="SHORT")*@CHECK)
  36.         MenuChange("ViewLong",  (ViewShortLong=="LONG")*@CHECK)
  37.         
  38.         ViewBy=iniread(CP,"ViewBy","NAME")
  39.         MenuChange("ViewByName", (ViewBy=="NAME")*@CHECK)
  40.         MenuChange("ViewByDate", (ViewBy=="DATE")*@CHECK)
  41.         MenuChange("ViewBySize", (ViewBy=="SIZE")*@CHECK)
  42.         MenuChange("ViewByKind", (ViewBy=="KIND")*@CHECK)
  43.         MenuChange("ViewUnsorted",(ViewBy=="UNSORTED")*@CHECK)
  44.  
  45.         ViewWhat=iniread(CP,"ViewWhat","ALL")
  46.         MenuChange("ViewAll",      (ViewWhat=="ALL")     *@CHECK)
  47.         MenuChange("ViewPartial",  (ViewWhat=="PARTIAL") *@CHECK)
  48.         MenuChange("ViewPrograms", (ViewWhat=="PROGRAMS")*@CHECK)
  49.  
  50.         a=iniread(CP,"Partial","*.*")
  51.         SD3=strcat(strsub("*.*",1,IsMenuChecked("ViewAll")*3),strsub(a,1,IsMenuChecked("ViewPartial")*strlen(a)),strsub("*.EXE *.COM *.BAT *.PIF",1,IsMenuChecked("ViewPrograms")*23))
  52.         SetDisplay(ViewShortLong,ViewBy,SD3)
  53.         drop(a,ViewShortLong,ViewBy,ViewWhat,SD3)
  54.  
  55. ; Setup Print menu item...Kill it if no text printer
  56.         MenuChange("FilePrint", (IniRead(CP,"TextPrinter","")=="NONE") *@DISABLE)
  57. ; Setup Screen Blank Time.  Get time from win.ini
  58.         
  59.         run("cp_blnk.exe",iniread(CP,"BlankTime",5))
  60. ;                             ;    <0....blanking with no clock
  61. ;                             ;     0... no blanking, but have a clock
  62. ;                             ;    >0... blanking and clock
  63. ;                             ;    multiple startups ignored.
  64.  
  65.     ; This obscure code just names the two Command Post windows.
  66.     ; This code also is depended upon by the Main.CommandPost item below
  67.         IfOnlyMe=strsub(";",1,IsRunning()==@TRUE) ;Funny reverse logic...
  68.  
  69.         a=1                   ;dummy value
  70.         ErrorMode(@OFF)
  71.         Execute %IfOnlyMe%    WinTitle("",TitleFirst);Title of first 'Post
  72.         Execute %IfOnlyMe%    a="0,0,1000,@ABOVEICONS"
  73.         Execute %IfOnlyMe%    a=IniRead(CP,"WinPosition",a)
  74.         Execute %IfOnlyMe%    WinPlace(%a%,"")
  75.         Execute %IfOnlyMe%    Exit
  76.  
  77.     TitleTemp=TitleSecond
  78.         a=WinExist(TitleFirst)
  79.     a=strsub(";",1,a)
  80.     Execute %a% TitleTemp=TitleFirst
  81.     WinTitle("",TitleTemp);Title of this 'Post
  82.     WinPlace(500,0,1000,@ABOVEICONS,TitleSecond)
  83.     WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
  84.         ErrorMode(@CANCEL)
  85.     ;Do not Drop TitleFirst,TitleSecond,crlf,tab,CP as these are used
  86.     ;in following menu items.
  87.  
  88.     Drop(a,TitleTemp,IfOnlyMe)
  89.  
  90. ; And the menu starts.  Notice that we are emulating the MS-DOS Window
  91. &File
  92.  &Run...
  93.         r=CurrentFile()
  94.         a=strsub(";",1,IsKeyDown(@SHIFT))
  95.         execute %a% r=askline("RUN","Enter file to run",r)
  96.         r=strcat(strtrim(r)," ")
  97.         i=strindex(r," ",0,@FWDSCAN)
  98.         run(strsub(r,1,i-1),strtrim(strsub(r,i,strlen(r)-i+1)))
  99.         drop(a,r,i)        
  100.  &Load...
  101.         r=CurrentFile()
  102.         a=strsub(";",1,IsKeyDown(@SHIFT))
  103.         execute %a% l=askline("LOAD","Enter file to load",CurrentFile())
  104.         l=strcat(strtrim(l)," ")
  105.         i=strindex(l," ",0,@FWDSCAN)
  106.         runicon(strsub(l,1,i-1),strtrim(strsub(l,i,strlen(l)-i+1)))
  107.         drop(a,i,l)
  108.  Bro&wse...
  109.         l=CurrentFile()
  110.         a=strsub(";",1,IsKeyDown(@SHIFT))
  111.         execute %a% l=askline("Browse","Enter file to browse",l)
  112.         run("browser.exe",l)
  113.         drop(a,l)
  114.  &Notepad Edit...
  115.         l=CurrentFile()
  116.         a=strsub(";",1,IsKeyDown(@SHIFT))
  117.         execute %a% l=askline("Notepad Edit","Enter file to edit",l)
  118.         a=strindex(l,".",0,@BACKSCAN)
  119.         l=strcat(l,strsub(".",1,a==0))
  120.         run("notepad.exe",l)
  121.         drop(a,l)
  122.  &Copy...
  123.         r=OtherDir()
  124.         a=strsub(";",1,IsKeyDown(@SHIFT))
  125.         s=strcat(DirItemize("")," ",FileItemize(""))
  126.         terminate(strlen(s)==1,"Copy Error","No files selected")
  127.         execute %a% r=askline("Copy",StrCat(s,crlf,crlf,"to"),r)
  128.         terminate(r=="","Copy Error","Cannot copy to null file name")        
  129.         q=strindex(r,"\",0,@FWDSCAN) ; Directory Name in there??
  130.         q=strsub(";",1,q!=0)
  131.         execute %q% SetDisplay("","","") ;set flag to update directory
  132.         FileCopy(s,r,@TRUE)
  133.         OtherUpdate()
  134.         drop(a,r,s,q)
  135.  &Move/Rename...
  136.         r=OtherDir()
  137.         a=strsub(";",1,IsKeyDown(@SHIFT))
  138.         s=strcat(DirItemize("")," ",FileItemize(""))
  139.         terminate(strlen(s)==1,"Move Error","No files selected")
  140.         execute %a% r=askline("Move",StrCat(s,crlf,crlf,"to"),r)
  141.         terminate(r=="","Move Error","Cannot move to null file name")
  142.         SetDisplay("","","") ;Set flag to update directory
  143.         FileMove(s,r,@TRUE)
  144.         OtherUpdate()
  145.         drop(a,r,s)
  146.  &Delete File..
  147.         f=FileItemize("")
  148.         g=DirItemize("")
  149.         c=strsub( ";", 1, (strlen(g)==0) )
  150.         b=0
  151.         execute %c% b=AskYesNo("!!! Warning !!! ",strcat("Delete files from these directories too?",crlf,g))
  152.         c=strsub(";",1,abs(b-1))
  153.         execute %c% f=strcat(g," ",f)
  154.         terminate(strlen(f)==0,"delete","No files specified")
  155.         terminate(askyesno("Delete",f)==0,"Delete","File(s) not deleted")
  156.         SetDisplay("","","") ;Set flag to update directory
  157.         FileDelete(f)
  158.         OtherUpdate()  ; Well if the "other" CmdPost Window points to the
  159.                     ; same directory, it *IS* nice...
  160.         drop(f,g,a)
  161.  
  162.  &Print...
  163.         s=FileItemize("")
  164.         terminate(strlen(s)==0,"Print Error","No files selected")
  165.         TextPrinter=iniread(CP,"TextPrinter","ASK")
  166.         a=strsub(";",1,TextPrinter!="ASK")
  167.         b=";"
  168.         Execute %a% r=AskYesNo("Attention",strcat("This print routine only works with standard printers.",crlf,"Do you have a standard (NON-Postscript) printer?"))
  169.         Execute %a% b=strsub(";",1,r==@YES)
  170.         Execute %b% iniwrite(CP,"TextPrinter","NONE")
  171.         Execute %b% MenuChange("FilePrint",@DISABLE)
  172.         Execute %b% Exit
  173.         Execute %a% TextPrinter="NONE|LPT1|LPT2|LPT3"
  174.         Execute %a% TextPrinter=ItemSelect("Choose the STD text printer",TextPrinter,"|")
  175.         Execute %a% terminate(strlen(TextPrinter)==0,"Error","Nothing chosen")
  176.         Execute %a% iniwrite(CP,"TextPrinter",TextPrinter)
  177.         Terminate(TextPrinter=="NONE","ERROR","No Text Printers on system")
  178.         a=AskLine("Print",strcat(s,crlf,crlf,"to"),TextPrinter)
  179.         FileCopy(s,a,@FALSE)
  180.  _&Hilite Files
  181.         a=AskLine("Hilite Files","Enter types of files to hilite",strcat("*.",FileExtension(CurrentFile())))
  182.         FileHilite(a,@TRUE)
  183.  &Unhilite Files
  184.         a=AskLine("Unhilite Files","Enter types of files to unhilite",strcat("*.",FileExtension(CurrentFile())))
  185.         FileHilite(a,@FALSE)
  186.  _&Size of selected files
  187.         message("Total size of files",strcat(FileSize(FileItemize(""))," Bytes"))
  188.  
  189.  &Freespace on Drives   
  190. ;        This code initially asks for your last drive
  191. ;        (It does assume you have no holes between C and the
  192. ;         last drive...)
  193. ;        and then computes disk space based on the last drive
  194.  
  195.         NextDrive="C"
  196.         crlf=strcat(num2char(13),num2char(10))
  197.         LastDrive=iniread("CmdPost","LastDrive","ASK") 
  198.         xxx=strsub(";",1,(LastDrive!="ASK"))
  199.         execute %xxx% LastDrive=AskLine("Setup Question",strcat("Enter letter of last (contiguous) disk drive",crlf,"C D E F G H ...Z"),"C")
  200.         execute %xxx% LastDrive=StrUpper(LastDrive)
  201.         execute %xxx% iniwrite("CmdPost","LastDrive",LastDrive)
  202.         
  203.         ; Always do C drive
  204.         a=DiskFree(NextDrive)/1024
  205.         TotalSize=a
  206.         DriveReport=strcat(NextDrive," = ",a,"K")
  207.         NextDrive=num2char(char2num(NextDrive)+1)
  208.         xxx=strsub(";",1,NextDrive>LastDrive)
  209.  
  210.         ; Check on D drive
  211.         execute %xxx% a=DiskFree(NextDrive)/1024
  212.         execute %xxx% TotalSize=TotalSize+a
  213.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  214.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  215.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  216.  
  217.  
  218.         ; Check on E drive
  219.         execute %xxx% a=DiskFree(NextDrive)/1024
  220.         execute %xxx% TotalSize=TotalSize+a
  221.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  222.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  223.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  224.  
  225.  
  226.         ; Check on F drive
  227.         execute %xxx% a=DiskFree(NextDrive)/1024
  228.         execute %xxx% TotalSize=TotalSize+a
  229.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  230.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  231.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  232.  
  233.  
  234.         ; Check on G drive
  235.         execute %xxx% a=DiskFree(NextDrive)/1024
  236.         execute %xxx% TotalSize=TotalSize+a
  237.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  238.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  239.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  240.  
  241.  
  242.         ; Check on H drive
  243.         execute %xxx% a=DiskFree(NextDrive)/1024
  244.         execute %xxx% TotalSize=TotalSize+a
  245.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  246.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  247.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  248.  
  249.  
  250.         ; Check on I drive
  251.         execute %xxx% a=DiskFree(NextDrive)/1024
  252.         execute %xxx% TotalSize=TotalSize+a
  253.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  254.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  255.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  256.  
  257.         ; Well if you have more than I drives, just repeat the
  258.         ; Code blocks above
  259.  
  260.         Message("Total Space = %TotalSize%K",DriveReport)
  261.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  262.  
  263.  Space on &A and size of files
  264.         message(strcat("Drive A ",DiskFree("A")),strcat("Selected Files ",FileSize(FileItemize(""))))
  265.  
  266.  
  267.  Space on &B and size of files
  268.         message(strcat("Drive B ",DiskFree("B")),strcat("Selected Files ",FileSize(FileItemize(""))))
  269.  
  270.  
  271.  _&Extensions...
  272.         a=strtrim(CurrentFile())
  273.         i=strindex(a,".",0,@FWDSCAN)
  274.         terminate(i==0,"Association Error","Associated files must have an extension")
  275.         b=strsub(a,i+1,strlen(a)-i)
  276.         c=iniread("extensions",b,"???.EXE ^.%b%")
  277.         d=askline("Associate","%b% files are associated with",c)
  278.         terminate(c==d,"","")
  279.         iniwrite("extensions",b,d)
  280.  _E&xit Windows
  281.         EndSession()
  282.         
  283. &Dir
  284.  C&reate Directory...
  285.         a=askline("Create Directory","Enter directory to create","")
  286.         terminate(a=="","Create Error","Cannot create directory with null name")
  287.         DirMake(a)
  288.         SetDisplay("","","")
  289.         drop(a)
  290.  
  291.  &Delete Directory...
  292.         f=DirItemize("")
  293.         terminate(strlen(f)==0,"Delete Directory","No directory specified")
  294.         terminate(@no==askyesno("Delete Directory",f),"Delete Directory","Directory not deleted")
  295.         DirRemove(f)
  296.         SetDisplay("","","")
  297.         OtherUpdate()   ; Well if the "other" CmdPost Window points to the
  298.                       ; same directory, it *is* nice
  299.         drop(f)
  300.  
  301.  &Change Directory...
  302.         a=DirGet()
  303.         b=strindex(a,':',1,@fwdscan)
  304.         c=askline("Change Directory","Enter directory name",strsub(a,b+1,strlen(a)-b-1))
  305.         terminate(c=="","Directory Error","Directory with null name does not exist")
  306.         DirChange(c)
  307.         SetDisplay("","","")
  308.         drop(a,b,c)
  309.  
  310.  _&Format Diskette...
  311.         ; A wonderful example of variable substitution
  312.         D1="1) 5.25 High Density (1.2M)"
  313.         D2="2) 5.25 Standard (360K)"
  314.         D3="3) 3.5  High Density (1.44M)"
  315.         D4="4) 3.5  Standard (720K)"
  316.         D0="0) None"
  317.         DC="%D1%|%D2%|%D3%|%D4%|%D0%"
  318.         DriveA=iniread(CP,"DriveA","ASK")
  319.         xxx=strsub(";",1,DriveA!="ASK")
  320.         execute %xxx% Message("Attention","Command Post needs to learn what kind of floppies %crlf% the system has.  Please select accordingly.")
  321.         execute %xxx% a=ItemSelect("Select type of Drive A",DC,"|")
  322.         execute %xxx% Terminate(a=="","You MUST select an option for A.","Please retry FORMAT command.")
  323.         execute %xxx% DriveA=strsub(a,1,1)
  324.         execute %xxx% iniwrite(CP,"DriveA",DriveA)
  325.         DriveB=iniread(CP,"DriveB","ASK")
  326.         xxx=strsub(";",1,DriveB!="ASK")
  327.         execute %xxx% a=ItemSelect("Select type of Drive B",DC,"|")
  328.         execute %xxx% Terminate(a=="","You MUST select an option for B.","Please retry FORMAT command.")
  329.         execute %xxx% DriveB=strsub(a,1,1)
  330.         execute %xxx% iniwrite(CP,"DriveB",DriveB)
  331.        
  332.         A0=""
  333.         A1="1)    A:   5.25 HD (1.2M)|2)    A:   5.25 DD (360K)"
  334.         A2="2)    A:   5.25 DD (360K)"
  335.         A3="3)    A:   3.5 HD (1.44M)|4)    A:   3.5 Std (720K)"
  336.         A4="4)    A:   3.5 Standard (720K)"
  337.         B0=""
  338.         B1="5)    B:   5.25 HD (1.2M)|6)    B:   5.25 DD (360K)"
  339.         B2="6)    B:   5.25 Standard (360K)"
  340.         B3="7)    B:   3.5 HD (1.44M)|8)    B:   3.5 DD (720K)"
  341.         B4="8)    B:   3.5 DD (720K)"
  342.         FF=strcat(A%DriveA%,"|",B%DriveB%)
  343.         drop(A0,A1,A2,A3,A4,B0,B1,B2,B3,B4)
  344.  
  345.         FF=ItemSelect("Choose Format Type Desired",FF,"|")
  346.         terminate(FF=="","Format","No parameters selected")
  347.  
  348.         FF=strsub(FF,1,1)   ; FF will be 1 thru 8 (with luck)
  349.         DR=strsub("AB",(FF>4)+1,1)  ; DR is desired drive
  350.         FF=FF-((FF>4)*4)            ; FF is 1 thru 4
  351.         F11=""
  352.         F12="/4"
  353.         F22=""
  354.         F33=""
  355.         F34="/n:9 /t:80"
  356.         F44=""
  357.         DC=Drive%DR%   ; get drive type
  358.         FC=F%DC%%FF%
  359.         FC="%DR%:  %FC%"
  360.         DC=strsub(D%FF%,4,strlen(d%FF%)-3)
  361.         Pause("Attention",strcat("Preparing to format %DC%",crlf,"diskette in Drive %DR% with command:",crlf,"FORMAT %FC%"))
  362.         run("command.com","/c format.com %FC%")
  363.         drop(D0,D1,D2,D3,D4,DC,xxx,DriveA,DriveB)
  364.         drop(FF,DR,F11,F12,F22,F33,F34,F44,DC,FC)
  365.  
  366.  _Directory &Tree
  367.         run("cp_tree.exe","")
  368.  
  369.  
  370.  
  371. &View
  372.  &Short
  373.         SetDisplay("SHORT","","")
  374.         MenuChange("ViewShort",@CHECK)
  375.         MenuChange("ViewLong",@UNCHECK)
  376.         iniwrite(CP,"ViewShortLong","SHORT")
  377.  &Long
  378.         SetDisplay("LONG","","")
  379.         MenuChange("ViewShort",@UNCHECK)
  380.         MenuChange("ViewLong",@CHECK)
  381.         iniwrite(CP,"ViewShortLong","LONG")
  382.  _&All
  383.         SetDisplay("","","*.*")
  384.         MenuChange("ViewAll",@CHECK)
  385.         MenuChange("ViewPartial",@UNCHECK)
  386.         MenuChange("ViewPrograms",@UNCHECK)
  387.         iniwrite(CP,"ViewWhat","ALL")
  388.  &Partial...
  389.         a=iniread(CP,"Partial","*.*")
  390.         a=AskLine("View Partial","Enter types of files desired",a)
  391.         iniwrite(CP,"Partial",a)
  392.         SetDisplay("","",a)
  393.         MenuChange("ViewAll",@UNCHECK)
  394.         MenuChange("ViewPartial",@CHECK)
  395.         MenuChange("ViewPrograms",@UNCHECK)
  396.         iniwrite(CP,"ViewWhat","PARTIAL")
  397.  P&rograms
  398.         SetDisplay("","","*.EXE *.COM *.BAT *.PIF")
  399.         MenuChange("ViewAll",@UNCHECK)
  400.         MenuChange("ViewPartial",@UNCHECK)
  401.         MenuChange("ViewPrograms",@CHECK)
  402.         iniwrite(CP,"ViewWhat","PROGRAMS")
  403.  _By &Name
  404.         SetDisplay("","NAME","")
  405.         MenuChange("ViewByName",@CHECK)
  406.         MenuChange("ViewByDate",@UNCHECK)
  407.         MenuChange("ViewBySize",@UNCHECK)
  408.         MenuChange("ViewByKind",@UNCHECK)
  409.         MenuChange("ViewUnsorted",@UNCHECK)
  410.         iniwrite(CP,"ViewBy","NAME")
  411.  By &Date
  412.         SetDisplay("","DATE","")
  413.         MenuChange("ViewByName",@UNCHECK)
  414.         MenuChange("ViewByDate",@CHECK)
  415.         MenuChange("ViewBySize",@UNCHECK)
  416.         MenuChange("ViewByKind",@UNCHECK)
  417.         MenuChange("ViewUnsorted",@UNCHECK)
  418.         iniwrite(CP,"ViewBy","DATE")
  419.  By Si&ze
  420.         SetDisplay("","SIZE","")
  421.         MenuChange("ViewByName",@UNCHECK)
  422.         MenuChange("ViewByDate",@UNCHECK)
  423.         MenuChange("ViewBySize",@CHECK)
  424.         MenuChange("ViewByKind",@UNCHECK)
  425.         MenuChange("ViewUnsorted",@UNCHECK)
  426.         iniwrite(CP,"ViewBy","SIZE")
  427.  By &Kind       
  428.         SetDisplay("","KIND","")
  429.         MenuChange("ViewByName",@UNCHECK)
  430.         MenuChange("ViewByDate",@UNCHECK)
  431.         MenuChange("ViewBySize",@UNCHECK)
  432.         MenuChange("ViewByKind",@CHECK)
  433.         MenuChange("ViewUnsorted",@UNCHECK)
  434.         iniwrite(CP,"ViewBy","KIND")
  435.  &Unsorted
  436.         SetDisplay("","UNSORTED","")
  437.         MenuChange("ViewByName",@UNCHECK)
  438.         MenuChange("ViewByDate",@UNCHECK)
  439.         MenuChange("ViewBySize",@UNCHECK)
  440.         MenuChange("ViewByKind",@UNCHECK)
  441.         MenuChange("ViewUnsorted",@CHECK)
  442.         iniwrite(CP,"ViewBy","UNSORTED")
  443.  
  444.  |&1 Stack
  445.         winarrange(1)
  446.  &2 Arrange
  447.         winarrange(2)
  448.  &3 Arrange in Rows
  449.         winarrange(3)
  450.  &4 Arrange in Columns
  451.         winarrange(4)
  452.  _&5 (w/o CP) Stack
  453.         winiconize("")
  454.         winarrange(1)
  455.  &6 (w/o CP) Arrange
  456.         winiconize("")
  457.         winarrange(2)
  458.  &7 (w/o CP) Arrange in Rows
  459.         winiconize("")
  460.         winarrange(3)
  461.  &8 (w/o CP) Arrange in Cols
  462.         winiconize("")
  463.         winarrange(4)
  464.  
  465. &Main
  466.  &Command Post (2nd Window)
  467.     ErrorMode(@OFF)
  468.     a=WinActivate(TitleFirst)
  469.     b=WinActivate(TitleSecond)
  470.     ErrorMode(@CANCEL)
  471.     c=strsub(";",1, a&b )
  472.     Execute %c% run("cmdpost.exe","")
  473.     Execute %c% Exit
  474.     WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
  475.     WinPlace(500,0,1000,@ABOVEICONS,TitleSecond)
  476.         drop(a,b,c)
  477.  
  478.  
  479.  Control &Panel
  480.         errormode(@off)
  481.         terminate(winactivate("Control Panel"),"","")
  482.         errormode(@cancel)
  483.         run("control.exe","")
  484.  
  485.  C&lipboard
  486.         errormode(@off)
  487.         terminate(winactivate("Clipboard"),"","") ;Already Running
  488.         errormode(@cancel)
  489.         run("Clipbrd.exe","")
  490.  
  491.  &DOS Prompt
  492.         run("command.com","")
  493.  
  494.  _Get &Help Cardfile
  495.            run("cardfile.exe","cp_help.crd")
  496.  Get &Question 'n' Answer Cardfile
  497.            run("cardfile.exe","cp_quest.crd")
  498.  
  499.  Reset &Options...
  500.         a=iniread(CP,"BlankTime",5)
  501.         b1="Enter screen blanker delay time"
  502.         b2="or 0 to disable blanker"
  503.         b3="or negative time to disable clock"
  504.         b1=strcat(b1,crlf,b2,crlf,b3)
  505.         a=AskLine("Screen Blanker",b1,iniread(CP,"BlankTime",5))
  506.         iniwrite(CP,"BlankTime",a)
  507.         ErrorMode(@OFF)
  508.         WinClose("CmdPost Clock")
  509.         ErrorMode(@CANCEL)
  510.         run("CP_BLNK.EXE",a)
  511.         b1="Do you wish to save the current CmdPost"
  512.         b2="window position for future startups?"
  513.         b1=strcat(b1,crlf,b2)
  514.         a=AskYesNo("CmdPost Window Position",b1)
  515.         a=strsub(";",1,a==@NO)
  516.         execute %a% b1=WinPosition("")
  517.         execute %a% IniWrite(CP,"WinPosition",b1)
  518.         b1="Do you wish to reset CmdPost's Printer"
  519.         b2="and Disk Drive information?"
  520.         b1=strcat(b1,crlf,b2)
  521.         a=AskYesNo("Information Reset",b1)
  522.         a=strsub(";",1,a==@NO)
  523.         execute %a% iniwrite(CP,"TextPrinter","ASK")
  524.         execute %a% iniwrite(CP,"LastDrive","ASK")
  525.         execute %a% iniwrite(CP,"DriveA","ASK")
  526.         execute %a% iniwrite(CP,"DriveB","ASK")
  527.         execute %a% MenuChange("FilePrint",@ENABLE)
  528.         b1="CmdPost's saved information reset."
  529.         b2="You will be prompted to re-enter the"
  530.         b3="necessary information when it is required."
  531.         b1=strcat(b1,crlf,b2,crlf,b3)
  532.         execute %a% Message("Information Reset",b1)
  533.         b1=AskLine("First CmdPost Title","Enter name of main CmdPost window.%crlf%Must be licensed  for this to work.",TitleFirst)
  534.         b2=AskLine("Second CmdPost Title","Enter name of other window.%crlf%Must be different!",TitleSecond)
  535.         a= ((b1!=TitleFirst) | (b2!=TitleSecond))*(b1!=b2)
  536.         a=strsub(";",1,!a)
  537.         tf=strsub(";",1,!WinExist(TitleFirst))
  538.         ts=strsub(";",1,!WinExist(TitleSecond))
  539.         Execute %a% iniwrite(CP,"TitleFirst",b1)
  540.         Execute %a% iniwrite(CP,"TitleSecond",b2)
  541.         Execute %a% %tf% WinTitle(TitleFirst,b1)
  542.         Execute %a% %ts% WinTitle(TitleSecond,b2)
  543.         Execute %a% TitleFirst=b1
  544.         Execute %a% TitleSecond=b2
  545.         drop(a,b1,b2,b3)
  546.  
  547.        
  548.  _&System Information
  549.         run("cp_info.exe","")
  550.  
  551.  |P&rogram Manager
  552.     errormode(@off)
  553.         terminate(winactivate("Program Manager"),"","") ;Already Running
  554.         errormode(@cancel)
  555.         run("Progman.exe","")
  556.  
  557.  &File Manager
  558.     errormode(@off)
  559.         terminate(winactivate("File Manager"),"","") ;Already Running
  560.         errormode(@cancel)
  561.         run("winfile.exe","")
  562.  
  563.  Print &Manager
  564.     run("printman.exe","")   ; takes care of itself
  565.  
  566.  &Windows Setup
  567.         a=FilePath(Filelocate("system.ini"))
  568.         run(strcat(a,"setup.exe"),"")
  569.         drop(a)
  570.  
  571.  
  572.  _&Edit CmdPost menus
  573.            DirChange(FilePath(FileLocate("CMDPOST.CPM")))
  574.            a=FileItemize("*.CPM")
  575.            a=ItemSelect("Select menu to edit",a," ")
  576.            terminate(a=="","Edit","No file selected")
  577.            ;it it already running???  Find it...
  578.            ErrorMode(@OFF)
  579.            terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
  580.            bak=strcat(FileRoot(a),".BAK")
  581.            FileCopy(a,bak,@FALSE)
  582.            run("notepad.exe",a)
  583.            drop(a,bak)
  584.  
  585.  Edit &INI files
  586.        DirChange(FilePath(FileLocate("WIN.INI")))
  587.        NotWin2 = strsub(";",1,(WinVersion(@MAJOR)==2))
  588.        a="WIN.INI"
  589.        execute %NotWin2% a=FileItemize("*.INI")
  590.        execute %NotWin2% a=ItemSelect("Select INI file to edit",a," ")
  591.        execute %NotWin2% terminate(a=="","Edit","No file selected")
  592.        drop(NotWin2,b)
  593.        ;it it already running???  Find it...
  594.        ErrorMode(@OFF)
  595.        terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
  596.        bak=strcat( FileRoot(a),".BAK")
  597.        FileCopy(a,bak,@FALSE);
  598.        run("notepad.exe",a)
  599.        drop(a,bak)
  600.  
  601.  Edit System Confi&guration
  602.            run("sysedit.exe","")  ;takes care of itself
  603.  
  604.  PIF Edi&t...
  605.     a=strsub(";",1,IsKeyDown(@SHIFT)==@NO)
  606.     execute %a% l=askline("PIF Edit","Enter file to edit",CurrentFile())
  607.     execute %a% run("pifedit.exe",l)
  608.     execute %a% exit
  609.     DirChange(FilePath(FileLocate("_default.pif")))
  610.     run("pifedit.exe","")
  611.     drop(a,b)
  612.  
  613.  
  614.  
  615.  
  616.     
  617.