home *** CD-ROM | disk | FTP | other *** search
Wrap
; WWWMENUS.DLL ; Common menus used by WWW Products CancelCmd="Exit" goto %param1% ; Go immediately to desired section ; Defined sections are: ZIP UNZIP SYSINFO INIEDIT FONEBOOK DIRSIZE FILEINFO FREESPACE CMDSTACK PROGBUILD WALLPAPER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :WALLPAPER a=strcat(CurrentPath(),CurrentFile()) ; Is a BMP file hilited? if FileExtension(a)=="BMP" then goto walldoit a=FileItemize("*.bmp") ; No? Any in Current Directory? if a!="" then goto sel ; Hmmm cannot find any BMP in current dir. Check INI/Prompt user for info WallDir1=inireadpvt("wallpaper","WallPaperDir","ASK","WWW-PROD.INI") :REASK if WallDir1=="ASK" then WallDir=AskLine("WallPaper","What directory are your *.BMP WallPaper files in?",DirWindows(0)) else WallDir=WallDir1 ErrorMode(@off) DirChange(WallDir) ErrorMode(@cancel) a=FileItemize("*.BMP") if a=="" then Message("WallPaper Error","No *.BMP files found in %WallDir%") then goto REASK if WallDir!=WallDir1 then iniwritepvt("wallpaper","WallPaperDir",WallDir,"WWW-PROD.INI") :sel a=strcat("-None- ",a) a=ItemSelect("Select New Wallpaper",a," ") terminate(a=="","Wallpaper","No wallpaper selected") if a=="-None-" then Wallpaper("",0) then exit a=strcat(DirGet(),a) :walldoit tile=@FALSE if FileSize(a)<40000 then tile=@TRUE ;if bmp size less than 40K, assume tile, else center Wallpaper(a,tile) drop(a,b,tile) Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :PROGBUILD ;Uses DDE to get ProgMan to divluge contents of groups and builds ;CmdPost and File Commander menu items to match CancelCmd="goto cancelbuild" startpm = 0 OldWinTitle=WinName() WinTitle("","Prog Build Initializing") f=0 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.") ProgWho="" If stricmp("FileCmdr",param2)==0 then ProgWho="FC" then OldWinTitle="File Manager" If stricmp("CmdPost",param2)==0 then ProgWho="CP" Terminate(ProgWho=="","ProgBuild Menu Error","Param2 not CP or FC") LSP="" if ProgWho=="CP" then newcpm = "cmdgroup.cpm" then LSP=" " if ProgWho=="FC" then newcpm = "wwwfc4.mnu" n=FileLocate(newcpm) if n=="" then newcpm=strcat(DirWindows(0),newcpm) else newcpm=n channel = DDEInitiate("Progman", "Progman") If channel != 0 Then Goto DDEOK ; Hmmm DDE not working. Check for Progman If WinExist("Program Manager") then Goto TRY2 If !FileExist("progman.exe") then Message("ProgMan Capture","Cannot find PROGMAN.EXE") then goto cancelbuild RunHide("progman.exe", "") startpm=1 :TRY2 channel = DDEInitiate("Progman", "Progman") If channel == 0 Then Goto ddeerror :DDEOK groups = DDERequest(channel, "Groups") If groups == "***NACK***" Then Goto ddeerror groups = StrReplace(groups, cr, tab) groups = ItemSort(groups, tab) f = FileOpen(newcpm, "WRITE") if ProgWho=="CP" then FileWrite(f,"&Groups") then FileWrite(f," Rebuild Menu from ProgMan Grps") then FileWrite(f,' Call("wwwmenus.dll","PROGBUILD %%IniSection%%")') if ProgWho=="FC" then FileWrite(f,"Rebuild Menu from ProgMan Grps") then FileWrite(f,' Call("wwwmenus.dll","PROGBUILD %%IniSection%%")') n = ItemCount(groups, tab) i = 0 :nextgroup i = i + 1 group = strtrim(ItemExtract(i, groups, tab)) If group == "" Then Goto DODANEXTONE If group=="Quick Access" then goto DODANEXTONE FirstItem=0 if i==1 then GroupTitle=strcat(LSP,"_",group) then goto notfirstgrp if ((i mod 18) == 1) then GroupTitle=strcat(LSP,"|",group) else GroupTitle=strcat(LSP,group) :notfirstgrp items = DDERequest(channel, group) If items == "***NACK***" Then Goto DODANEXTONE items = StrReplace(items, cr, tab) items = ItemRemove(1, items, tab) items = ItemSort(items, tab) o = ItemCount(items, tab) j = 0 :nextitem j = j + 1 item = ItemExtract(j, items, tab) If item == "" Then Goto DODANEXTONE itemdesc = strtrim(ItemExtract(1, item, ",")) itemdesc = StrSub(itemdesc, 2, StrLen(itemdesc) - 2) itemprog = StrLower(strtrim(ItemExtract(2, item, ","))) itemprog = StrSub(itemprog, 2, StrLen(itemprog) - 2) WinTitle("",`<Group %group% %i%/%n% : Item %itemprog% %j%/%o%>`) itemparms = "" sp1 = StrIndex(itemprog, " ", 1, @FWDSCAN) If sp1 == 0 Then Goto noparms itemparms = StrSub(itemprog, sp1 + 1, StrLen(itemprog) - sp1) itemprog = StrSub(itemprog, 1, sp1 - 1) :noparms itemdir = StrLower(strtrim(ItemExtract(3, item, ","))) ; Do HotKeys for CmdPost hotkey = "" if ProgWho!="CP" then goto nohotkey itemkey = strtrim(ItemExtract(8, item, ",")) If itemkey == "0" Then Goto nohotkey hotkey = " \ " If itemkey & 1024 Then hotkey = StrCat(hotkey, "!") If itemkey & 512 Then hotkey = StrCat(hotkey, "^") If itemkey & 256 Then hotkey = StrCat(hotkey, "+") hotkey = StrCat(hotkey, Num2Char(itemkey & 255)) :nohotkey icon = "" If strtrim(ItemExtract(9, item, ",")) == "1" Then icon = "Icon" if FirstItem==0 then FileWrite(f, GroupTitle) then FirstItem=1 nit="" if ( (j!=1) && ((j mod 15)==1)) then nit="|" FileWrite(f, `%LSP% %nit%%itemdesc%%hotkey%`) If itemdir != "" Then FileWrite(f, ` DirChange("%itemdir%")`) FileWrite(f, ` Run%icon%("%itemprog%", "%itemparms%")`) FileWrite(f, ``) :DODANEXTONE If j < o Then Goto nextitem If i < n Then Goto nextgroup Goto pbdone :error Message("ProgMan Group Capture Error", "Operation unsuccessful") Goto cancelbuild :ddeerror Message("ProgMan Group Capture DDE Error", "Operation unsuccessful") Goto cancelbuild :pbdone Message("ProgMan Group Capture", "Processing complete%cr%Push OK and wait for menu reload.") :cancelbuild if f!=0 then FileClose(f) If IsDefined(channel) Then DDETerminate(channel) If startpm == 1 Then WinClose("Program Manager") WinTitle("",OldWinTitle) Drop(newcpm, startpm, channel, f, i, j, n, o, groups, group, items, item) Drop(itemdesc, itemprog, itemparms, itemdir, itemkey, hotkey, icon, sp1) Drop(OldWinTitle,GroupTitle,FirstItem) Reload() Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :CMDSTACK ; CmdStack uses wierd variable names to reduce the chance that a user ; will try to execute a statement using the same names!! if !IsDefined(CMDSTK987Cmds) Then CMDSTK987Cmds="" if !IsDefined(CMDSTK987Last) Then CMDSTK987Last="1+2+3" goto %param2% :PREVIOUS If CMDSTK987Cmds == "" Then Goto NEWCMD CMDSTK987Now = TextSelect("Select a command, or OK to enter a new command", CMDSTK987Cmds, tab) If CMDSTK987Now != "" Then Goto CMDDOIT :NEWCMD CMDSTK987Now = AskLine("WIL Interactive", "Command to execute:", CMDSTK987Last) If CMDSTK987Now == "" Then Goto PREVIOUS :CMDDOIT Execute Message(CMDSTK987Now, %CMDSTK987Now%) if ItemLocate(CMDSTK987Now,CMDSTK987Cmds,tab) then goto PREVIOUS a=tab if CMDSTK987Cmds=="" then a="" CMDSTK987Cmds = StrCat(CMDSTK987Cmds, a, CMDSTK987Now) CMDSTK987Last = CMDSTK987Now Goto PREVIOUS :FLUSH If AskYesNo("Flush WIL command stack", "Really?") Then CMDSTK987Cmds = "" Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :FREESPACE Drives=DiskScan(2) ; 2 is the code for local hard drives Dmax=strlen(Drives) DIndex=1 TotalSize=0 DriveReport="" :COUNTSPACE NextDrive=StrSub(Drives,Dindex,1) a=DiskFree(NextDrive)/1024 TotalSize=a+TotalSize DriveReport=strcat(DriveReport,NextDrive," = ",TAB,a,"K",TAB,strfill("|",(a+500)/1000),"@") DIndex=Dindex+3 ;each entry is 3 bytes long if DIndex<=Dmax then goto COUNTSPACE ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@") Drop(TotalSize,DriveReport,Drives,NextDrive) Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :FILEINFO CancelCmd="goto cancelfi" a=FileItemize("") if a=="" then a=FileItemize("*.*") tot=FileSize(a) c=ItemCount(a," ") n=0 b="" :ffloop if n==c then goto ffshow n=n+1 a1=StrFix(ItemExtract(n,a," ")," ",14) a2=FileSize(a1) a3=FileTimeGet(a1) a4=FileAttrGet(a1) b=strcat(b,a1,tab,a2,tab,a3,tab,a4,"|") goto ffloop :ffshow ItemSelect("Total Size=%tot%",b,"|") :cancelfi drop(a,tot,c,n,a1,a2,a3,a4,b) Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :DIRSIZE tot = FileSize(FileItemize("")) sub1 = DirItemize("") if (tot==0 && sub1=="") then tot=FileSize(FileItemize("*.*")) then sub1=DirItemize("*.*") totdir=0 level=1 dir1=DirGet() numdir1 = ItemCount(sub1, " ") index1 = 0 :dsloop If index%level% == numdir%level% Then Goto upalevel index%level% = index%level% + 1 DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " "))) totdir=totdir+1 tot = tot + FileSize(FileItemize("*.*")) level = level + 1 dir%level% = DirGet() sub%level% = DirItemize("*.*") numdir%level% = ItemCount(sub%level%, " ") index%level% = 0 goto dsloop :upalevel drop(dir%level%,sub%level%,index%level%,numdir%level%) level=level-1 if level!=0 then goto dsloop ; ----------- ; Termination ; ----------- If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot) tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3)) tot = StrTrim(tot) If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1) tot = StrTrim(tot) If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1) tot = StrTrim(tot) Message("%totdir% Subdirectories included", "Total size %tot% bytes.") drop(tot,level,totdir) Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :FONEBOOK ; This code implements a phone dialer with WIL language statements. ; The phone numbers are kept in the FONEBOOK.TXT file. It is simply a text ; file with name followed by number. This code assumes everything after the ; last space is part of the phone number. ; The code also assumes that the COM port has been correctly set up in the ; PORTS section of the control panel. Mostly be sure the Control Panel ; ports section has the right baud rate for your modem in it. ; User initialization section. Set these to correspond to your modem commands. ; Most users will only have to check the ComPort setting. CancelCmd="goto CancelFB" FBCancelCmd="Exit" ComPort=IniReadPvt("FileCmdr","PhonePort","ASK","WWW-PROD.INI") OldFont=99 XPort=ComPort 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") if XPort=="" then exit if XPort!=ComPort then IniWritePvt("FileCmdr","PhonePort",Xport,"WWW-PROD.INI") then ComPort=XPort DialPrefix="ATDT" HangCommand="ATH0" ; And here we go. First make a CR/LF and a TAB CR=strcat(num2char(13),num2char(10)) TAB=num2char(9) ; Use Home Directory DirChange(DirHome()) ; Make sure there is a fonebook.txt file if !FileExist("FONEBOOK.TXT") then fp=FileOpen("FONEBOOK.TXT","WRITE") then FileWrite(fp,"Emergency Services 911") then FileWrite(fp,"Directory Assistance 1-555-1212") then FileClose(fp) ; Put up the TextBox so the user can choose a number :NewNum FBCancelCmd="Exit" ; What to do if user hits "Cancel" OldFont=IntControl(28,1,0,0,0) ;Select fixed pitch font for textbox num=StrTrim(TextBoxSort("DIALER - Just hit OK to add a new number","fonebook.txt")) IntControl(28,OldFont,0,0,0) if num!="" then goto zorkle num=strtrim(AskLine("DIALER","Enter name and number as in%CR%(Don't put any spaces in the number)","Joe Blough 1-555-1212")) Terminate(num=="","","") a=StrIndex(num," ",0,@BACKSCAN) num2=strsub(num,a+1,strlen(num)-a) num=strtrim(strsub(num,1,a-1)) num=strcat(strfix(num,' ',25),num2) fp=FileOpen("temp876.num","WRITE") FileWrite(fp,num) ; send it the number to dial FileClose(fp) FileAppend("temp876.num","fonebook.txt") FileDelete("temp876.num") goto newnum :zorkle a=StrIndex(num," ",0,@BACKSCAN) b=Strindex(num,TAB,0,@BACKSCAN) a=max(a,b) num=strsub(num,a+1,strlen(num)-a) DialCommand="%DialPrefix%%NUM%;" :redial fp=FileOpen(ComPort,"WRITE") FileWrite(fp,"ATZ") ; Send a CR to wake modem up Delay(2) ; Let it get out of bed. FileWrite(fp,DialCommand) FileClose(fp) Delay(3) ; Give modem a chance to think FBCancelCmd="Goto Hang1" a=AskYesNo("Dialer","Yes=HANGUP%CR%No=REDIAL%CR%Cancel=New Number") fp=FileOpen(ComPort,"WRITE") FileWrite(fp,HangCommand) FileClose(fp) if a==@YES then exit Display(30,"Dialer","Redial Wait") goto redial :CANCELFB if OldFont!=99 then IntControl(28,OldFont,0,0,0) %FBCancelCmd% :Hang1 fp=FileOpen(ComPort,"WRITE") FileWrite(fp,HangCommand) FileClose(fp) goto NewNum ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :INIEDIT DirChange(DirWindows(0)) CancelCmd="goto BYEBYE" IniFiles="" bSys386=0 :UP1 CancelCmd="goto byebye" If IniFiles!="" then goto inied IniFiles=FileItemize("*.INI") :inied ButtonNames("&Edit File","&Quit") TheFile=ItemSelect("Choose Desired INI file",IniFiles," ") if TheFile=="" then goto newini Sections="" :UP2 CancelCmd="goto up1" if Sections!="" then goto sected Sections=IniItemizePvt("",TheFile) :SECTED ButtonNames("&Edit Section","&Up a Level") Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB) if Section=="" then goto AddSect if stricmp(Section,"386Enh")==0 then bSys386=1 else bSys386=0 KeyValues="" :UP3 CancelCmd="goto up2" if KeyValues!="" then goto looped Keys=IniItemizePvt(Section,TheFile) if (bSys386) then Keys=StrReplace(Keys,"device%TAB%","") then Keys=StrReplace(Keys,"Device%TAB%","") then Keys=StrReplace(Keys,"DEVICE%TAB%","") then Keys=StrReplace(Keys,"device","") then Keys=StrReplace(Keys,"Device","") then Keys=StrReplace(Keys,"DEVICE","") KeyMax=ItemCount(Keys,TAB) KeyIndex=0 :ieLoop if KeyIndex==KeyMax then goto looped KeyIndex=KeyIndex+1 ThisKey=ItemExtract(KeyIndex,Keys,TAB) ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile) KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB) goto ieLoop :looped ButtonNames("&Edit KeyWord","&Up a Level") Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB) if Key=="" then goto AddKey Key=ItemExtract(1,Key,"=") Value=IniReadPvt(Section,Key,"???",TheFile) goto entkey :newini CancelCmd="goto UP1" TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI") if (TheFile=="*.INI" || TheFile=="") then goto newini IniFiles="" goto AddSectNewIni :AddSect CancelCmd="goto up2" :AddSectNewIni Section=AskLine("Add New Section to INI File","Enter new section name for%CR% %TheFile%%CR% [?????]","") Sections="" goto AddKeyNewSect :AddKey CancelCmd="goto up3" :AddKeyNewSect Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR% %TheFile%%CR% [%Section%]","") if (bSys386 && stricmp(Key,"device"==0)) then Message("Error","Cannot modify or add DEVICE= lines to [386Enh]%CR%with this utility") then goto AddKeyNewSect Value="(Undefined)" KeyValues="" goto EntKeyNewKey :ENTKEY CancelCmd="goto up3" :EntKeyNewkey NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR% [%Section%]%CR% %Key% = %Value%",Value) if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile) KeyValues="" goto up3 :BYEBYE exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :SYSINFO wintype="retail" if WinMetrics(22) then wintype="debug" wc=WinConfig() if !(wc&1) then mode="Real" if wc&16 then mode="Standard" if wc&32 then mode="Enhanced" if wc&2 then cpu=286 if wc&4 then cpu=386 if wc&8 then cpu=486 if wc&64 then cpu=8086 if wc&128 then cpu=80186 Sysinfo=strcat(cpu,' ',mode,' ',wintype,' Windows ',WinVersion(1),'.',WinVersion(0),CR) math="No math" if wc&1024 then math="Math" mouse="No Mouse" if WinMetrics(19) then mouse="Mouse" Sysinfo=strcat(sysinfo,math," co-processor. ",mouse,' available.',CR) sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution. ",WinMetrics(-1)," colors.",CR) ErrorMode(@OFF) LastError() PlayMedia("Status WaveForm Ready") ErrorMode(@CANCEL) if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR) bug=NetGetCaps(2) if bug==0 then math="No n" if bug!=0 then math="N" if bug==256 then math="Microsoft n" if bug==512 then math="Lan Manager n" if bug==768 then math="Novell NetWare n" if bug==1024 then math="Banyan Vines n" if bug==1280 then math="10 Net n" sysinfo=strcat(sysinfo,math,"etwork installed.",CR) bug=WinResources(0)/1024 ; Compute memory avail math=strlen(bug) if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3)) sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR) sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR) sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0)," using ",environment("COMSPEC"),CR) disks=DiskScan(1) if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR) disks=DiskScan(2) if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR) disks=DiskScan(4) if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR) sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR) sysinfo=strcat(sysinfo,"System Directory ",DirWindows(1),CR) sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll()) ver=Version() Message("%Param2% %ver% SysInfo",Sysinfo) Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :ZIP :UNZIP CancelCommand="goto ZZCANCEL" ErrMsg="" If !FileExist("wwwdos.bat") Then ErrMsg="WWWDOS.BAT not found" If !FileExist("wwwdosp.pif") Then ErrMsg="WWWDOSP.PIF not found" If !FileExist("wwwdosc.pif") Then ErrMsg="WWWDOSC.PIF not found" If !FileExist("wwwzipls.exe") Then ErrMsg="WWWZIPLS.EXE not found" If !FileExist("pkzip.exe") Then ErrMsg="PKZIP.EXE not found" If !FileExist("pkunzip.exe") Then ErrMsg="PKUNZIP.EXE not found" If !FileExist("browser.exe") Then ErrMsg="BROWSER.EXE not found" If ErrMsg!="" Then Goto ShowError goto %param1%2 ; must be ZIP or UNZIP :ZIP2 DaMove=" -a " DaDirs="" DaWho="*.*" DaZip="" DaRefresh=0 DaTitle="Files" param3=strlower(param3) if param3=="move" then DaMove=" -m " goto %param2% ; Must be CURRENT, DIR, SUBDIR, or HILITED :CURRENT DaWho=strcat(CurrentPath(),CurrentFile()) DaZip=strcat(FileRoot(DaWho),".ZIP") goto ZIPDO :SUBDIR DaDirs=" -r -p " DaRefresh=1 DaTitle="Structure" goto ZIPDO :HILITED b=FileItemize("") If b=="" Then ErrMsg="Zip Hilited files? No files hilited!" Then Goto ShowError b=strreplace(b," ",CR) fp=FileOpen("FC-TEMP9.XCV","WRITE") FileWrite(fp,b) FileClose(fp) Drop(b) DaWho="@FC-TEMP9.XCV" goto ZIPDO :DIR DaTitle="Directory" goto ZIPDO :ZIPDO DaZip=AskLine("Zip %DaTitle%","Enter desired ZIP name",DaZip) if DaZip=="" then goto zzcancel Runwait("wwwdosc.pif","pkzip.exe %DaMove% %DaDirs% %DaZip% %DaWho%") if DaWho=="FC-TEMP9.XCV" then FileDelete(DaWho) Refresh(DaRefresh) Display(3,"Zip %DaTitle%","Complete") goto zzcancel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :UNZIP2 ViewFlag=0 zipsort=param3 goto %param2% ; must be ALL, VIEW, or INDIV :ALL zipfile=strcat(CurrentPath(),CurrentFile()) if FileExtension(zipfile)=="ZIP" then goto alldoit zipfile=FileItemize("*.zip") If zipfile=="" Then ErrMsg="UnZip files? No zip files found!" Then Goto ShowError zipfile=itemselect("Select file to UnZip",zipfile," ") if zipfile=="" then goto zzcancel :alldoit if param3==2 then goto allspec runwait("wwwdosc.pif","pkunzip.exe -d %zipfile%") Refresh(1) goto zzcancel :allspec RetHome="allspec1" goto DoOptions :allspec1 if overwarn==0 then overwarn=" -o " else overwarn="" RunWait("wwwdosc.pif", "pkunzip.exe -d %overwarn% %zipfile% %targdir% *.*") Refresh(1) goto zzcancel :INDIV ViewFlag=param3 if ViewFlag==1 then zipsort=1 then overwarn=0 then targdir="" then goto VIEW RetHome="VIEW" goto DoOptions :VIEW workdir = Environment("TEMP") If workdir == "" Then workdir = DirWindows(0) If StrSub(workdir, StrLen(workdir), 1) != "\" Then workdir = StrCat(workdir, "\") if ViewFlag==0 then targdir=workdir zipfile=strcat(CurrentPath(),CurrentFile()) if FileExtension(zipfile)=="ZIP" then goto viewdoit zipfile=FileItemize("*.zip") If zipfile=="" Then ErrMsg="UnZip files? No zip files found!" Then Goto ShowError if ViewFlag==0 then TSMsg="Select ZIP file to view" else TSMsg="Select ZIP file to use" zipfile=itemselect(TSMsg,zipfile," ") if zipfile=="" then goto zzcancel :viewdoit ziplist = StrCat(workdir, "wwwunzip.lst") If FileExist(ziplist) Then FileDelete(ziplist) RunWait("wwwzipls.exe","%zipfile% %ziplist% %zipsort%") if ViewFlag==0 then TSMsg="Select file to view" else TSMsg="Select file to extract" :TXSEL OldFont=IntControl(28,1,0,0,0) ; Set fixed pitch font in text box member=TextBox(TSMsg,ziplist) IntControl(28,OldFont,0,0,0) ; Restore previous font pitch type if member=="" then goto ZZCANCEL member=strsub(member,46,strlen(member)-45) memfile=FileExtension(member) if memfile!="" then memfile=strcat(FileRoot(member),".",memfile) else memfile=FileRoot(member) if ViewFlag==0 then goto extract if overwarn==0 then goto extract If FileExist("%targdir%%memfile%") == @FALSE Then Goto extract b= AskYesNo("%member% already exists in %targdir%", "Do you wish to replace it?") If b == @NO Then Goto TXSEL :extract RunHideWait("wwwdosc.pif", "pkunzip.exe -o %zipfile% %targdir% %member%") If !FileExist("%targdir%%memfile%") Then ErrMsg="Problem extracting %member% from ZIP file" Then Goto ShowError if ViewFlag!=0 then TSMsg="Extract Another?" then goto TXSEL member = StrUpper(StrCat(targdir, memfile)) RunZoomWait("browser.exe", member) FileDelete(member) TSMsg="View Another?" goto TXSEL :SHOWERROR Message("Error", ErrMsg) :ZZCANCEL if IsDefined(ziplist) then If FileExist(ziplist) Then FileDelete(ziplist) Drop(DaMove,DaDirs,DaWho,DaZip,DaRefresh,DaTitle,ViewFlag,zipsort) Drop(zipfile,b,RetHome,overwarn,targdir,workdir,ziplist,TSMsg,member) Drop(ErrMsg,usecurdir,ThisDir,CheckDir,memfile) Drop(ZippyFormat,ZippyCaption,ZippyX,ZippyY,ZippyWidth,ZippyHeight) Drop(ZippyNumControls,Zippy01,Zippy02,Zippy03,Zippy04,Zippy05,Zippy06) Drop(Zippy07,Zippy08,Zippy09,Zippy10,Zippy11,Zippy12,Zippy13) exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :DOOPTIONS zipsort = IniReadPvt("WWWUNZIP", "SortOrder", 1, "www-prod.ini") overwarn=IniReadPvt("WWWUNZIP","OverWarn",1,"www-prod.ini") whichdir=IniReadPvt("WWWUNZIP","WhichDir",1,"www-prod.ini") ; Undocumented, new, beta dialog function being used here. Will ; be documented in the 2.0 release. Good Luck. ZippyFormat=`WWWDLGED,4.0` ZippyCaption=`Zip Options` ZippyX=-1 ZippyY=-1 ZippyWidth=217 ZippyHeight=115 ZippyNumControls=13 Zippy01=`6,18,80,DEFAULT,RADIOBUTTON,whichdir,"Use Current Dir ->",1` Zippy02=`6,32,80,DEFAULT,RADIOBUTTON,whichdir,"Use Specified Dir ->",2` Zippy03=`86,32,124,DEFAULT,EDITBOX,targdir,""` Zippy04=`16,64,56,DEFAULT,RADIOBUTTON,zipsort,"by Name",1` Zippy05=`16,76,58,DEFAULT,RADIOBUTTON,zipsort,"by Extension",2` Zippy06=`16,88,46,DEFAULT,RADIOBUTTON,zipsort,"by Date",3` Zippy07=`16,100,46,DEFAULT,RADIOBUTTON,zipsort,"by Size",4` Zippy08=`108,58,80,DEFAULT,CHECKBOX,overwarn,"Warn on Overwrite",1` Zippy09=`120,78,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1` Zippy10=`120,98,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0` Zippy11=`6,4,64,DEFAULT,STATICTEXT,NONAME,"Target Directory"` Zippy12=`6,52,64,DEFAULT,STATICTEXT,NONAME,"Sort list by:"` Zippy13=`88,20,122,DEFAULT,VARYTEXT,ThisDir,""` :gettarg ; Undocumented, new, beta dialog function being used here. Will ; be documented in the 2.0 release. Good Luck. ThisDir=DirGet() targdir = IniReadPvt("WWWUNZIP", "TargetDir", DirGet(), "www-prod.ini") Dialog("Zippy") if whichdir==1 then usecurdir = @YES then targdir=ThisDir else usecurdir = @NO targdir = StrUpper(targdir) If targdir == "" Then usecurdir = @YES Then targdir = DirGet() If StrSub(targdir, StrLen(targdir), 1) != "\" Then targdir = StrCat(targdir, "\") If ThisDir==targdir then usecurdir = @YES then goto targok DirChange(targdir) CheckDir=DirGet() DirChange(ThisDir) If ThisDir!=CheckDir Then Goto targok b= AskYesNo("WWWUNZIP", "%targdir% does not exist. Do you wish to create it?") If b == @NO Then Goto gettarg DirMake(targdir) DirChange(targdir) CheckDir=DirGet() DirChange(ThisDir) If ThisDir!=CheckDir Then Goto targok Message("WWWUNZIP","%targdir% could not be created. Please respecify.") goto gettarg :targok If usecurdir == @NO Then IniWritePvt("WWWUNZIP", "TargetDir", targdir, "www-prod.ini") IniWritePvt("WWWUNZIP", "SortOrder", zipsort, "www-prod.ini") IniWritePvt("WWWUNZIP", "OverWarn", overwarn, "www-prod.ini") IniWritePvt("WWWUNZIP", "WhichDir", whichdir, "www-prod.ini") goto %RetHome% ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :CANCEL ; This cancel is shared by ALL the above routines. %CancelCmd% ; Execute Cancel Command