home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 February / PCWorld_1999-02_cd.bin / software / Zkuste / WinBat98 / WWW95.WI_ < prev    next >
Text File  |  1997-08-06  |  23KB  |  674 lines

  1. ; WWWMENUS
  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.                   FREESPACE2 (New Graphical version)
  16.                   CMDSTACK
  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. :CMDSTACK
  54.     ; CmdStack uses wierd variable names to reduce the chance that a user
  55.     ; will try to execute a statement using the same names!!
  56.     if !IsDefined(CMDSTK987Cmds) Then CMDSTK987Cmds=""
  57.     if !IsDefined(CMDSTK987Last) Then CMDSTK987Last="1+2+3"
  58.     goto %param2%
  59.  
  60.    :PREVIOUS
  61.     If CMDSTK987Cmds == "" Then Goto NEWCMD
  62.     CMDSTK987Now = TextSelect("Select a command, or OK to enter a new command", CMDSTK987Cmds, @tab)
  63.     If CMDSTK987Now != "" Then Goto CMDDOIT
  64.    :NEWCMD
  65.     CMDSTK987Now = AskLine("WIL Interactive", "Command to execute:", CMDSTK987Last)
  66.     If CMDSTK987Now == "" Then Goto PREVIOUS
  67.    :CMDDOIT
  68.     Execute Message(CMDSTK987Now, %CMDSTK987Now%)
  69.     if ItemLocate(CMDSTK987Now,CMDSTK987Cmds,@tab) then goto PREVIOUS
  70.     a=@tab
  71.     if CMDSTK987Cmds=="" then a=""
  72.     CMDSTK987Cmds = StrCat(CMDSTK987Cmds, a, CMDSTK987Now)
  73.     CMDSTK987Last = CMDSTK987Now
  74.     Goto PREVIOUS
  75.  
  76.    :FLUSH
  77.       If AskYesNo("Flush WIL command stack", "Really?") Then CMDSTK987Cmds = ""
  78.       Exit
  79. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  80. :FREESPACE
  81.     Drives=DiskScan(2)     ; 2 is the code for local hard drives
  82.     Dmax=strlen(Drives)
  83.     DIndex=1
  84.     TotalSize=0
  85.     DriveReport=""
  86.     madmax=0
  87.     :COUNTSPACE
  88.     NextDrive=StrSub(Drives,Dindex,1)
  89.     a=DiskFree(NextDrive)/1024
  90.     TotalSize=a+TotalSize
  91.     DriveReport=strcat(DriveReport,NextDrive," = ",@tab,a,"K","@")
  92.     DIndex=Dindex+3     ;each entry is 3 bytes long
  93.     if DIndex<=Dmax then goto COUNTSPACE
  94.     ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  95.     Drop(TotalSize,DriveReport,Drives,NextDrive)
  96.     Exit
  97. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  98. :FREESPACE2
  99.  
  100. inifile="www-prod.ini"
  101. inisection="DskSpace"
  102. Sort=inireadpvt(inisection,"Sort",1,inifile)  
  103. LTGRAY="192,192,192"  
  104. GRAY="128,128,128"  
  105. DKGRAY="64,64,64"  
  106. GREEN="0,255,0"  
  107. PURPLE="255,0,255"  
  108. BLACK="0,0,0"  
  109. WHITE="255,255,255"
  110. BLUE="0,0,128"  
  111. ErrorMode(@off)
  112. D3COLORX=RegQueryValue(@REGCURRENT,"Control Panel\colors[ButtonFace]")
  113. ErrorMode(@cancel)
  114. if D3COLORX!=0 then D3COLOR=D3COLORX
  115. else  D3COLOR="192,192,192"
  116.  
  117. ;Debug(1)
  118.  
  119. ;Changed to IntControl(29)
  120. IntControl(29,@tab,0,0,0) ;Standardize on tabs so code runs in 16 and 32 bit  
  121. BoxesUp("100,100,900,900",@Normal)  
  122. Boxcolor(1,"192,192,192",4)  
  123. boxdrawrect(1,"0,0,1000,1000",1)
  124.  
  125. ;Initializing NoteId Box
  126. Noteid=4  
  127. rectNote="50,800,490,890"  
  128. BoxNew(Noteid,rectNote,1)
  129.  
  130.  
  131. BoxButtonDraw(1,1,"Alphabet","50,900,190,970")
  132. BoxButtonDraw(1,2,"FreeSpace","200,900,340,970")
  133. BoxButtonDraw(1,3,"TotalSize","350,900,490,970")  
  134. BoxButtonDraw(1,4,"Exit","800,800,950,970")
  135. NoteHeight=400  
  136. rectNoteText="50,200,950,800"  
  137. rectnoteline1="0,0,1000,0"  
  138. rectNoteline2="1000,1000,1000,0"  
  139. rectNoteLine3="0,1000,1000,1000"  
  140. rectNoteLine4="0,0,0,1000"  
  141. notepenwidth=20  
  142. rectnoteline1b="40,150,960,150"  
  143. rectNoteline2b="960,840,960,150"  
  144. rectNoteLine3b="40,840,960,840"  
  145. rectNoteLine4b="40,150,40,840"  
  146. notepenwidthb=10  
  147. BoxColor(Noteid,D3COLOR,0)         
  148. BoxDrawRect(Noteid,"",2)  
  149. BoxPen(Noteid,WHITE,notepenwidth)  
  150. boxdrawline(Noteid,rectNoteLine1)  
  151. boxdrawline(Noteid,rectNoteLine4)  
  152. BoxPen(Noteid,GRAY,notepenwidth)  
  153. boxdrawline(Noteid,rectNoteLine2)  
  154. boxdrawline(Noteid,rectNoteLine3)  
  155. BoxPen(Noteid,WHITE,notepenwidthb)  
  156. boxdrawline(Noteid,rectNoteLine2b)  
  157. boxdrawline(Noteid,rectNoteLine3b)  
  158. BoxPen(Noteid,GRAY,notepenwidthb)  
  159. boxdrawline(Noteid,rectNoteLine1b)  
  160. boxdrawline(Noteid,rectNoteLine4b)  
  161.  
  162. ;changed last param from 5 to 37 
  163. BoxDrawText(Noteid,rectNoteText,"SORT BY:",1,37) 
  164.  
  165. BoxColor(1,BLUE,0)  
  166. BoxDrawRect(1,"500,800,770,970",1)  
  167. BoxTextColor(1,WHITE)  
  168. BoxDrawText(1,"500,800,770,970","All measurements are in MegaBytes",1,21)  
  169. BoxDataTag(1,"FRED")
  170.  
  171.    
  172. while @true 
  173.         ;debug(1)
  174.         decimals(0)  
  175.         Drives=Diskscan(6)  
  176.         NumOfDrvs=ItemCount(Drives,@tab)  
  177.         matrix=binaryalloc(NumOfDrvs*24)  
  178.         
  179.         for DIndex=1 to NumOfDrvs   
  180.                  Drv=ItemExtract(DIndex,Drives,@tab)
  181.                  Drv=StrReplace(Drv,":","")  
  182.                  f=(DiskFree(Drv)/1048576)  
  183.                  s=(DiskSize(Drv)/1048576)  
  184.                  binarypokestr (matrix,(DIndex-1)*24,Drv)  
  185.                  binarypokeflt(matrix,(DIndex-1)*24+8,f)  
  186.                  binarypokeflt(matrix,(DIndex-1)*24+16,s)  
  187.         next  
  188.            
  189.         binarysort(matrix,24,16,8,@descending|@float8)  
  190.         biggest=binarypeekflt(matrix,16)  
  191.         switch sort       ;(alphabet =1 Freespace=2 Totalsize=3)  
  192.                 case 1  
  193.                  binarysort(matrix,24,0,8,@ascending|@float8) 
  194.                  Break  
  195.                 case 2  
  196.                  binarysort(matrix,24,7,8,@descending|@float8)   
  197.                  Break  
  198.                 case 3  
  199.                  binarysort(matrix,24,16,8,@descending|@float8)  
  200.                  Break  
  201.         EndSwitch  
  202.         If NumOfDrvs>6   
  203.                 mult=350/biggest  
  204.                 Vert=60  
  205.                 Thick=25  
  206.         else  
  207.                 mult=850/biggest  
  208.                 tTab=50  
  209.                 Vert=120  
  210.                 Thick=50  
  211.         endif  
  212.         ;Debug(1)  
  213.         for ai= 1 to min(NumOfDrvs,26)  
  214.                
  215.              if ai>13  
  216.                   a=ai-13   
  217.                   tTab=520  
  218.              else  
  219.                   a=ai  
  220.                   tTab=50  
  221.              endif  
  222.                   
  223.                 ;       Size  
  224.                 size=binarypeekflt(matrix,(ai*24)-8)  
  225.                 Boxcolor (1,PURPLE,0)  
  226.                 Muscle=strcat(tTab,",",a*Vert,",",(size*mult)+tTab,",",(a*Vert)+Thick)  
  227.                 BoxDrawRect(1,muscle,1)  
  228.                 boxtextcolor(1,PURPLE)  
  229.                 sinew=strcat((size*mult)+tTab,",",(a*vert),",",(size*mult)+tTab,",",(a*vert)+thick)   
  230.                 boxdrawtext(1,sinew,"%size% total",@false,0)  
  231.                 ;       Free  
  232.                 free=binarypeekflt(matrix,(ai*24)-16)  
  233.                 Boxcolor (1,GREEN,0)  
  234.                 bone=strcat(tTab,",",a*Vert,",",(free*mult)+tTab,",",(a*Vert)+Thick)  
  235.                 BoxDrawRect(1,bone,1)  
  236.                 marrow=strcat(tTab,",",(a*vert)+Thick+30,",",(size*mult)+tTab,",",(a*vert)+thick)   
  237.                 boxtextcolor(1,GREEN)  
  238.                 boxdrawtext(1,marrow,"%free% free",@false,0)  
  239.                 ;        Name  
  240.                 name=binarypeekstr (matrix,(ai*24)-24,1)  
  241.                 sinew=strcat(tTab-30,",",a*Vert,",",tTab,",",a*(Vert+Thick))  
  242.                 boxtextcolor(1,D3COLOR)  
  243.                 boxdrawtext(1,sinew,"%name%:",@false,0)  
  244.           
  245.         next ai
  246.         ; debug(1)  
  247.         BoxButtonWait()  
  248.         if BoxButtonStat(1,4)==1 then break
  249.         If BoxButtonStat(1,1)==1 then sort=1  
  250.         If BoxButtonStat(1,2)==1 then sort=2  
  251.         If BoxButtonStat(1,3)==1 then sort=3
  252.         BoxDataClear(1,"FRED")  
  253.         BoxUpdates(1,3) 
  254. end while
  255. iniwritepvt(inisection,"Sort",Sort,inifile)
  256. exit  
  257.  
  258. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  259. :FILEINFO
  260.     CancelCmd="goto cancelfi"
  261.     a=FileItemize("")
  262.     if a=="" then a=FileItemize("*.*")
  263.     tot=FileSize(a)
  264.     c=ItemCount(a," ")
  265.     n=0
  266.     b=""
  267.     :ffloop
  268.     if n==c then goto ffshow
  269.     n=n+1
  270.     a1=StrFix(ItemExtract(n,a," ")," ",14)
  271.     a2=FileSize(a1)
  272.     a3=FileTimeGet(a1)
  273.     a4=FileAttrGet(a1)
  274.     b=strcat(b,a1,@tab,a2,@tab,a3,@tab,a4,"|")
  275.     goto ffloop
  276.     :ffshow
  277.     ItemSelect("Total Size=%tot%",b,"|")
  278.     :cancelfi
  279.     drop(a,tot,c,n,a1,a2,a3,a4,b)
  280.     Exit
  281. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  282. :DIRSIZE
  283.     tot = FileSize(FileItemize(""))
  284.     sub1 = DirItemize("")
  285.     if (tot==0 && sub1=="") then tot=FileSize(FileItemize("*.*"))
  286.                 then sub1=DirItemize("*.*")
  287.     totdir=0
  288.     level=1
  289.     dir1=DirGet()
  290.     numdir1 = ItemCount(sub1, " ")
  291.     index1 = 0
  292.   
  293.     :dsloop
  294.     If index%level% == numdir%level% Then Goto upalevel
  295.     index%level% = index%level% + 1
  296.     DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
  297.     totdir=totdir+1
  298.     tot = tot + FileSize(FileItemize("*.*"))
  299.     level = level + 1
  300.     dir%level% = DirGet()
  301.     sub%level% = DirItemize("*.*")
  302.     numdir%level% = ItemCount(sub%level%, " ")
  303.     index%level% = 0
  304.     goto dsloop
  305.   
  306.     :upalevel
  307.     drop(dir%level%,sub%level%,index%level%,numdir%level%)
  308.     level=level-1
  309.     if level!=0 then goto dsloop
  310.  
  311.     ; -----------
  312.     ; Termination
  313.     ; -----------
  314.     If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
  315.     tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
  316.     tot = StrTrim(tot)
  317.     If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  318.     tot = StrTrim(tot)
  319.     If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  320.     tot = StrTrim(tot)
  321.     Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
  322.     drop(tot,level,totdir)
  323.     Exit
  324.  
  325. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  326. :SYSINFO
  327.        wintype="retail"
  328.        if WinMetrics(22) then wintype="debug"
  329.     wcx=WinMetrics(-3)
  330.     math="Math"
  331.     switch wcx
  332.        case 0   ; Win16
  333.         wc=WinConfig()
  334.         if !(wc&1) then mode="Real"
  335.         if wc&16 then mode="Standard"
  336.         if wc&32 then mode="Enhanced"
  337.         
  338.         if wc&64 then cpu=8086
  339.         if wc&128 then cpu=80186
  340.         if wc&2 then cpu=286
  341.         if wc&4 then cpu=386
  342.         if wc&8 then cpu=486
  343.         mode = strcat(mode,' ',wintype,' Windows ')
  344.         if !(wc&1024)  then math="No math"
  345.         break
  346.       case 1 ; Win32 Intel
  347.            mode="Intel 32-bit %wintype% Windows "
  348.            cpu= ItemExtract(6,WinSysInfo(),@tab)
  349.            break
  350.       case 2 ; Dec Alpha
  351.            mode="DEC Alpha %wintype% Windows NT "
  352.            cpu= ItemExtract(6,WinSysInfo(),@tab)
  353.            break
  354.       case 3 ; MIPS
  355.            mode="MIPS %wintype% Windows NT "
  356.            cpu= ItemExtract(6,WinSysInfo(),@tab)
  357.            break
  358.       case 4 ; PowerPC 
  359.            mode="PowerPC %wintype% Windows NT "
  360.            cpu= ItemExtract(6,WinSysInfo(),@tab)
  361.            break
  362.       case wcx
  363.            cpu= ItemExtract(6,WinSysInfo(),@tab)
  364.            mode="Unknown platform %wintype% Windows  "
  365.     endswitch
  366.  
  367.     Sysinfo=strcat(cpu,' ',mode,WinVersion(1),'.',WinVersion(0),@CRLF)
  368.  
  369.     mouse="No Mouse"
  370.     if WinMetrics(19) then mouse="Mouse"
  371.  
  372.     Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',@CRLF)
  373.  
  374.     sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",@CRLF)
  375.  
  376.     ErrorMode(@OFF)
  377.     LastError()
  378.     PlayMedia("Status WaveForm Ready")
  379.     ErrorMode(@CANCEL)
  380.     if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",@CRLF)
  381.     a=NetInfo(0)
  382.     if a=="MULTINET"
  383.          b=NetInfo(1)
  384.          bug=strcat(b,"network(s) installed"))
  385.          ;Message("Multinet supporting  %count% networks", b)
  386.     else
  387.          ;Message("Installed Network", a)
  388.          bug=strcat(a," network installed")
  389.     endif
  390.     sysinfo=strcat(sysinfo,bug,@crlf)
  391.  
  392.  
  393.     switch wcx
  394.        case 0
  395.            bug=WinResources(0)/1024      ; Compute memory avail
  396.            math=strlen(bug)
  397.            if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  398.            sysinfo=strcat(sysinfo,@crlf,bug," KB Free Memory",@crlf)
  399.            sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",@crlf)
  400.           break
  401.        case wcx
  402.           bug=WinResources(11)/1024      ; Get Physical memory avail
  403.           sysinfo=strcat(sysinfo,@crlf,bug," KB Physical Memory",@crlf)
  404.           bug=(WinResources(14)/1024)+bug    ; Get Virtual memory + Physical avail
  405.           sysinfo=strcat(sysinfo,bug," KB Total Memory",@crlf)
  406.     end switch
  407.  
  408.  
  409.     sysinfo=strcat(sysinfo,"Console ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),@CRLF)
  410.     disks=DiskScan(1)
  411.     disks=StrReplace(disks,@tab," ")
  412.     if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,@CRLF)
  413.     disks=DiskScan(2)
  414.     disks=StrReplace(disks,@tab," ")
  415.     if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,@CRLF)
  416.     disks=DiskScan(4)
  417.     disks=StrReplace(disks,@tab," ")
  418.     if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,@CRLF)
  419.     sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),@CRLF)
  420.     sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),@CRLF)
  421.     sysinfo=strcat(sysinfo,@CRLF,"WIL Interpreter Ver ",VersionDll())
  422.  
  423.     ver=Version()
  424.     Message("%Param2% %ver% SysInfo",Sysinfo)
  425.     Exit
  426.  
  427. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  428. :ZIP
  429. :UNZIP
  430.     debug(1)
  431.     CancelCommand="goto ZZCANCEL"
  432.     ErrMsg=""
  433.     If !FileExist("wwwdos.bat")      Then ErrMsg="WWWDOS.BAT   not found"
  434.     If !FileExist("wwwdosp.pif")  Then ErrMsg="WWWDOSP.PIF  not found"
  435.     If !FileExist("wwwdosc.pif")  Then ErrMsg="WWWDOSC.PIF  not found"
  436.     If !FileExist("wwwzipls.exe") Then ErrMsg="WWWZIPLS.EXE not found"
  437.     If !FileExist("pkzip.exe")      Then ErrMsg="PKZIP.EXE    not found"
  438.     If !FileExist("pkunzip.exe")  Then ErrMsg="PKUNZIP.EXE  not found"
  439.     If !FileExist("%FCDir789672%browser.exe")  Then ErrMsg="%FCDir789672%BROWSER.EXE  not found"
  440.     If ErrMsg!="" Then Goto ShowError
  441.  
  442.     goto %param1%2       ; must be ZIP or UNZIP
  443.  
  444. :ZIP2
  445.     DaMove=" -a "
  446.     DaDirs=""
  447.     DaWho="*.*"
  448.     DaZip=""
  449.     DaRefresh=0
  450.     DaTitle="Files"
  451.     param3=strlower(param3)
  452.     if param3=="move" then DaMove=" -m "
  453.     goto %param2%          ; Must be CURRENT, DIR, SUBDIR, or HILITED
  454.  
  455. :CURRENT
  456.     DaWho=strcat(CurrentPath(),CurrentFile())
  457.     DaZip=strcat(FileRoot(DaWho),".ZIP")
  458.     goto ZIPDO
  459. :SUBDIR
  460.        DaDirs=" -r -p "
  461.        DaRefresh=1
  462.        DaTitle="Structure"
  463.        goto ZIPDO
  464.  
  465. :HILITED
  466.     b=FileItemize("")
  467.     If b=="" Then ErrMsg="Zip Hilited files?  No files hilited!"
  468.          Then Goto ShowError
  469.     b=strreplace(b," ",@CRLF)
  470.     fp=FileOpen("FC-TEMP9.XCV","WRITE")
  471.     FileWrite(fp,b)
  472.     FileClose(fp)
  473.     Drop(b)
  474.     DaWho="@FC-TEMP9.XCV"
  475.     goto ZIPDO
  476.  
  477. :DIR
  478.        DaTitle="Directory"
  479.        goto ZIPDO
  480.  
  481. :ZIPDO
  482.     DaZip=AskLine("Zip %DaTitle%","Enter desired ZIP name",DaZip)
  483.     if DaZip=="" then goto zzcancel
  484.     Runwait("wwwdosc.pif","pkzip.exe %DaMove% %DaDirs% %DaZip% %DaWho%")
  485.     if DaWho=="FC-TEMP9.XCV" then FileDelete(DaWho)
  486.     Refresh(DaRefresh)
  487.     Display(3,"Zip %DaTitle%","Complete")
  488.     goto zzcancel
  489.  
  490. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  491. :UNZIP2
  492.  
  493.        ViewFlag=0
  494.        zipsort=param3
  495.        goto %param2%    ; must be ALL, VIEW, or INDIV
  496.  
  497. :ALL
  498.     zipfile=strcat(CurrentPath(),CurrentFile())
  499.     if FileExtension(zipfile)=="ZIP" then goto alldoit
  500.     zipfile=FileItemize("*.zip")
  501.     If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  502.          Then Goto ShowError
  503.     zipfile=itemselect("Select file to UnZip",zipfile," ")
  504.     if zipfile=="" then goto zzcancel
  505. :alldoit
  506.     if param3==2 then goto allspec
  507.     runwait("wwwdosc.pif","pkunzip.exe -d %zipfile%")
  508.     Refresh(1)
  509.     goto zzcancel
  510.  
  511. :allspec
  512.     RetHome="allspec1"
  513.     goto DoOptions
  514. :allspec1
  515.     if overwarn==0 then overwarn=" -o "
  516.                else overwarn=""
  517.     RunWait("wwwdosc.pif", "pkunzip.exe -d %overwarn% %zipfile% %targdir% *.*")
  518.     Refresh(1)
  519.     goto zzcancel
  520.  
  521.  
  522.  
  523. :INDIV
  524.        ViewFlag=param3
  525.        if ViewFlag==1 then zipsort=1
  526.               then overwarn=0
  527.               then targdir=""
  528.               then goto VIEW
  529.  
  530.     RetHome="VIEW"
  531.     goto DoOptions
  532.  
  533. :VIEW
  534.     workdir = Environment("TEMP")
  535.     If workdir == "" Then workdir = DirWindows(0)
  536.     If StrSub(workdir, StrLen(workdir), 1) != "\" Then workdir = StrCat(workdir, "\")
  537.     if ViewFlag==0 then targdir=workdir
  538.     zipfile=strcat(CurrentPath(),CurrentFile())
  539.     if FileExtension(zipfile)=="ZIP" then goto viewdoit
  540.     zipfile=FileItemize("*.zip")
  541.     If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  542.          Then Goto ShowError
  543.     if ViewFlag==0 then TSMsg="Select ZIP file to view"
  544.                else TSMsg="Select ZIP file to use"
  545.     zipfile=itemselect(TSMsg,zipfile," ")
  546.     if zipfile=="" then goto zzcancel
  547.  
  548. :viewdoit
  549.     ziplist = StrCat(workdir, "wwwunzip.lst")
  550.     If FileExist(ziplist) Then FileDelete(ziplist)
  551.  
  552.     RunWait("wwwzipls.exe","%zipfile% %ziplist% %zipsort%")
  553.     if ViewFlag==0 then TSMsg="Select file to view"
  554.                else TSMsg="Select file to extract"
  555. :TXSEL
  556.     OldFont=IntControl(28,1,0,0,0)          ; Set fixed pitch font in text box
  557.     member=TextBox(TSMsg,ziplist)
  558.     IntControl(28,OldFont,0,0,0)          ; Restore previous font pitch type
  559.     if member=="" then goto ZZCANCEL
  560.  
  561.     member=strsub(member,46,strlen(member)-45)
  562.     memfile=FileExtension(member)
  563.     if memfile!="" then memfile=strcat(FileRoot(member),".",memfile)
  564.                else memfile=FileRoot(member)
  565.     
  566.  
  567.     if ViewFlag==0 then goto extract
  568.     if overwarn==0 then goto extract
  569.     If FileExist("%targdir%%memfile%") == @FALSE Then Goto extract
  570.     b= AskYesNo("%member% already exists in %targdir%", "Do you wish to replace it?")
  571.     If b == @NO Then Goto TXSEL
  572.  
  573. :extract
  574.     RunWait("wwwdosc.pif", "pkunzip.exe -o %zipfile% %targdir% %member%")
  575.     If !FileExist("%targdir%%memfile%") Then ErrMsg="Problem extracting %member% from ZIP file"
  576.                        Then Goto ShowError
  577.  
  578.     if ViewFlag!=0 then TSMsg="Extract Another?"
  579.                then goto TXSEL
  580.     member = StrUpper(StrCat(targdir, memfile))
  581.     RunZoomWait("%FCDir789672%browser.exe", member)
  582.     FileDelete(member)
  583.     TSMsg="View Another?"
  584.     goto TXSEL
  585.  
  586.  
  587. :SHOWERROR
  588.     Message("Error", ErrMsg)
  589.  
  590. :ZZCANCEL
  591.     if IsDefined(ziplist) then If FileExist(ziplist) Then FileDelete(ziplist)
  592.     Drop(DaMove,DaDirs,DaWho,DaZip,DaRefresh,DaTitle,ViewFlag,zipsort)
  593.     Drop(zipfile,b,RetHome,overwarn,targdir,workdir,ziplist,TSMsg,member)
  594.     Drop(ErrMsg,usecurdir,ThisDir,CheckDir,memfile)
  595.     Drop(ZippyFormat,ZippyCaption,ZippyX,ZippyY,ZippyWidth,ZippyHeight)
  596.     Drop(ZippyNumControls,Zippy01,Zippy02,Zippy03,Zippy04,Zippy05,Zippy06)
  597.     Drop(Zippy07,Zippy08,Zippy09,Zippy10,Zippy11,Zippy12,Zippy13)
  598.     exit
  599. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  600.  
  601. :DOOPTIONS
  602.     zipsort = IniReadPvt("WWWUNZIP", "SortOrder", 1, "www-prod.ini")
  603.     overwarn=IniReadPvt("WWWUNZIP","OverWarn",1,"www-prod.ini")
  604.     whichdir=IniReadPvt("WWWUNZIP","WhichDir",1,"www-prod.ini")
  605.  
  606.     ; Undocumented, new, beta dialog function being used here.  Will
  607.     ; be documented in the 2.0 release.  Good Luck.
  608.  
  609.  
  610.     ZippyFormat=`WWWDLGED,4.0`
  611.  
  612.     ZippyCaption=`Zip Options`
  613.     ZippyX=-1
  614.     ZippyY=-1
  615.     ZippyWidth=217
  616.     ZippyHeight=115
  617.     ZippyNumControls=13
  618.     Zippy01=`6,18,80,DEFAULT,RADIOBUTTON,whichdir,"Use Current Dir ->",1`
  619.     Zippy02=`6,32,80,DEFAULT,RADIOBUTTON,whichdir,"Use Specified Dir ->",2`
  620.     Zippy03=`86,32,124,DEFAULT,EDITBOX,targdir,""`
  621.     Zippy04=`16,64,56,DEFAULT,RADIOBUTTON,zipsort,"by Name",1`
  622.     Zippy05=`16,76,58,DEFAULT,RADIOBUTTON,zipsort,"by Extension",2`
  623.     Zippy06=`16,88,46,DEFAULT,RADIOBUTTON,zipsort,"by Date",3`
  624.     Zippy07=`16,100,46,DEFAULT,RADIOBUTTON,zipsort,"by Size",4`
  625.     Zippy08=`108,58,80,DEFAULT,CHECKBOX,overwarn,"Warn on Overwrite",1`
  626.  
  627.     Zippy09=`120,78,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  628.     Zippy10=`120,98,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
  629.     Zippy11=`6,4,64,DEFAULT,STATICTEXT,NONAME,"Target Directory"`
  630.     Zippy12=`6,52,64,DEFAULT,STATICTEXT,NONAME,"Sort list by:"`
  631.     Zippy13=`88,20,122,DEFAULT,VARYTEXT,ThisDir,""`
  632.  
  633.  
  634. :gettarg
  635.     ; Undocumented, new, beta dialog function being used here.  Will
  636.     ; be documented in the 2.0 release.  Good Luck.
  637.     ThisDir=DirGet()
  638.     targdir = IniReadPvt("WWWUNZIP", "TargetDir", DirGet(), "www-prod.ini")
  639.     Dialog("Zippy")
  640.  
  641.     if whichdir==1 then usecurdir = @YES
  642.                then targdir=ThisDir
  643.                else usecurdir = @NO
  644.     targdir = StrUpper(targdir)
  645.     If targdir == "" Then usecurdir = @YES
  646.              Then targdir = DirGet()
  647.     If StrSub(targdir, StrLen(targdir), 1) != "\" Then targdir = StrCat(targdir, "\")
  648.     If ThisDir==targdir then usecurdir = @YES
  649.                 then goto targok
  650.     DirChange(targdir)
  651.     CheckDir=DirGet()
  652.     DirChange(ThisDir)
  653.     If ThisDir!=CheckDir Then Goto targok
  654.  
  655.     b= AskYesNo("WWWUNZIP", "%targdir% does not exist.  Do you wish to create it?")
  656.     If b == @NO Then Goto gettarg
  657.     DirMake(targdir)
  658.     DirChange(targdir)
  659.     CheckDir=DirGet()
  660.     DirChange(ThisDir)
  661.     If ThisDir!=CheckDir Then Goto targok
  662.     Message("WWWUNZIP","%targdir% could not be created.  Please respecify.")
  663.     goto gettarg
  664.  
  665.     :targok
  666.     If usecurdir == @NO Then IniWritePvt("WWWUNZIP", "TargetDir", targdir, "www-prod.ini")
  667.     IniWritePvt("WWWUNZIP", "SortOrder", zipsort, "www-prod.ini")
  668.     IniWritePvt("WWWUNZIP", "OverWarn", overwarn, "www-prod.ini")
  669.     IniWritePvt("WWWUNZIP", "WhichDir", whichdir, "www-prod.ini")
  670.     goto %RetHome%
  671. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  672. :CANCEL           ; This cancel is shared by ALL the above routines.
  673. %CancelCmd%    ; Execute Cancel Command
  674.