home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / MAJ / 1513 / WINEDIT.MN_ < prev    next >
Text File  |  1993-10-07  |  15KB  |  425 lines

  1. ; AutoExec Section is on top here.  Actually runs before file manager
  2. ; appears on the screen
  3. ;
  4.         TAB=num2char(9)
  5.         CR=strcat(num2char(13),num2char(10))
  6.         Home=DirHome()
  7.  
  8. Edit Utility Menu   ; Manage WinEdit Utility menu and help files
  9.         TheFile=strcat(DirHome(),"WINEDIT.MNU")
  10.         WFileOpen(TheFile)
  11.         Drop(TheFile)
  12.  
  13. Edit Macro Menu   ; Manage WinEdit Macro menu
  14.         ; In the lite and standard versions of WinEdit,
  15.         ; the MACRO.ENC file is not editable.
  16.         ; In the Pro version, the file MACRO.MNU is used
  17.         ; and it can be edited.
  18.         level=2
  19.         a = FileLocate("WINEDIT.INI")
  20.         if FileExist(a) then level=IniReadPvt("WINEDIT","LEVEL","2",a)
  21.         if (level < 2) then Message("Edit Macro Menu","The Macro Menu cannot be edited in the Lite or Standard versions of WinEdit")
  22.         if (level < 2) then exit
  23.         ; else we can edit it
  24.         TheFile=strcat(DirHome(),"MACRO.MNU")
  25.         WFileOpen(TheFile)
  26.         Drop(TheFile)
  27.  
  28. _Key Word Help      \ +{F1}         ; Load help topic for word at cursor
  29.         call("wwwedit.dll","KEYWORDHELP")
  30.  
  31. Load Help File                    ; Load a help file (no keyword lookup)
  32.         TheFile=strcat(DirHome(),"HELP\WEHELP.INI")
  33.         Keys=IniItemizePvt("HelpAll",TheFile)
  34.         KeyMax=ItemCount(Keys,TAB)
  35.         KeyIndex=0
  36.         KeyValues=""
  37.  
  38.         :ieLoop
  39.         if KeyIndex==KeyMax then goto looped
  40.         KeyIndex=KeyIndex+1
  41.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  42.         if (stricmp(ThisKey,"DEFAULT")==0) then goto ieloop
  43.         ThisValue=IniReadPvt("HelpAll",ThisKey,"???",TheFile)
  44.         KeyValues=strcat(KeyValues,ThisValue,"|")
  45.         goto ieLoop
  46.         
  47.         :looped
  48.         a=ItemSelect("Select Help File",strlower(KeyValues),"|")
  49.         if a=="" then goto DONE
  50.         b = FileLocate(strcat(DirHome(),"HELP\%a%"))
  51.         if b=="" then b=FileLocate(a)
  52.         if b=="" then Message("Helpfile %a% not found","Edit %TheFile%%CR%[HelpAll] section to%CR%point to help file location%CR%or put helpfile on DOS path.")
  53.                  else WinHelp(b,"CONTENTS","")
  54.         :DONE
  55.         Drop(TheFile,Keys,KeyMax,KeyIndex,KeyValues,ThisKey,ThisValue,a,b)
  56.  
  57. Open highlighted file           ; Open highlighted file
  58.         name = wEdGetWord()
  59.         length = strlen(name)
  60.         if length==0 then goto DONE
  61.         b = FileLocate(name)
  62.         if b == "" then Message("Open highlighted file","Cannot find %name%")
  63.         if b == "" then goto DONE
  64.         wFileOpen(b)
  65.         :DONE
  66.         drop(name,length)
  67.  
  68. Generate C Tags                   ; Index source files
  69.         ; uses the TAGS.EXE program to generate WINEDIT.MRK file
  70.         ; that the next function uses to look up function names
  71.         ; in your source
  72.         RunWait("TAGS.EXE","-om -tWINEDIT.MRK *.c")
  73.         Message("Tags","Processing complete")
  74.  
  75. Go to tag                         ; Jump to function definition
  76.         ; looks up the current word in WINEDIT.MRK, loads the file,
  77.         ; and moves the cursor to the correct line
  78.         DEBUG(1)
  79.         goto START
  80.         :GETWORD
  81.         a = AskLine("Go to tag", "Enter function definition to jump to:", "")
  82.         strupper(a)
  83.         len = strlen(a)
  84.         if len==0 then goto NOWORD
  85.         goto START2
  86.         :START
  87.         a=WEdGetWord()
  88.         strupper(a)
  89.         len = strlen(a)
  90.         if len==0 then goto GETWORD
  91.         :START2
  92.         b=FileLocate("winedit.mrk")
  93.         WFileOpen(b)
  94.         WFind(a,@TRUE,@FALSE)
  95.         WEdHome()
  96.         WEdStartSel()
  97.         WEdEnd()
  98.         WEdEndSel()
  99.         WEdCopy()
  100.         WWinClose()
  101.         line=ClipGet()
  102.         line2=strupper(line)
  103.         c=StrIndex(line2,a,0,@FWDSCAN)
  104.         d=StrIndex(line2," ",c,@FWDSCAN)
  105.         e=StrIndex(line2,"(",d,@FWDSCAN)
  106.         filename=StrSub(line2,d,e-d)
  107.         lineno=StrSub(line2,e+1,strlen(line2)-e-1)
  108.         WFileOpen(filename)
  109.         WEdGoToLine(lineno)
  110.         WEdHome()
  111.         Drop(len,b,line,line2,c,d,e,filename,lineno)
  112.         :NOWORD
  113.         Drop(a)
  114.  
  115.  
  116. Grep    \      ^G             ; Run fgrep
  117.         GrepWord = wEdGetWord()         ; Get Selected word if any
  118.         command = AskLine("Grep","Enter the grep commmand to run:","tee.com fgrep -M %GrepWord% *.c")
  119.         wRunCommand(command,@TRUE,@TRUE)
  120.         Drop(command,GrepWord);
  121.  
  122. &Version Control          ; PVCS commands
  123.  &Get a file (w/lock)
  124.         a = AskLine("PVCS Get (w/lock) Command", "Enter file you want to lock:", "")
  125.         b=strcat("tee get -L ",a)
  126.         wRunCommand(b,@TRUE,@TRUE)
  127.         Drop(b)
  128.         b=FileLocate(a)
  129.         if b=="" then goto NotFound
  130.           WFileOpen(b)
  131.           goto DONE
  132.         :NotFound
  133.           Message("???", "%a% not found...")
  134.           goto Done
  135.         :DONE
  136.         Drop(a)
  137.         Drop(b)
  138.  
  139.  &Put a file back (unlock)
  140.         a = AskLine("PVCS Put (unlock) Command", "Enter file you want to put back:", "")
  141.         a=strcat("tee put ",a)
  142.         wRunCommand(a,@TRUE,@TRUE)
  143.         Drop(a)
  144.  
  145.  &Enter any PVCS command
  146.         a = AskLine("PVCS Command", "Enter PVCS command:", "")
  147.         a=strcat("tee ",a)
  148.         wRunCommand(a,@TRUE,@TRUE)
  149.         Drop(a)
  150.  
  151.  &Logfile Info (locked)
  152.         a = AskLine("PVCS Logfile Command", "Enter file for which you want logfile info:", "")
  153.         a=strcat("tee vlog -BL ",a)
  154.         wRunCommand(a,@TRUE,@TRUE)
  155.         Drop(a)
  156.  
  157.  &Update all source files
  158.         wRunCommand("tee get -u *.??v",@TRUE,@TRUE)
  159.  
  160. Utilities      ;      Select from list of utilities
  161.  &Freespace on Local Drives   ; Display free disk space on drives
  162.  
  163.         Drive=DiskScan(2)     ; 2 is the code for local hard drives
  164.         Dmax=strlen(Drive)
  165.         DIndex=1
  166.         TotalSize=0
  167.         DriveReport=""
  168.  
  169.         :COUNTSPACE
  170.         NextDrive=StrSub(Drive,Dindex,1)
  171.         a=DiskFree(NextDrive)/1024
  172.         TotalSize=a+TotalSize
  173.         DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
  174.         DIndex=Dindex+3  ;each entry is 3 bytes long
  175.         if DIndex<=Dmax then goto COUNTSPACE
  176.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  177.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  178.  
  179.  &Wallpaper                   ; Change the desktop wallpaper
  180.            DirChange(dirWindows(0))
  181.            a=FileItemize("*.BMP")
  182.            a=strcat("-None- ",a)
  183.            a=ItemSelect("Select New Wallpaper",a," ")
  184.            terminate(a=="","Wallpaper","No wallpaper selected")
  185.            if a=="-None-" then Wallpaper("",0)
  186.            if a=="-None-" then exit
  187.            tile=@FALSE
  188.            if FileSize(a)<40000 then tile=@TRUE  
  189.            ;if bmp size less than 40K, assume tile, else center
  190.            Wallpaper(a,tile)
  191.            drop(a,b,tile)
  192.  Edit &INI files              ; Assisted editing of INI files
  193.         DirChange(DirWindows(0))
  194.         canned="BYEBYE"
  195.         IniFiles=""
  196.  
  197.         :UP1
  198.         canned="byebye"
  199.         If IniFiles!="" then goto inied
  200.         IniFiles=FileItemize("*.INI")
  201.         :inied
  202.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  203.         if TheFile=="" then goto newini
  204.         Sections=""
  205.  
  206.         :UP2
  207.         canned="up1"
  208.         if Sections!="" then goto sected
  209.         Sections=IniItemizePvt("",TheFile)
  210.         :SECTED
  211.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  212.         if Section=="" then goto AddSect
  213.         KeyValues=""
  214.  
  215.         :UP3
  216.         canned="up2"
  217.         if KeyValues!="" then goto looped
  218.         Keys=IniItemizePvt(Section,TheFile)
  219.         KeyMax=ItemCount(Keys,TAB)
  220.         KeyIndex=0
  221.  
  222.         :Loop
  223.         if KeyIndex==KeyMax then goto looped
  224.         KeyIndex=KeyIndex+1
  225.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  226.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  227.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  228.         goto Loop
  229.  
  230.         :looped
  231.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  232.         if Key=="" then goto AddKey
  233.         Key=ItemExtract(1,Key,"=")
  234.  
  235.         Value=IniReadPvt(Section,Key,"???",TheFile)
  236.         goto entkey
  237.  
  238.  
  239.         :newini
  240.         canned="UP1"
  241.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  242.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  243.         IniFIles=""
  244.         goto AddSectNewIni
  245.  
  246.         :AddSect
  247.         canned="up2"
  248.         :AddSectNewIni
  249.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  250.         Sections=""
  251.         goto AddKeyNewSect
  252.  
  253.         :AddKey
  254.         canned="up3"
  255.         :AddKeyNewSect
  256.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  257.         Value="(Undefined)"
  258.         KeyValues=""
  259.         goto EntKeyNewKey
  260.  
  261.         :ENTKEY
  262.         canned="up3"
  263.         :EntKeyNewkey
  264.         NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  265.         if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  266.         KeyValues=""
  267.         goto up3
  268.  
  269.         :CANCEL
  270.         goto %Canned%
  271.  
  272.         :BYEBYE
  273.         exit
  274.  
  275.  Paste Special Characters             ; Paste high ASCII characters to clipboard or document
  276.   Copy &FormFeed to Clipboard
  277.        Clipput(Num2char(12))
  278.   Copy &Special Characters to Document
  279.        a=" í| ó| ú| ñ| Ñ| ª| º| ¿| ⌐| ¬|"       ;161 thru 170
  280.        b=" ½| ¼| ¡| «| »| ░| ▒| ▓| │| ┤|"       ;171 thru 180
  281.        c=" ╡| ╢| ╖| ╕| ╣| ║| ╗| ╝| ╜| ╛|"       ;181 thru 190
  282.        d=" ┐| └| ┴| ┬| ├| ─| ┼| ╞| ╟| ╚|"       ;191 thru 200
  283.        e=" ╔| ╩| ╦| ╠| ═| ╬| ╧| ╨| ╤| ╥|"       ;201 thru 210
  284.        f=" ╙| ╘| ╒| ╓| ╫| ╪| ┘| ┌| █| ▄|"       ;211 thru 220
  285.        g=" ▌| ▐| ▀| α| ß| Γ| π| Σ| σ| µ|"       ;221 thru 230
  286.        h=" τ| Φ| Θ| Ω| δ| ∞| φ| ε| ∩| ≡|"       ;231 thru 240
  287.        i=" ±| ≥| ≤| ⌠| ⌡| ÷| ≈| °| ∙| ·|"       ;241 thru 250
  288.        j=" √| ⁿ| ²| ■|  "                       ;251 thru 255
  289.        a=strcat(a,b,c,d,e,f,g,h,i,j)
  290.        Drop(b,c,d,e,f,g,h,i,j)
  291.        a=ItemSelect("Choose a character",a,"|")
  292.        a=strsub(a,2,1)
  293.        wEdInsString(a)
  294.        Drop(a)
  295.  
  296.  
  297. Accessories
  298.  Appointment   Scheduling
  299.            run("Calendar.exe","")
  300.  Calculator
  301.            run("calc.exe","")
  302.  
  303.  C&lipboard
  304.         errormode(@off)
  305.         terminate(winactivate("Clipboard"),"","") ;Already Running
  306.         errormode(@cancel)
  307.         run("Clipbrd.exe","")
  308.  
  309.  Clock
  310.         run("clock.exe","")
  311.  
  312.  Control &Panel
  313.         errormode(@off)
  314.         terminate(winactivate("Control Panel"),"","")
  315.         errormode(@cancel)
  316.         run("control.exe","")
  317.  Cardfile
  318.            run("cardfile.exe","")
  319.  
  320.  Notepad Editor
  321.            run("notepad.exe","")
  322.  
  323.  Paint
  324.            run("pbrush.exe","")
  325.  
  326.  Write
  327.            run("write.exe","")
  328.  
  329.  Run System Confi&guration Editor
  330.            run("sysedit.exe","")  ;takes care of itself
  331.  
  332.  Run W&indows Program
  333.          TheFile=Askline("Run a Window Program","Enter Windows program:","")
  334.          run(Thefile,"")  ;takes care of itself
  335.  
  336.  Run Windows Setup
  337.         DirChange(DirWindows(0))
  338.         run("setup.exe","")
  339.         drop(a)
  340.  
  341.  _PIF Edi&t...
  342.         DirChange(FilePath(FileLocate("_default.pif")))
  343.         a=FileItemize("*.PIF")
  344.         if a==""  then DirChange(FilePath(FileLocate("_default.pif")))
  345.         if a=="" then a=FileItemize("*.PIF")
  346.         a=ItemSelect("Choose a PIF File to edit",a," ")
  347.         run("pifedit.exe",a)
  348.         exit
  349. _&System Information
  350.        wintype="retail"
  351.        if WinMetrics(22) then wintype="debug"
  352.  
  353.         wc=WinConfig()
  354.         if !(wc&1) then mode="Real"
  355.         if wc&16 then mode="Standard"
  356.         if wc&32 then mode="Enhanced"
  357.  
  358.         if wc&2 then cpu=286
  359.         if wc&4 then cpu=386
  360.         if wc&8 then cpu=486
  361.         if wc&64 then cpu=8086
  362.         if wc&128 then cpu=80186
  363.  
  364.         Sysinfo=strcat(cpu,' ',mode,' ',wintype,' Windows ',WinVersion(1),'.',WinVersion(0),CR)
  365.  
  366.         math="No math"
  367.         if wc&1024 then math="Math"
  368.         mouse="No Mouse"
  369.         if WinMetrics(19) then mouse="Mouse"
  370.  
  371.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',CR)
  372.  
  373.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",CR)
  374.  
  375.         ErrorMode(@OFF)
  376.         LastError()
  377.         PlayMedia("Status WaveForm Ready")
  378.         ErrorMode(@CANCEL)
  379.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)
  380.  
  381.         bug=NetGetCaps(2)
  382.         if bug==0 then math="No n"
  383.         if bug!=0 then math="N"
  384.         if bug==256 then math="Microsoft n"
  385.         if bug==512 then math="Lan Manager n"
  386.         if bug==768 then math="Novell NetWare n"
  387.         if bug==1024 then math="Banyan Vines n"
  388.         if bug==1280 then math="10 Net n"
  389.         sysinfo=strcat(sysinfo,math,"etwork installed.",CR)
  390.  
  391.         bug=WinResources(0)/1024   ; Compute memory avail
  392.         math=strlen(bug)
  393.         if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  394.  
  395.         sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  396.         sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  397.  
  398.         sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),CR)
  399.         disks=DiskScan(1)
  400.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
  401.         disks=DiskScan(2)
  402.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
  403.         disks=DiskScan(4)
  404.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
  405.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
  406.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),CR)
  407.         sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())
  408.  
  409.         ver=Version()
  410.         Message("WinEdit %ver% SysInfo",Sysinfo)
  411.  
  412. Interactive Execution
  413.           if !IsDefined(uyit65) then uyit65="Message( , )"
  414.           :NEXT
  415.           uyit65=AskLine("Interactive Execution","Enter Command",uyit65)
  416.           execute %uyit65%
  417.           goto NEXT
  418.           
  419. _Run a WIL Script File
  420.          if wGetModified()==@TRUE then wFileSave()
  421.          TheFile = WGetFileName()
  422.          Call(TheFile,"")
  423.  
  424.         
  425.