home *** CD-ROM | disk | FTP | other *** search
Wrap
; Da AutoExec Section is on top here. Actually runs before File Manager ; actually appears on the screen ; These variables should already be defined by the first menu file, ; but just to make sure... TAB=num2char(9) CR=strcat(num2char(13),num2char(10)) Edit &INI files DirChange(DirWindows(0)) canned="BYEBYE" IniFiles="" bSys386=0 :UP1 canned="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 canned="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 canned="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 :Loop 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 Loop :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 canned="UP1" TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI") if (TheFile=="*.INI" || TheFile=="") then goto newini IniFiles="" goto AddSectNewIni :AddSect canned="up2" :AddSectNewIni Section=AskLine("Add New Section to INI File","Enter new section name for%CR% %TheFile%%CR% [?????]","") Sections="" goto AddKeyNewSect :AddKey canned="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 canned="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 :CANCEL goto %Canned% :BYEBYE exit _&Wallpaper Change &Wallpaper a=strcat(CurrentPath(),CurrentFile()) ; Is a BMP file hilited? if FileExtension(a)=="BMP" then goto doit a=FileItemize("*.bmp") ; No? Any in Current Directory? if a!="" then goto sel dirchange(DirWindows(0)) ; No? Try whereever you hide your main bmp files a=fileitemize("*.bmp") :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) :doit tile=@FALSE if FileSize(a)<40000 then tile=@TRUE ;if bmp size less than 40K, assume tile, else center iniwritepvt("wallpaper","current",FileRoot(a),"www-prod.ini") Wallpaper(a,tile) b=inireadpvt("wallpaper",FileRoot(a),"XXX","www-prod.ini") if b!="XXX" then WinPlace(%b%,"") ; then IntControl(23,IntControl(20,0,0,0,0),551,0,0) ;MDI CASCADE (no work??) drop(a,b,tile) Set FM Window for current WP Pause("File Manager Mover","Save current FM position for this wallpaper?") a=WinPosition("") b=inireadpvt("wallpaper","current","default.bmp","www-prod.ini") iniwritepvt("wallpaper",b,a,"www-prod.ini") drop(a,b) Sound Tricks Play WAV file a=CurrentFile() if FileExtension(a)=="WAV" then goto play a=FileItemize("*.wav") if a!="" then goto sel dirchange(DirWindows(0)) ; Where ever you hide your main wav files a=fileitemize("*.wav") :sel a=itemselect("Waveform",a," ") if a=="" then exit :play playwaveform(a,1) Play whole dir of wav files old=Sounds(0) a=FileItemize("*.WAV") if a=="" then goto oop count=itemcount(a,' ') index=0 :loop index=index+1 if index>count then goto zoop b=itemextract(index,a,' ') playwaveform(b,1) display(3,index,b) goto loop :oop message("???","No wav files in directory") :zoop sounds(old) Play MID file a=CurrentFile() if FileExtension(a)=="MID" then goto play a=FileItemize("*.mid") if a!="" then goto sel dirchange(DirWindows(0)) ; Where ever you hide your main mid files a=fileitemize("*.mid") :sel a=itemselect("MIDI Player",a," ") if a=="" then exit :play a=strcat(DirGet(),a) playmidi(a,1) Play a CD PlayMedia("open cdaudio shareable alias donna notify") PlayMedia("set donna time format tmsf") PlayMedia("play donna from 1") PlayMedia("close donna") _ZIP... Zip Current File Keep Current File call("wwwzip.dll","zip current keep") Move File to Zip call("wwwzip.dll","zip current move") Zip Directory Keep Files call("wwwzip.dll","zip dir keep") Move Files to Zip call("wwwzip.dll","zip dir move") Zip Directory and Subdirs Keep Files call("wwwzip.dll","zip subdir keep") Move Files to Zip call("wwwzip.dll","zip subdir move") Zip Hilited Files Keep Files call("wwwzip.dll","zip hilited keep") Move Files to Zip call("wwwzip.dll","zip hilited move") _UnZip All files Into Current Dir call("wwwzip.dll","unzip all 1") Specify Options call("wwwzip.dll","unzip all 2") Individual Into Cur Dir/Overwrite call("wwwzip.dll","unzip indiv 1") Specify Options call("wwwzip.dll","unzip indiv 2) _&View contents By &Name call("wwwzip.dll","unzip view 1") By &Extension call("wwwzip.dll","unzip view 2") By &Date call("wwwzip.dll","unzip view 3") By &Size call("wwwzip.dll","unzip view 4") _Phone Book ; 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. ComPort=IniReadPvt("FileCmdr","PhonePort","ASK","WWW-PROD.INI") XPort=ComPort CancelCmd="Exit" 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,"Wilson WindowWare%TAB%1-206-938-1740") then FileWrite(fp,"Emergency Services%TAB%911") then FileWrite(fp,"Directory Assistance%TAB%1-555-1212") then FileClose(fp) ; Put up the TextBox so the user can choose a number :NewNum CancelCmd="Exit" ; What to do if user hits "Cancel" num=StrTrim(TextBox("DIALER - Just hit OK to add a new number","fonebook.txt")) if num!="" then goto zorkle num=strtrim(AskLine("DIALER","Enter name and number as in","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(num,TAB,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 CancelCmd="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 :CANCEL %CancelCmd% :Hang1 fp=FileOpen(ComPort,"WRITE") FileWrite(fp,HangCommand) FileClose(fp) goto NewNum