home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / w3_disk / fc-11f.arj / WWWFC3.MN$ < prev    next >
Text File  |  1992-07-15  |  11KB  |  336 lines

  1. ; Da AutoExec Section is on top here.  Actually runs before File Manager
  2. ; actually appears on the screen
  3. ; These variables should already be defined by the first menu file,
  4. ; but just to make sure...
  5.  
  6.         TAB=num2char(9)
  7.         CR=strcat(num2char(13),num2char(10))
  8.  
  9. Edit &INI files
  10.         DirChange(DirWindows(0))
  11.         canned="BYEBYE"
  12.         IniFiles=""
  13.         bSys386=0
  14.  
  15.         :UP1
  16.         canned="byebye"
  17.         If IniFiles!="" then goto inied
  18.         IniFiles=FileItemize("*.INI")
  19.         :inied
  20.         ButtonNames("&Edit File","&Quit")
  21.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  22.         if TheFile=="" then goto newini
  23.         Sections=""
  24.  
  25.         :UP2
  26.         canned="up1"
  27.         if Sections!="" then goto sected
  28.         Sections=IniItemizePvt("",TheFile)
  29.         :SECTED
  30.         ButtonNames("&Edit Section","&Up a Level")
  31.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  32.         if Section=="" then goto AddSect
  33.         if stricmp(Section,"386Enh")==0 then bSys386=1
  34.                                         else bSys386=0
  35.         KeyValues=""
  36.  
  37.         :UP3
  38.         canned="up2"
  39.         if KeyValues!="" then goto looped
  40.         Keys=IniItemizePvt(Section,TheFile)
  41.         if (bSys386) then Keys=StrReplace(Keys,"device%TAB%","")
  42.                      then Keys=StrReplace(Keys,"Device%TAB%","")
  43.                      then Keys=StrReplace(Keys,"DEVICE%TAB%","")
  44.                      then Keys=StrReplace(Keys,"device","")
  45.                      then Keys=StrReplace(Keys,"Device","")
  46.                      then Keys=StrReplace(Keys,"DEVICE","")
  47.         KeyMax=ItemCount(Keys,TAB)
  48.         KeyIndex=0
  49.  
  50.         :Loop
  51.         if KeyIndex==KeyMax then goto looped
  52.         KeyIndex=KeyIndex+1
  53.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  54.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  55.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  56.         goto Loop
  57.  
  58.         :looped
  59.         ButtonNames("&Edit KeyWord","&Up a Level")
  60.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  61.         if Key=="" then goto AddKey
  62.         Key=ItemExtract(1,Key,"=")
  63.  
  64.         Value=IniReadPvt(Section,Key,"???",TheFile)
  65.         goto entkey
  66.  
  67.  
  68.         :newini
  69.         canned="UP1"
  70.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  71.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  72.         IniFiles=""
  73.         goto AddSectNewIni
  74.  
  75.         :AddSect
  76.         canned="up2"
  77.         :AddSectNewIni
  78.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  79.         Sections=""
  80.         goto AddKeyNewSect
  81.  
  82.         :AddKey
  83.         canned="up3"
  84.         :AddKeyNewSect
  85.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  86.         if (bSys386 && stricmp(Key,"device"==0)) then Message("Error","Cannot modify or add DEVICE= lines to [386Enh]%CR%with this utility")
  87.                                                  then goto AddKeyNewSect
  88.         Value="(Undefined)"
  89.         KeyValues=""
  90.         goto EntKeyNewKey
  91.  
  92.         :ENTKEY
  93.         canned="up3"
  94.         :EntKeyNewkey
  95.         NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  96.         if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  97.         KeyValues=""
  98.         goto up3
  99.  
  100.         :CANCEL
  101.         goto %Canned%
  102.  
  103.         :BYEBYE
  104.         exit
  105.  
  106.  
  107.  
  108. _&Wallpaper
  109.  Change &Wallpaper
  110.            a=strcat(CurrentPath(),CurrentFile()) ; Is a BMP file hilited?
  111.            if FileExtension(a)=="BMP" then goto doit
  112.            a=FileItemize("*.bmp")                ; No?  Any in Current Directory?
  113.            if a!="" then goto sel
  114.            dirchange(DirWindows(0))              ; No? Try whereever you hide your main bmp files
  115.            a=fileitemize("*.bmp")
  116.            :sel
  117.            a=strcat("-None- ",a)
  118.            a=ItemSelect("Select New Wallpaper",a," ")
  119.            terminate(a=="","Wallpaper","No wallpaper selected")
  120.            if a=="-None-" then Wallpaper("",0)
  121.                           then exit
  122.            a=strcat(DirGet(),a)
  123.            :doit
  124.            tile=@FALSE
  125.            if FileSize(a)<40000 then tile=@TRUE
  126.            ;if bmp size less than 40K, assume tile, else center
  127.            iniwritepvt("wallpaper","current",FileRoot(a),"www-prod.ini")
  128.            Wallpaper(a,tile)
  129.            b=inireadpvt("wallpaper",FileRoot(a),"XXX","www-prod.ini")
  130.            if b!="XXX" then WinPlace(%b%,"")
  131.            ;  then IntControl(23,IntControl(20,0,0,0,0),551,0,0)   ;MDI CASCADE (no work??)
  132.            drop(a,b,tile)
  133.  Set FM Window for current WP
  134.            Pause("File Manager Mover","Save current FM position for this wallpaper?")
  135.            a=WinPosition("")
  136.            b=inireadpvt("wallpaper","current","default.bmp","www-prod.ini")
  137.            iniwritepvt("wallpaper",b,a,"www-prod.ini")
  138.            drop(a,b)
  139.  
  140. Sound Tricks
  141.  Play WAV file
  142.         a=CurrentFile()
  143.         if FileExtension(a)=="WAV" then goto play
  144.         a=FileItemize("*.wav")
  145.         if a!="" then goto sel
  146.         dirchange(DirWindows(0))        ; Where ever you hide your main wav files
  147.         a=fileitemize("*.wav")
  148.         :sel
  149.         a=itemselect("Waveform",a," ")
  150.         if a=="" then exit
  151.         :play
  152.         playwaveform(a,1)
  153.  
  154.  Play whole dir of wav files
  155.         old=Sounds(0)
  156.         a=FileItemize("*.WAV")
  157.         if a=="" then goto oop
  158.         count=itemcount(a,' ')
  159.         index=0
  160.         :loop
  161.         index=index+1
  162.         if index>count then goto zoop
  163.         b=itemextract(index,a,' ')
  164.         playwaveform(b,1)
  165.         display(3,index,b)
  166.         goto loop
  167.         :oop
  168.         message("???","No wav files in directory")
  169.         :zoop
  170.         sounds(old)
  171.  
  172.  Play MID file
  173.         a=CurrentFile()
  174.         if FileExtension(a)=="MID" then goto play
  175.         a=FileItemize("*.mid")
  176.         if a!="" then goto sel
  177.         dirchange(DirWindows(0))        ; Where ever you hide your main mid files
  178.         a=fileitemize("*.mid")
  179.         :sel
  180.         a=itemselect("MIDI Player",a," ")
  181.         if a=="" then exit
  182.         :play
  183.         a=strcat(DirGet(),a)
  184.         playmidi(a,1)
  185.  
  186.  Play a CD
  187.         PlayMedia("open cdaudio shareable alias donna notify")
  188.         PlayMedia("set donna time format tmsf")
  189.         PlayMedia("play donna from 1")
  190.         PlayMedia("close donna")
  191.  
  192. _ZIP...
  193.  Zip Current File
  194.   Keep Current File
  195.         call("wwwzip.dll","zip current keep")
  196.   Move File to Zip
  197.         call("wwwzip.dll","zip current move")
  198.  
  199.  Zip Directory
  200.   Keep Files
  201.         call("wwwzip.dll","zip dir keep")
  202.   Move Files to Zip
  203.         call("wwwzip.dll","zip dir move")
  204.  
  205.  Zip Directory and Subdirs
  206.   Keep Files
  207.         call("wwwzip.dll","zip subdir keep")
  208.   Move Files to Zip
  209.         call("wwwzip.dll","zip subdir move")
  210.  
  211.  Zip Hilited Files
  212.   Keep Files
  213.         call("wwwzip.dll","zip hilited keep")
  214.   Move Files to Zip
  215.         call("wwwzip.dll","zip hilited move")
  216.  
  217.  
  218.  _UnZip
  219.   All files
  220.    Into Current Dir
  221.         call("wwwzip.dll","unzip all 1")
  222.    Specify Options
  223.         call("wwwzip.dll","unzip all 2")
  224.   Individual
  225.    Into Cur Dir/Overwrite
  226.         call("wwwzip.dll","unzip indiv 1")
  227.    Specify Options
  228.         call("wwwzip.dll","unzip indiv 2)
  229.  
  230.  _&View contents
  231.   By &Name
  232.         call("wwwzip.dll","unzip view 1")
  233.   By &Extension
  234.         call("wwwzip.dll","unzip view 2")
  235.   By &Date
  236.         call("wwwzip.dll","unzip view 3")
  237.   By &Size
  238.         call("wwwzip.dll","unzip view 4")
  239.  
  240.  
  241. _Phone Book
  242.         ; This code implements a phone dialer with WIL language statements.
  243.         ; The phone numbers are kept in the FONEBOOK.TXT file.  It is simply a text
  244.         ; file with name followed by number.  This code assumes everything after the
  245.         ; last space is part of the phone number.
  246.  
  247.         ; The code also assumes that the COM port has been correctly set up in the
  248.         ; PORTS section of the control panel.  Mostly be sure the Control Panel
  249.         ; ports section has the right baud rate for your modem in it.
  250.  
  251.         ; User initialization section.  Set these to correspond to your modem commands.
  252.         ; Most users will only have to check the ComPort setting.
  253.  
  254.         ComPort=IniReadPvt("FileCmdr","PhonePort","ASK","WWW-PROD.INI")
  255.         XPort=ComPort
  256.         CancelCmd="Exit"
  257.         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")
  258.         if XPort=="" then exit
  259.         if XPort!=ComPort then IniWritePvt("FileCmdr","PhonePort",Xport,"WWW-PROD.INI")
  260.                           then ComPort=XPort
  261.  
  262.         DialPrefix="ATDT"
  263.         HangCommand="ATH0"
  264.  
  265.         ; And here we go.  First make a CR/LF and a TAB
  266.         CR=strcat(num2char(13),num2char(10))
  267.         TAB=num2char(9)
  268.  
  269.         ; Use Home Directory
  270.         DirChange(DirHome())
  271.         ; Make sure there is a fonebook.txt file
  272.         if !FileExist("FONEBOOK.TXT") then fp=FileOpen("FONEBOOK.TXT","WRITE")
  273.                                       then FileWrite(fp,"Wilson WindowWare%TAB%1-206-938-1740")
  274.                                       then FileWrite(fp,"Emergency Services%TAB%911")
  275.                                       then FileWrite(fp,"Directory Assistance%TAB%1-555-1212")
  276.                                       then FileClose(fp)
  277.  
  278.  
  279.         ; Put up the TextBox so the user can choose a number
  280.         :NewNum
  281.         CancelCmd="Exit"                   ; What to do if user hits "Cancel"
  282.         num=StrTrim(TextBox("DIALER - Just hit OK to add a new number","fonebook.txt"))
  283.  
  284.         if num!="" then goto zorkle
  285.  
  286.  
  287.  
  288.         num=strtrim(AskLine("DIALER","Enter name and number as in","Joe Blough  1-555-1212"))
  289.         Terminate(num=="","","")
  290.         a=StrIndex(num," ",0,@BACKSCAN)
  291.         num2=strsub(num,a+1,strlen(num)-a)
  292.         num=strtrim(strsub(num,1,a-1))
  293.         num=strcat(num,TAB,num2)
  294.         fp=FileOpen("temp876.num","WRITE")
  295.         FileWrite(fp,num)       ; send it the number to dial
  296.         FileClose(fp)
  297.         FileAppend("temp876.num","fonebook.txt")
  298.         FileDelete("temp876.num")
  299.         goto newnum
  300.  
  301.         :zorkle
  302.         a=StrIndex(num," ",0,@BACKSCAN)
  303.         b=Strindex(num,TAB,0,@BACKSCAN)
  304.         a=max(a,b)
  305.         num=strsub(num,a+1,strlen(num)-a)
  306.         DialCommand="%DialPrefix%%NUM%;"
  307.  
  308.  
  309.         :redial
  310.         fp=FileOpen(ComPort,"WRITE")
  311.         FileWrite(fp,"ATZ")        ; Send a CR to wake modem up
  312.         Delay(2)                   ; Let it get out of bed.
  313.         FileWrite(fp,DialCommand)
  314.         FileClose(fp)
  315.         Delay(3)                   ; Give modem a chance to think
  316.  
  317.         CancelCmd="Goto Hang1"
  318.         a=AskYesNo("Dialer","Yes=HANGUP%CR%No=REDIAL%CR%Cancel=New Number")
  319.  
  320.         fp=FileOpen(ComPort,"WRITE")
  321.         FileWrite(fp,HangCommand)
  322.         FileClose(fp)
  323.  
  324.         if a==@YES then exit
  325.         Display(30,"Dialer","Redial Wait")
  326.         goto redial
  327.  
  328.         :CANCEL
  329.         %CancelCmd%
  330.  
  331.         :Hang1
  332.         fp=FileOpen(ComPort,"WRITE")
  333.         FileWrite(fp,HangCommand)
  334.         FileClose(fp)
  335.         goto NewNum
  336.