home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / win / tools / fc30e / wwwmenus.wi_ < prev    next >
Text File  |  1994-10-12  |  32KB  |  849 lines

  1. ; WWWMENUS.DLL
  2. ; Common menus used by WWW Products
  3.  
  4.     CancelCmd="Exit"
  5.     goto %param1%        ; Go immediately to desired section
  6.                          ; Defined sections are:
  7.                               ZIP
  8.                               UNZIP
  9.                               SYSINFO
  10.                               INIEDIT
  11.                               FONEBOOK
  12.                               DIRSIZE
  13.                               FILEINFO
  14.                               FREESPACE
  15.                               CMDSTACK
  16.                               PROGBUILD
  17.                               WALLPAPER
  18. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  19. :WALLPAPER
  20.            a=strcat(CurrentPath(),CurrentFile()) ; Is a BMP file hilited?
  21.            if FileExtension(a)=="BMP" then goto walldoit
  22.            a=FileItemize("*.bmp")                ; No?  Any in Current Directory?
  23.            if a!="" then goto sel
  24.  
  25.            ; Hmmm cannot find any BMP in current dir.  Check INI/Prompt user for info
  26.            WallDir1=inireadpvt("wallpaper","WallPaperDir","ASK","WWW-PROD.INI")
  27.            :REASK
  28.            if WallDir1=="ASK" then WallDir=AskLine("WallPaper","What directory are your *.BMP WallPaper files in?",DirWindows(0))
  29.                               else WallDir=WallDir1
  30.            ErrorMode(@off)
  31.            DirChange(WallDir)
  32.            ErrorMode(@cancel)
  33.            a=FileItemize("*.BMP")
  34.            if a=="" then Message("WallPaper Error","No *.BMP files found in %WallDir%")
  35.                     then goto REASK
  36.            if WallDir!=WallDir1 then iniwritepvt("wallpaper","WallPaperDir",WallDir,"WWW-PROD.INI")
  37.  
  38.            :sel
  39.            a=strcat("-None- ",a)
  40.            a=ItemSelect("Select New Wallpaper",a," ")
  41.            terminate(a=="","Wallpaper","No wallpaper selected")
  42.            if a=="-None-" then Wallpaper("",0)
  43.                           then exit
  44.            a=strcat(DirGet(),a)
  45.            :walldoit
  46.            tile=@FALSE
  47.            if FileSize(a)<40000 then tile=@TRUE
  48.            ;if bmp size less than 40K, assume tile, else center
  49.            Wallpaper(a,tile)
  50.            drop(a,b,tile)
  51.            Exit
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. :PROGBUILD
  54.     ;Uses DDE to get ProgMan to divluge contents of groups and builds
  55.     ;CmdPost and File Commander menu items to match
  56.  
  57.     CancelCmd="goto cancelbuild"
  58.     startpm = 0
  59.     added=0
  60.  
  61.     OldWinTitle=WinName()
  62.     WinTitle("","Prog Build Initializing")
  63.     f=0
  64.     Pause("Progman Capture","This menu item will rebuild this menu file%cr%with the current contents of ProgMan groups.%cr%It does take a few minutes, so be patient.")
  65.     ProgWho=""
  66.     If stricmp("FileCmdr",param2)==0 then ProgWho="FC"
  67.                                      then OldWinTitle="File Manager"
  68.     If stricmp("CmdPost",param2)==0  then ProgWho="CP"
  69.     Terminate(ProgWho=="","ProgBuild Menu Error","Param2 not CP or FC")
  70.  
  71.     LSP=""
  72.     if ProgWho=="CP" then newcpm = "%HomeBase%cmdgroup.cpm"
  73.                      then LSP=" "
  74.     if ProgWho=="FC" then newcpm = "%HomeBase%wwwfc4.mnu"
  75.     n=FileLocate(newcpm)
  76.     if n=="" then newcpm=strcat(DirWindows(0),newcpm)
  77.              else newcpm=n
  78.  
  79.     channel = DDEInitiate("Progman", "Progman")
  80.     If channel != 0 Then Goto DDEOK
  81.     ; Hmmm DDE not working.  Check for Progman
  82.     If WinExist("Program Manager") then Goto TRY2
  83.     If !FileExist("progman.exe") then Message("ProgMan Capture","Cannot find PROGMAN.EXE")
  84.                                  then goto cancelbuild
  85.     RunHide("progman.exe", "")
  86.     startpm=1
  87.   :TRY2
  88.     channel = DDEInitiate("Progman", "Progman")
  89.     If channel == 0 Then Goto ddeerror
  90.   :DDEOK
  91.     groups = DDERequest(channel, "Groups")
  92.     If groups == "***NACK***" Then Goto ddeerror
  93.     groups = StrReplace(groups, cr, tab)
  94.     groups = ItemSort(groups, tab)
  95.     f = FileOpen(newcpm, "WRITE")
  96.     if ProgWho=="CP" then FileWrite(f,"&Groups")
  97.                      then FileWrite(f," Rebuild Menu from ProgMan Grps")
  98.                      then FileWrite(f,'        Call("%HomeBase%wwwmenus.wil","PROGBUILD %%IniSection%%")')
  99.     if ProgWho=="FC" then FileWrite(f,"Rebuild Menu from ProgMan Grps")
  100.                      then FileWrite(f,'        Call("%HomeBase%wwwmenus.wil","PROGBUILD %%IniSection%%")')
  101.     added=added+1
  102.     n = ItemCount(groups, tab)
  103.     i = 0
  104.  
  105.   :nextgroup
  106.     i = i + 1
  107.     j=0
  108.     o=0
  109.     group = strtrim(ItemExtract(i, groups, tab))
  110.     If group == "" Then Goto DODANEXTONE
  111.     If group=="Quick Access" then goto DODANEXTONE
  112.     
  113.     if ProgWho!="FC" then goto ADDIT7
  114.     items=AskYesNo("File Commander Grouper","Add %group% group?")
  115.     if items==@NO then goto DODANEXTONE   
  116.  
  117.     :ADDIT7
  118.     FirstItem=0
  119.     if i==1 then GroupTitle=strcat(LSP,"_",group)
  120.             then goto notfirstgrp
  121.  
  122.     if ((i mod 18) == 1) then GroupTitle=strcat(LSP,"|",group)
  123.                          else GroupTitle=strcat(LSP,group)
  124.  
  125.     :notfirstgrp
  126.     items = DDERequest(channel, group)
  127.     If items == "***NACK***" Then Goto DODANEXTONE
  128.     items = StrReplace(items, cr, tab)
  129.     items = ItemRemove(1, items, tab)
  130.     items = ItemSort(items, tab)
  131.  
  132.     o = ItemCount(items, tab)
  133.     j = 0
  134.   :nextitem
  135.     j = j + 1
  136.     item = ItemExtract(j, items, tab)
  137.     If item == "" Then Goto DODANEXTONE
  138.  
  139.     itemdesc = strtrim(ItemExtract(1, item, ","))
  140.     itemdesc = StrSub(itemdesc, 2, StrLen(itemdesc) - 2)
  141.  
  142.     itemprog = StrLower(strtrim(ItemExtract(2, item, ",")))
  143.     itemprog = StrSub(itemprog, 2, StrLen(itemprog) - 2)
  144.     WinTitle("",`<Group %group% %i%/%n% : Item %itemprog% %j%/%o%>`)
  145.     itemparms = ""
  146.     sp1 = StrIndex(itemprog, " ", 1, @FWDSCAN)
  147.     If sp1 == 0 Then Goto noparms
  148.     itemparms = StrSub(itemprog, sp1 + 1, StrLen(itemprog) - sp1)
  149.     itemprog = StrSub(itemprog, 1, sp1 - 1)
  150.     :noparms
  151.      
  152.     ;Filter out useless items here.  Datadiles, etc.
  153.     addx=strlower(FileExtension(itemprog))
  154.     
  155.     ; Try like heck to keep File Commander adds under the FC 99 limit per menu item
  156.     if addx=="exe" then goto additnow
  157.     if ProgWho=="FC" then goto DODANEXTONE
  158.     
  159.     
  160.     :additnow
  161.     itemdir = StrLower(strtrim(ItemExtract(3, item, ",")))
  162.  
  163.     ; Do HotKeys for CmdPost
  164.     hotkey = ""
  165.     if ProgWho!="CP" then goto nohotkey
  166.     itemkey = strtrim(ItemExtract(8, item, ","))
  167.     If itemkey == "0" Then Goto nohotkey
  168.     hotkey = " \ "
  169.     If itemkey & 1024 Then hotkey = StrCat(hotkey, "!")
  170.     If itemkey & 512 Then hotkey = StrCat(hotkey, "^")
  171.     If itemkey & 256 Then hotkey = StrCat(hotkey, "+")
  172.     hotkey = StrCat(hotkey, Num2Char(itemkey & 255))
  173.  
  174.     :nohotkey
  175.  
  176.     icon = ""
  177.     If strtrim(ItemExtract(9, item, ",")) == "1" Then icon = "Icon"
  178.  
  179.     if FirstItem==0 then FileWrite(f, GroupTitle)
  180.                     then FirstItem=1
  181.  
  182.     nit=""
  183.     if ( (j!=1) && ((j mod 15)==1)) then nit="|"
  184.     FileWrite(f, `%LSP% %nit%%itemdesc%%hotkey%`)
  185.     If itemdir != "" Then FileWrite(f, `       DirChange("%itemdir%")`)
  186.     FileWrite(f, `       Run%icon%("%itemprog%", "%itemparms%")`)
  187.     FileWrite(f, ``)
  188.     added=added+1
  189.  
  190.     :DODANEXTONE
  191.     if ProgWho=="FC" && added>97
  192.          Message("File Commander Grouper","Added 98 items, quitting now")
  193.          goto pbdone
  194.     endif
  195.     If j < o Then Goto nextitem
  196.     If i < n Then Goto nextgroup
  197.     Goto pbdone
  198.  
  199.     :error
  200.     Message("ProgMan Group Capture Error", "Operation unsuccessful")
  201.     Goto cancelbuild
  202.  
  203.     :ddeerror
  204.     Message("ProgMan Group Capture DDE Error", "Operation unsuccessful")
  205.     Goto cancelbuild
  206.  
  207.     :pbdone
  208.     Message("ProgMan Group Capture", "Processing complete%cr%Push OK and wait for menu reload.")
  209.  
  210.     :cancelbuild
  211.     if f!=0 then FileClose(f)
  212.     If IsDefined(channel) Then DDETerminate(channel)
  213.     If startpm == 1 Then WinClose("Program Manager")
  214.     WinTitle("",OldWinTitle)
  215.     Drop(newcpm, startpm, channel, f, i, j, n, o, groups, group, items, item)
  216.     Drop(itemdesc, itemprog, itemparms, itemdir, itemkey, hotkey, icon, sp1)
  217.     Drop(OldWinTitle,GroupTitle,FirstItem,added)
  218.     Reload()
  219.     Exit
  220. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  221. :CMDSTACK
  222.         ; CmdStack uses wierd variable names to reduce the chance that a user
  223.         ; will try to execute a statement using the same names!!
  224.         if !IsDefined(CMDSTK987Cmds) Then CMDSTK987Cmds=""
  225.         if !IsDefined(CMDSTK987Last) Then CMDSTK987Last="1+2+3"
  226.         goto %param2%
  227.  
  228.    :PREVIOUS
  229.         If CMDSTK987Cmds == "" Then Goto NEWCMD
  230.         CMDSTK987Now = TextSelect("Select a command, or OK to enter a new command", CMDSTK987Cmds, tab)
  231.         If CMDSTK987Now != "" Then Goto CMDDOIT
  232.    :NEWCMD
  233.         CMDSTK987Now = AskLine("WIL Interactive", "Command to execute:", CMDSTK987Last)
  234.         If CMDSTK987Now == "" Then Goto PREVIOUS
  235.    :CMDDOIT
  236.         Execute Message(CMDSTK987Now, %CMDSTK987Now%)
  237.         if ItemLocate(CMDSTK987Now,CMDSTK987Cmds,tab) then goto PREVIOUS
  238.         a=tab
  239.         if CMDSTK987Cmds=="" then a=""
  240.         CMDSTK987Cmds = StrCat(CMDSTK987Cmds, a, CMDSTK987Now)
  241.         CMDSTK987Last = CMDSTK987Now
  242.         Goto PREVIOUS
  243.  
  244.    :FLUSH
  245.       If AskYesNo("Flush WIL command stack", "Really?") Then CMDSTK987Cmds = ""
  246.       Exit
  247. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  248. :FREESPACE
  249.         Drives=DiskScan(2)     ; 2 is the code for local hard drives
  250.         Dmax=strlen(Drives)
  251.         DIndex=1
  252.         TotalSize=0
  253.         DriveReport=""
  254.  
  255.         :COUNTSPACE
  256.         NextDrive=StrSub(Drives,Dindex,1)
  257.         a=DiskFree(NextDrive)/1024
  258.         TotalSize=a+TotalSize
  259.         DriveReport=strcat(DriveReport,NextDrive," = ",TAB,a,"K",TAB,strfill("|",(a+500)/1000),"@")
  260.         DIndex=Dindex+3  ;each entry is 3 bytes long
  261.         if DIndex<=Dmax then goto COUNTSPACE
  262.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  263.         Drop(TotalSize,DriveReport,Drives,NextDrive)
  264.         Exit
  265. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  266. :FILEINFO
  267.         CancelCmd="goto cancelfi"
  268.         a=FileItemize("")
  269.         if a=="" then a=FileItemize("*.*")
  270.         tot=FileSize(a)
  271.         c=ItemCount(a," ")
  272.         n=0
  273.         b=""
  274.         :ffloop
  275.         if n==c then goto ffshow
  276.         n=n+1
  277.         a1=StrFix(ItemExtract(n,a," ")," ",14)
  278.         a2=FileSize(a1)
  279.         a3=FileTimeGet(a1)
  280.         a4=FileAttrGet(a1)
  281.         b=strcat(b,a1,tab,a2,tab,a3,tab,a4,"|")
  282.         goto ffloop
  283.         :ffshow
  284.         ItemSelect("Total Size=%tot%",b,"|")
  285.         :cancelfi
  286.         drop(a,tot,c,n,a1,a2,a3,a4,b)
  287.         Exit
  288. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  289. :DIRSIZE
  290.         tot = FileSize(FileItemize(""))
  291.         sub1 = DirItemize("")
  292.         if (tot==0 && sub1=="") then tot=FileSize(FileItemize("*.*"))
  293.                                 then sub1=DirItemize("*.*")
  294.         totdir=0
  295.         level=1
  296.         dir1=DirGet()
  297.         numdir1 = ItemCount(sub1, " ")
  298.         index1 = 0
  299.   
  300.         :dsloop
  301.         If index%level% == numdir%level% Then Goto upalevel
  302.         index%level% = index%level% + 1
  303.         DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
  304.         totdir=totdir+1
  305.         tot = tot + FileSize(FileItemize("*.*"))
  306.         level = level + 1
  307.         dir%level% = DirGet()
  308.         sub%level% = DirItemize("*.*")
  309.         numdir%level% = ItemCount(sub%level%, " ")
  310.         index%level% = 0
  311.         goto dsloop
  312.   
  313.         :upalevel
  314.         drop(dir%level%,sub%level%,index%level%,numdir%level%)
  315.         level=level-1
  316.         if level!=0 then goto dsloop
  317.  
  318.         ; -----------
  319.         ; Termination
  320.         ; -----------
  321.         If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
  322.         tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
  323.         tot = StrTrim(tot)
  324.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  325.         tot = StrTrim(tot)
  326.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  327.         tot = StrTrim(tot)
  328.         Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
  329.         drop(tot,level,totdir)
  330.         Exit
  331.  
  332. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  333. :FONEBOOK
  334.         ; This code implements a phone dialer with WIL language statements.
  335.         ; The phone numbers are kept in the FONEBOOK.TXT file.  It is simply a text
  336.         ; file with name followed by number.  This code assumes everything after the
  337.         ; last space is part of the phone number.
  338.  
  339.         ; The code also assumes that the COM port has been correctly set up in the
  340.         ; PORTS section of the control panel.  Mostly be sure the Control Panel
  341.         ; ports section has the right baud rate for your modem in it.
  342.  
  343.         ; User initialization section.  Set these to correspond to your modem commands.
  344.         ; Most users will only have to check the ComPort setting.
  345.  
  346.         CancelCmd="goto CancelFB"
  347.         FBCancelCmd="Exit"
  348.         ComPort=IniReadPvt("FileCmdr","PhonePort","ASK","WWW-PROD.INI")
  349.         OldFont=99
  350.         XPort=ComPort
  351.         if ComPort=="ASK" then XPort=AskLine("Phone Book","Enter modem COM port.%CR%If you have problems dialing, verify%CR%COM port setting in Windows Control Panel","COM1")
  352.         if XPort=="" then exit
  353.         if XPort!=ComPort then IniWritePvt("FileCmdr","PhonePort",Xport,"WWW-PROD.INI")
  354.                           then ComPort=XPort
  355.  
  356.         DialPrefix="ATDT"
  357.         HangCommand="ATH0"
  358.  
  359.         ; And here we go.  First make a CR/LF and a TAB
  360.         CR=strcat(num2char(13),num2char(10))
  361.         TAB=num2char(9)
  362.  
  363.         ; Use Home Directory
  364.         DirChange(DirHome())
  365.         ; Make sure there is a fonebook.txt file
  366.         if !FileExist("FONEBOOK.TXT") then fp=FileOpen("FONEBOOK.TXT","WRITE")
  367.                                       then FileWrite(fp,"Emergency Services      911")
  368.                                       then FileWrite(fp,"Directory Assistance    1-555-1212")
  369.                                       then FileClose(fp)
  370.  
  371.  
  372.         ; Put up the TextBox so the user can choose a number
  373.         :NewNum
  374.         FBCancelCmd="Exit"                   ; What to do if user hits "Cancel"
  375.         OldFont=IntControl(28,1,0,0,0)     ;Select fixed pitch font for textbox
  376.         num=StrTrim(TextBoxSort("DIALER - Just hit OK to add a new number","fonebook.txt"))
  377.         IntControl(28,OldFont,0,0,0)
  378.         if num!="" then goto zorkle
  379.  
  380.  
  381.  
  382.         num=strtrim(AskLine("DIALER","Enter name and number as in%CR%(Don't put any spaces in the number)","Joe Blough  1-555-1212"))
  383.         Terminate(num=="","","")
  384.         a=StrIndex(num," ",0,@BACKSCAN)
  385.         num2=strsub(num,a+1,strlen(num)-a)
  386.         num=strtrim(strsub(num,1,a-1))
  387.         num=strcat(strfix(num,' ',25),num2)
  388.         fp=FileOpen("temp876.num","WRITE")
  389.         FileWrite(fp,num)       ; send it the number to dial
  390.         FileClose(fp)
  391.         FileAppend("temp876.num","fonebook.txt")
  392.         FileDelete("temp876.num")
  393.         goto newnum
  394.  
  395.         :zorkle
  396.         a=StrIndex(num," ",0,@BACKSCAN)
  397.         b=Strindex(num,TAB,0,@BACKSCAN)
  398.         a=max(a,b)
  399.         num=strsub(num,a+1,strlen(num)-a)
  400.         DialCommand="%DialPrefix%%NUM%;"
  401.  
  402.  
  403.         :redial
  404.         fp=FileOpen(ComPort,"WRITE")
  405.         FileWrite(fp,"ATZ")        ; Send a CR to wake modem up
  406.         Delay(2)                   ; Let it get out of bed.
  407.         FileWrite(fp,DialCommand)
  408.         FileClose(fp)
  409.         Delay(3)                   ; Give modem a chance to think
  410.  
  411.         FBCancelCmd="Goto Hang1"
  412.         a=AskYesNo("Dialer","Yes=HANGUP%CR%No=REDIAL%CR%Cancel=New Number")
  413.  
  414.         fp=FileOpen(ComPort,"WRITE")
  415.         FileWrite(fp,HangCommand)
  416.         FileClose(fp)
  417.  
  418.         if a==@YES then exit
  419.         Display(30,"Dialer","Redial Wait")
  420.         goto redial
  421.  
  422.         :CANCELFB
  423.         if OldFont!=99 then IntControl(28,OldFont,0,0,0)
  424.         %FBCancelCmd%
  425.  
  426.         :Hang1
  427.         fp=FileOpen(ComPort,"WRITE")
  428.         FileWrite(fp,HangCommand)
  429.         FileClose(fp)
  430.         goto NewNum
  431. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  432. :INIEDIT
  433.         DirChange(DirWindows(0))
  434.         CancelCmd="goto BYEBYE"
  435.         IniFiles=""
  436.         bSys386=0
  437.  
  438.         :UP1
  439.         CancelCmd="goto byebye"
  440.         If IniFiles!="" then goto inied
  441.         IniFiles=FileItemize("*.INI")
  442.         :inied
  443.         ButtonNames("&Edit File","&Quit")
  444.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  445.         if TheFile=="" then goto newini
  446.         Sections=""
  447.  
  448.         :UP2
  449.         CancelCmd="goto up1"
  450.         if Sections!="" then goto sected
  451.         Sections=IniItemizePvt("",TheFile)
  452.         :SECTED
  453.         ButtonNames("&Edit Section","&Up a Level")
  454.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  455.         if Section=="" then goto AddSect
  456.         if stricmp(Section,"386Enh")==0 then bSys386=1
  457.                                         else bSys386=0
  458.         KeyValues=""
  459.  
  460.         :UP3
  461.         CancelCmd="goto up2"
  462.         if KeyValues!="" then goto looped
  463.         Keys=IniItemizePvt(Section,TheFile)
  464.         if (bSys386) then Keys=StrReplace(Keys,"device%TAB%","")
  465.                      then Keys=StrReplace(Keys,"Device%TAB%","")
  466.                      then Keys=StrReplace(Keys,"DEVICE%TAB%","")
  467.                      then Keys=StrReplace(Keys,"device","")
  468.                      then Keys=StrReplace(Keys,"Device","")
  469.                      then Keys=StrReplace(Keys,"DEVICE","")
  470.         KeyMax=ItemCount(Keys,TAB)
  471.         KeyIndex=0
  472.  
  473.         :ieLoop
  474.         if KeyIndex==KeyMax then goto looped
  475.         KeyIndex=KeyIndex+1
  476.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  477.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  478.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  479.         goto ieLoop
  480.  
  481.         :looped
  482.         ButtonNames("&Edit KeyWord","&Up a Level")
  483.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  484.         if Key=="" then goto AddKey
  485.         Key=ItemExtract(1,Key,"=")
  486.  
  487.         Value=IniReadPvt(Section,Key,"???",TheFile)
  488.         goto entkey
  489.  
  490.  
  491.         :newini
  492.         CancelCmd="goto UP1"
  493.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  494.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  495.         IniFiles=""
  496.         goto AddSectNewIni
  497.  
  498.         :AddSect
  499.         CancelCmd="goto up2"
  500.         :AddSectNewIni
  501.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  502.         Sections=""
  503.         goto AddKeyNewSect
  504.  
  505.         :AddKey
  506.         CancelCmd="goto up3"
  507.         :AddKeyNewSect
  508.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  509.         if (bSys386 && stricmp(Key,"device"==0)) then Message("Error","Cannot modify or add DEVICE= lines to [386Enh]%CR%with this utility")
  510.                                                  then goto AddKeyNewSect
  511.         Value="(Undefined)"
  512.         KeyValues=""
  513.         goto EntKeyNewKey
  514.  
  515.         :ENTKEY
  516.         CancelCmd="goto up3"
  517.         :EntKeyNewkey
  518.         NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  519.         if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  520.         KeyValues=""
  521.         goto up3
  522.  
  523.  
  524.         :BYEBYE
  525.         exit
  526. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  527. :SYSINFO
  528.         wintype="retail"
  529.         if WinMetrics(22) then wintype="debug"
  530.  
  531.         wcx=WinMetrics(-3)
  532.         math="Math"
  533.         switch wcx
  534.             case 0 ; Win16  Intel
  535.                 wc=WinConfig()
  536.                 if !(wc&1) then mode="Real"
  537.                 if wc&16 then mode="Standard"
  538.                 if wc&32 then mode="Enhanced"
  539.                 
  540.                 if wc&64 then cpu=8086
  541.                 if wc&128 then cpu=80186
  542.                 if wc&2 then cpu=286
  543.                 if wc&4 then cpu=386
  544.                 if wc&8 then cpu=486
  545.                 mode = strcat(cpu,' ',mode,' ',wintype,' Windows ')
  546.                 if !(wc&1024)  then math="No math"
  547.                 break
  548.                 
  549.             case 1 ; Win32 Intel
  550.                  mode="Intel 32-bit %wintype% Windows "
  551.                  break
  552.             case 2 ; Dec Alpha
  553.                  mode="DEC Alpha %wintype% Windows NT "
  554.                  break
  555.             case 3 ; MIPS
  556.                  mode="MIPS %wintype% Windows NT "
  557.                  break
  558.             case 4 ; PowerPC 
  559.                  mode="PowerPC %wintype% Windows NT "
  560.                  break
  561.             case wcx ; Unknown 
  562.                  mode="Advanced platform %wintype% Windows NT "
  563.                  break
  564.         endswitch
  565.                 Sysinfo=strcat(mode,WinVersion(1),'.',WinVersion(0),CR)
  566.         
  567.         
  568.         mouse="No Mouse"
  569.         if WinMetrics(19) then mouse="Mouse"
  570.  
  571.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',CR)
  572.  
  573.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",CR)
  574.  
  575.         ErrorMode(@OFF)
  576.         LastError()
  577.         PlayMedia("Status WaveForm Ready")
  578.         ErrorMode(@CANCEL)
  579.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)
  580.  
  581.         math=NetInfo(0)
  582.         if math=="MULTINET" then math=strcat(math,"/",NetInfo(1))
  583.         sysinfo=strcat(sysinfo,math,"Network installed.",CR) 
  584.  
  585.         bug=WinResources(0)/1024   ; Compute memory avail
  586.         math=strlen(bug)
  587.         if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  588.  
  589.         sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  590.         sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  591.  
  592.         sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),CR)
  593.         disks=DiskScan(1)
  594.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
  595.         disks=DiskScan(2)
  596.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
  597.         disks=DiskScan(4)
  598.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
  599.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
  600.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),CR)
  601.         sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())
  602.  
  603.         ver=Version()
  604.         Message("%Param2% %ver% SysInfo",Sysinfo)
  605.         Exit
  606.  
  607. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  608. :ZIP
  609. :UNZIP
  610.     CancelCommand="goto ZZCANCEL"
  611.     ErrMsg=""
  612.     If !FileExist("wwwdos.bat")   Then ErrMsg="WWWDOS.BAT   not found"
  613.     If !FileExist("wwwdosp.pif")  Then ErrMsg="WWWDOSP.PIF  not found"
  614.     If !FileExist("wwwdosc.pif")  Then ErrMsg="WWWDOSC.PIF  not found"
  615.     If !FileExist("wwwzipls.exe") Then ErrMsg="WWWZIPLS.EXE not found"
  616.     If !FileExist("pkzip.exe")    Then ErrMsg="PKZIP.EXE    not found"
  617.     If !FileExist("pkunzip.exe")  Then ErrMsg="PKUNZIP.EXE  not found"
  618.     If !FileExist("%HomeBase%browser.exe")  Then ErrMsg="%HomeBase%BROWSER.EXE  not found"
  619.     If ErrMsg!="" Then Goto ShowError
  620.  
  621.         goto %param1%2     ; must be ZIP or UNZIP
  622.  
  623. :ZIP2
  624.         DaMove=" -a "
  625.         DaDirs=""
  626.         DaWho="*.*"
  627.         DaZip=""
  628.         DaRefresh=0
  629.         DaTitle="Files"
  630.         param3=strlower(param3)
  631.         if param3=="move" then DaMove=" -m "
  632.         goto %param2%         ; Must be CURRENT, DIR, SUBDIR, or HILITED
  633.  
  634. :CURRENT
  635.         DaWho=strcat(CurrentPath(),CurrentFile())
  636.         DaZip=strcat(FileRoot(DaWho),".ZIP")
  637.         goto ZIPDO
  638. :SUBDIR
  639.        DaDirs=" -r -p "
  640.        DaRefresh=1
  641.        DaTitle="Structure"
  642.        goto ZIPDO
  643.  
  644. :HILITED
  645.         b=FileItemize("")
  646.         If b=="" Then ErrMsg="Zip Hilited files?  No files hilited!"
  647.                  Then Goto ShowError
  648.         b=strreplace(b," ",CR)
  649.         fp=FileOpen("FC-TEMP9.XCV","WRITE")
  650.         FileWrite(fp,b)
  651.         FileClose(fp)
  652.         Drop(b)
  653.         DaWho="@FC-TEMP9.XCV"
  654.         goto ZIPDO
  655.  
  656. :DIR
  657.        DaTitle="Directory"
  658.        goto ZIPDO
  659.  
  660. :ZIPDO
  661.         DaZip=AskLine("Zip %DaTitle%","Enter desired ZIP name",DaZip)
  662.         if DaZip=="" then goto zzcancel
  663.         Runwait("wwwdosc.pif","pkzip.exe %DaMove% %DaDirs% %DaZip% %DaWho%")
  664.         if DaWho=="FC-TEMP9.XCV" then FileDelete(DaWho)
  665.         Refresh(DaRefresh)
  666.         Display(3,"Zip %DaTitle%","Complete")
  667.         goto zzcancel
  668.  
  669. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  670. :UNZIP2
  671.  
  672.        ViewFlag=0
  673.        zipsort=param3
  674.        goto %param2%    ; must be ALL, VIEW, or INDIV
  675.  
  676. :ALL
  677.         zipfile=strcat(CurrentPath(),CurrentFile())
  678.         if FileExtension(zipfile)=="ZIP" then goto alldoit
  679.         zipfile=FileItemize("*.zip")
  680.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  681.                  Then Goto ShowError
  682.         zipfile=itemselect("Select file to UnZip",zipfile," ")
  683.         if zipfile=="" then goto zzcancel
  684. :alldoit
  685.         if param3==2 then goto allspec
  686.         runwait("wwwdosc.pif","pkunzip.exe -d %zipfile%")
  687.         Refresh(1)
  688.         goto zzcancel
  689.  
  690. :allspec
  691.         RetHome="allspec1"
  692.         goto DoOptions
  693. :allspec1
  694.         if overwarn==0 then overwarn=" -o "
  695.                        else overwarn=""
  696.         RunWait("wwwdosc.pif", "pkunzip.exe -d %overwarn% %zipfile% %targdir% *.*")
  697.         Refresh(1)
  698.         goto zzcancel
  699.  
  700.  
  701.  
  702. :INDIV
  703.        ViewFlag=param3
  704.        if ViewFlag==1 then zipsort=1
  705.                       then overwarn=0
  706.                       then targdir=""
  707.                       then goto VIEW
  708.  
  709.         RetHome="VIEW"
  710.         goto DoOptions
  711.  
  712. :VIEW
  713.         workdir = Environment("TEMP")
  714.         If workdir == "" Then workdir = DirWindows(0)
  715.         If StrSub(workdir, StrLen(workdir), 1) != "\" Then workdir = StrCat(workdir, "\")
  716.         if ViewFlag==0 then targdir=workdir
  717.         zipfile=strcat(CurrentPath(),CurrentFile())
  718.         if FileExtension(zipfile)=="ZIP" then goto viewdoit
  719.         zipfile=FileItemize("*.zip")
  720.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  721.                  Then Goto ShowError
  722.         if ViewFlag==0 then TSMsg="Select ZIP file to view"
  723.                        else TSMsg="Select ZIP file to use"
  724.         zipfile=itemselect(TSMsg,zipfile," ")
  725.         if zipfile=="" then goto zzcancel
  726.  
  727. :viewdoit
  728.         ziplist = StrCat(workdir, "wwwunzip.lst")
  729.         If FileExist(ziplist) Then FileDelete(ziplist)
  730.  
  731.         RunWait("wwwzipls.exe","%zipfile% %ziplist% %zipsort%")
  732.         if ViewFlag==0 then TSMsg="Select file to view"
  733.                        else TSMsg="Select file to extract"
  734. :TXSEL
  735.         OldFont=IntControl(28,1,0,0,0)        ; Set fixed pitch font in text box
  736.         member=TextBox(TSMsg,ziplist)
  737.         IntControl(28,OldFont,0,0,0)          ; Restore previous font pitch type
  738.         if member=="" then goto ZZCANCEL
  739.  
  740.         member=strsub(member,46,strlen(member)-45)
  741.         memfile=FileExtension(member)
  742.         if memfile!="" then memfile=strcat(FileRoot(member),".",memfile)
  743.                        else memfile=FileRoot(member)
  744.         
  745.  
  746.         if ViewFlag==0 then goto extract
  747.         if overwarn==0 then goto extract
  748.         If FileExist("%targdir%%memfile%") == @FALSE Then Goto extract
  749.         b= AskYesNo("%member% already exists in %targdir%", "Do you wish to replace it?")
  750.         If b == @NO Then Goto TXSEL
  751.  
  752. :extract
  753.         RunHideWait("wwwdosc.pif", "pkunzip.exe -o %zipfile% %targdir% %member%")
  754.         If !FileExist("%targdir%%memfile%") Then ErrMsg="Problem extracting %member% from ZIP file"
  755.                                            Then Goto ShowError
  756.  
  757.         if ViewFlag!=0 then TSMsg="Extract Another?"
  758.                        then goto TXSEL
  759.         member = StrUpper(StrCat(targdir, memfile))
  760.         RunZoomWait("%HomeBase%browser.exe", member)
  761.         FileDelete(member)
  762.         TSMsg="View Another?"
  763.         goto TXSEL
  764.  
  765.  
  766. :SHOWERROR
  767.     Message("Error", ErrMsg)
  768.  
  769. :ZZCANCEL
  770.     if IsDefined(ziplist) then If FileExist(ziplist) Then FileDelete(ziplist)
  771.     Drop(DaMove,DaDirs,DaWho,DaZip,DaRefresh,DaTitle,ViewFlag,zipsort)
  772.     Drop(zipfile,b,RetHome,overwarn,targdir,workdir,ziplist,TSMsg,member)
  773.     Drop(ErrMsg,usecurdir,ThisDir,CheckDir,memfile)
  774.     Drop(ZippyFormat,ZippyCaption,ZippyX,ZippyY,ZippyWidth,ZippyHeight)
  775.     Drop(ZippyNumControls,Zippy01,Zippy02,Zippy03,Zippy04,Zippy05,Zippy06)
  776.     Drop(Zippy07,Zippy08,Zippy09,Zippy10,Zippy11,Zippy12,Zippy13)
  777.     exit
  778. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  779.  
  780. :DOOPTIONS
  781.         zipsort = IniReadPvt("WWWUNZIP", "SortOrder", 1, "www-prod.ini")
  782.         overwarn=IniReadPvt("WWWUNZIP","OverWarn",1,"www-prod.ini")
  783.         whichdir=IniReadPvt("WWWUNZIP","WhichDir",1,"www-prod.ini")
  784.  
  785.  
  786.  
  787.         ZippyFormat=`WWWDLGED,4.0`
  788.  
  789.         ZippyCaption=`Zip Options`
  790.         ZippyX=-1
  791.         ZippyY=-1
  792.         ZippyWidth=217
  793.         ZippyHeight=115
  794.         ZippyNumControls=13
  795.         Zippy01=`6,18,80,DEFAULT,RADIOBUTTON,whichdir,"Use Current Dir ->",1`
  796.         Zippy02=`6,32,80,DEFAULT,RADIOBUTTON,whichdir,"Use Specified Dir ->",2`
  797.         Zippy03=`86,32,124,DEFAULT,EDITBOX,targdir,""`
  798.         Zippy04=`16,64,56,DEFAULT,RADIOBUTTON,zipsort,"by Name",1`
  799.         Zippy05=`16,76,58,DEFAULT,RADIOBUTTON,zipsort,"by Extension",2`
  800.         Zippy06=`16,88,46,DEFAULT,RADIOBUTTON,zipsort,"by Date",3`
  801.         Zippy07=`16,100,46,DEFAULT,RADIOBUTTON,zipsort,"by Size",4`
  802.         Zippy08=`108,58,80,DEFAULT,CHECKBOX,overwarn,"Warn on Overwrite",1`
  803.  
  804.         Zippy09=`120,78,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  805.         Zippy10=`120,98,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
  806.         Zippy11=`6,4,64,DEFAULT,STATICTEXT,NONAME,"Target Directory"`
  807.         Zippy12=`6,52,64,DEFAULT,STATICTEXT,NONAME,"Sort list by:"`
  808.         Zippy13=`88,20,122,DEFAULT,VARYTEXT,ThisDir,""`
  809.  
  810.  
  811. :gettarg
  812.         ThisDir=DirGet()
  813.         targdir = IniReadPvt("WWWUNZIP", "TargetDir", DirGet(), "www-prod.ini")
  814.         Dialog("Zippy")
  815.  
  816.         if whichdir==1 then usecurdir = @YES
  817.                        then targdir=ThisDir
  818.                        else usecurdir = @NO
  819.         targdir = StrUpper(targdir)
  820.         If targdir == "" Then usecurdir = @YES
  821.                          Then targdir = DirGet()
  822.         If StrSub(targdir, StrLen(targdir), 1) != "\" Then targdir = StrCat(targdir, "\")
  823.         If ThisDir==targdir then usecurdir = @YES
  824.                             then goto targok
  825.         DirChange(targdir)
  826.         CheckDir=DirGet()
  827.         DirChange(ThisDir)
  828.         If ThisDir!=CheckDir Then Goto targok
  829.  
  830.         b= AskYesNo("WWWUNZIP", "%targdir% does not exist.  Do you wish to create it?")
  831.         If b == @NO Then Goto gettarg
  832.         DirMake(targdir)
  833.         DirChange(targdir)
  834.         CheckDir=DirGet()
  835.         DirChange(ThisDir)
  836.         If ThisDir!=CheckDir Then Goto targok
  837.         Message("WWWUNZIP","%targdir% could not be created.  Please respecify.")
  838.         goto gettarg
  839.  
  840.         :targok
  841.         If usecurdir == @NO Then IniWritePvt("WWWUNZIP", "TargetDir", targdir, "www-prod.ini")
  842.         IniWritePvt("WWWUNZIP", "SortOrder", zipsort, "www-prod.ini")
  843.         IniWritePvt("WWWUNZIP", "OverWarn", overwarn, "www-prod.ini")
  844.         IniWritePvt("WWWUNZIP", "WhichDir", whichdir, "www-prod.ini")
  845.         goto %RetHome%
  846. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  847. :CANCEL        ; This cancel is shared by ALL the above routines.
  848. %CancelCmd%    ; Execute Cancel Command
  849.