home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / va210-o2.zip / VWCSYSOP.DOC < prev    next >
Text File  |  1997-02-05  |  29KB  |  847 lines

  1.          
  2.          VWC SYSOP
  3.          ═════════
  4.  
  5.                 VWC is short for Virtual Windows Client -- a free
  6.          communications software program written for Microsoft 
  7.          Windows that your callers (and soon, telnet'ers) can use 
  8.          to access your Virtual Advanced Bulletin Board System.
  9.  
  10.                 VWC can do some pretty awesome things:
  11.  
  12.          -Open up to two standard GUI windows at a time
  13.  
  14.          -Place Command Buttons, Option Boxes, Check Boxes,
  15.           Text, and other GUI elements on each window
  16.  
  17.          -Flexible, efficient screen design language
  18.  
  19.          -Compatible with Windows-Standard .BMP, .ICO and .WAV formats
  20.  
  21.          -Dynamically transmit .BMP pictures for display and/or
  22.           .WAV sounds files for immediate play, and/or make use
  23.           of same files already on the caller's hard drive.
  24.  
  25.          -Built-In ANSI terminal window for handling plain text
  26.           and ansi color with "door games."
  27.           
  28.           For information related to using VWC to access boards,
  29.           see the VWC.DOC that comes with the VWC archive.  This 
  30.           document describes the VWC command set and gives examples.
  31.  
  32.           
  33.          VWC FILES
  34.          ═════════
  35.  
  36.                 Included with the basic Virtual Advanced set-up
  37.          are two kinds of *.VWC files; during INSTALL.EXE they
  38.          are automatically copied to your Text Directory.  The first
  39.          kind are the MENU/LOGIN files such as MAIN.VWC, LOGIN.VWC,
  40.          and so on.  The second kind are the R###.VWC files that
  41.          serves as replacements for external strings.
  42.  
  43.                 The first kind, the menus, typically draw out a whole
  44.          menu, or scene, and then wait for the user to make some type
  45.          of input -- clicking the mouse or using the keyboard.
  46.  
  47.                 The second kind, the replacements, are mostly scene
  48.          fragments, though some are complete scenes of their own.
  49.  
  50.                 There are three important rules when creating VWC files:
  51.  
  52.          1) The first line should always be blank
  53.  
  54.          2) Each line thereafter must begin with the "\"
  55.             character, or it will be interpreted as normal text.
  56.  
  57.          3) Parameters on the command line, if any, are separated
  58.             from the command and from each other by a single space
  59.             character.
  60.  
  61.  
  62.          VWC COMMAND SET
  63.          ═══════════════
  64.  
  65.          \@
  66.  
  67.              Closes all GUI windows currently open (if any).
  68.  
  69.          \!
  70.  
  71.              Clears the ANSI terminal window.
  72.  
  73.          \# <state>
  74.  
  75.              Set WindowState of the ANSI terminal window 
  76.              according to the value of <state>:
  77.              
  78.              <state> = 0  Normal
  79.              <state> = 1  Maximized
  80.              <state> = 2  Minimized
  81.  
  82.          \$
  83.  
  84.              Hides the ANSI terminal window.
  85.  
  86.          \^
  87.               
  88.              Unhides the ANSI terminal window.
  89.  
  90.          \a <color table>
  91.  
  92.              Set background color of the currently open GUI window
  93.              using <color table>:
  94.  
  95.              0 black    4 red        8 grey         12 light red
  96.              1 blue     5 magenta    9 light blue   13 light magenta
  97.              2 green    6 brown     10 light green  14 yellow
  98.              3 cyan     7 white     11 light cyan   15 bright white
  99.              
  100.          \A <RGB color>
  101.  
  102.              Set background color of the currently open GUI window
  103.              using <RGB color>. <RGB color> numbers are formed using 
  104.              the following pattern:
  105.  
  106.              &H00xxyyzz
  107.  
  108.              Where xx, yy, and zz are hexadecimal (00 to FF)
  109.              values defining the levels of Red (xx), Green (yy),
  110.              and Blue (zz).  The \A command gives finer detailed 
  111.              control over color usage than \a.
  112.  
  113.          \b <x1> <y1> <x2> <y2>
  114.  
  115.              Draws a box on the current GUI window using <x1>, <y1>
  116.              and <x2>, <y2> as coordinates of the upper-left and
  117.              lower-right corners, respectively.  The box is drawn
  118.              using the currently selected color (\c or \C).
  119.              
  120.              Maximum number of boxes per window: unlimited.
  121.  
  122.          \B <x1> <y1> <x2> <y2>
  123.  
  124.              Same as \b, but the box is drawn filled in.
  125.              
  126.              Maximum number of filled-in boxes per window: unlimited.
  127.  
  128.          \c <color table>
  129.  
  130.              Set foreground color of the currently open GUI window
  131.              using <color table>:
  132.  
  133.              0 black    4 red        8 grey         12 light red
  134.              1 blue     5 magenta    9 light blue   13 light magenta
  135.              2 green    6 brown     10 light green  14 yellow
  136.              3 cyan     7 white     11 light cyan   15 bright white
  137.          
  138.          \C <RGB color>
  139.  
  140.              Set foreground color of the currently open GUI window
  141.              using <RGB color>. <RGB color> numbers are formed using 
  142.              the following pattern:
  143.  
  144.              &H00xxyyzz
  145.  
  146.              Where xx, yy, and zz are hexadecimal (00 to FF)
  147.              values defining the levels of Red (xx), Green (yy),
  148.              and Blue (zz).  The \A command gives finer detailed 
  149.              control over color usage than \a.
  150.  
  151.          \d <text>
  152.  
  153.              Prints <text> on the currently open GUI window
  154.              at the current cursor position, using the current
  155.              foreground color.
  156.          
  157.          \D <x> <y>
  158.  
  159.              Sets the current cursor position of the GUI window.
  160.  
  161.          \e <left> <top> <width> <height>
  162.  
  163.              Initializes a text list-box in the current GUI window. 
  164.              <left> and <top> specify the location of the list-box,
  165.              relative the top left corner of the window.  <width>
  166.              and <height> specify the size of the list-box.
  167.              
  168.              Maximum number of list-boxes per window: 1.
  169.           
  170.          \E <item text...>
  171.  
  172.              Adds a text item to the list-box.
  173.  
  174.              Maximum number of item per list-box: 2000.
  175.  
  176.          \f <left> <top> <width> <height> <reserved> <default input>
  177.  
  178.              Pops up a text input box.  <left> and <top> specify the
  179.              location, <width> and <height> the size.  <reserved>
  180.              should always be 0.  <default input> (optional) is
  181.              text put into the text box for the user to edit or
  182.              press enter to accept as-is.
  183.          
  184.          \l <x1> <y1> <x2> <y2>
  185.  
  186.              Draws a line using the current foreground color, from
  187.              <x1>, <y1> to <x2>, <y2> on the current GUI window.
  188.  
  189.              Maximum number of lines per window: unlimited.
  190.  
  191.          \L <x> <y> <radius>
  192.  
  193.              Draws a circle using the current foreground color
  194.              with the center of the circle at coordinates <x>, <y>
  195.              and with the given <radius>.
  196.  
  197.              Maximum number of circles per window: unlimited.
  198.  
  199.          \m <left> <top> <width> <height> <closewindow> <return>
  200.  
  201.              Creates a command button on the current GUI window, located
  202.              at <left>, <top> relative to the window, with a size of
  203.              the given <width> and <height>.  
  204.              
  205.              <closewindow> is 1 if you want activation of the button 
  206.              to automatically close the window, 0 otherwise.  This is
  207.              handy from the BBS perspective as it simplifies things.
  208.              
  209.              <return> is the text you want VWC to send back when the 
  210.              button is clicked.
  211.              
  212.              For example, the default VWC menus set VWC to return
  213.              "/WHO" when someone clicks the "Who's Online" button.
  214.              To the BBS, clicking on a command button is the same
  215.              as when as a non-VWC caller type commands manually.
  216.  
  217.              Note: The Text Caption to be used for this newly created 
  218.                    button should have been set previously with the \t 
  219.                    command.
  220.  
  221.              Maximum number of buttons per window: 20.
  222.  
  223.          \M
  224.  
  225.              Removes the most recently created command button.
  226.  
  227.          \p <left> <top> <visible> <autosize> <filename> <closewindow> <return>
  228.  
  229.              Creates a picture-box on the current GUI window and loads
  230.              and displays Bitmap (BMP) pictures and Icon (ICO) files stored 
  231.              on the caller's hard drive.  \p is also used to call up icons
  232.              which have been package the ICONLIB.DAT file.
  233.  
  234.              <left> and <top> are coordinates relative to the current 
  235.              GUI window.
  236.              
  237.              <visible> specifies whether the picture should be made visible
  238.              immediately upon loading from disk.  Currently, this should
  239.              always be 1.
  240.  
  241.              <autosize> specifies whether windows should automatically
  242.              size the picture-box to fit the graphic.  Currently, this
  243.              should always be 1.
  244.  
  245.              <filename> specifies the file to load.  If <filename>
  246.              has no extension, then ICONLIB.DAT is searched.  If
  247.              the extension is .ICO, then the picture is loaded as
  248.              an icon file.  If the extension is .BMP, then the picture
  249.              is loaded as a bitmapped picture.
  250.  
  251.              <closewindow> and <return> are optional; they allow you
  252.              make a picture or icon a click-able command.  Their
  253.              meaning and usage as exactly the same as for the \m
  254.              command button command described previously.
  255.  
  256.              Maximum number of pictures per window: 22.
  257.  
  258.          \P
  259.              
  260.              Removes the most recently created picture-box.
  261.  
  262.          \s <filename> <options>
  263.  
  264.              Plays a WAV file, using the desired <options>. <filename>
  265.              should specify a WAV file on the hard drive (do include
  266.              the .WAV extension).  <options> are:
  267.  
  268.              0 Synchronous:   Processing Held Up Until Sound Completed
  269.              1 Asynchronous:  Processing Continues While Sound Plays
  270.  
  271.              The sound will stop when the entire WAV file has been played.
  272.  
  273.          \S
  274.  
  275.              Stops the playing of the WAV file, even if it hasn't
  276.              been played all the way through.
  277.  
  278.          \t <caption text>
  279.  
  280.              Sets the Caption Text to be used for next GUI window 
  281.              to be opened with the \w command, or the next command
  282.              button be created with the \m command.
  283.  
  284.          \T <milliseconds>
  285.  
  286.               Time delay for <milliseconds>. 1000 milliseconds = 1 sec.
  287.               Multi-tasking friendly.
  288.  
  289.          \w <left> <top> <width> <height> <visible>
  290.              
  291.              Creates a GUI window using the parameters given.  <left>
  292.              and <top> are relative to the whole screen, and <height>
  293.              and <width> control the size.  
  294.              
  295.              <visible> specifies whether the window should be made visible 
  296.              immediately upon its creation, and currently this should always
  297.              be set to 1.
  298.  
  299.              Note: The Text Caption to be used for this newly created 
  300.                    window should have been set previously with the \t 
  301.                    command.
  302.              
  303.              Maximum number of GUI windows: 2.
  304.  
  305.          \W
  306.  
  307.              Closes the most recently opened GUI window. 
  308.  
  309.          \x <filename> <overwrite>
  310.  
  311.             Dynamically plays WAV files.  If <overwrite> is 0,
  312.             then the user's hard drive is check for <filename>,
  313.             and if found it is immediately played.  If the
  314.             file is not found, then VWC will receive the file
  315.             with Ymodem, and then immediately play the file.
  316.             If <overwrite> is 1, then same-name copies of <filename>
  317.             on the user's hard drive are ignored, and a new file
  318.             is received with Ymodem, and then immediately played.
  319.             <filename> must have a .WAV or .WA$ extension.
  320.             
  321.             Note: <overwrite>=1 should only be used when the intention
  322.                   is to update an older version of the same file, or
  323.                   when you absolutely want to make sure that the file
  324.                   is retransmitted every time. Use <overwrite>=1
  325.                   sparingly.
  326.  
  327.          \X <filename> <left> <top> <overwrite>
  328.             
  329.             Dynamically loads and displays BMP files.  If <overwrite> is 0,
  330.             then the user's hard drive is check for <filename>,
  331.             and if found it is immediately displayed.  If the
  332.             file is not found, then VWC will receive the file
  333.             with Ymodem, and then immediately display the file.
  334.             If <overwrite> is 1, then same-name copies of <filename>
  335.             on the user's hard drive are ignored, and a new file
  336.             is received with Ymodem, and then immediately displayed.
  337.             <filename> must have a .BMP or .BM$ extension.
  338.             
  339.             Note: <overwrite>=1 should only be used when the intention
  340.                   is to update an older version of the same file, or
  341.                   when you absolutely want to make sure that the file
  342.                   is retransmitted every time. Use <overwrite>=1
  343.                   sparingly.
  344.  
  345.          \y
  346.  
  347.              Causes VWC to automatically enter YMODEM receive mode
  348.              to receive one or more files -- typically BMP, ICO, or 
  349.              WAV files.
  350.  
  351.              Note: This command can be used ONLY with a script.
  352.  
  353.          \Y
  354.             
  355.              Causes VWC to automatically enter YMODEM-G receive mode
  356.              to receive one or more files -- typically BMP, ICO, or 
  357.              WAV files.
  358.  
  359.              Note: This command can be used ONLY with a script.
  360.          
  361.          \z <RGB Color>
  362.              
  363.              Set foreground color of the currently open GUI window
  364.              using <RGB color>. <RGB color> numbers are formed using 
  365.              the following pattern:
  366.  
  367.              &H00xxyyzz
  368.  
  369.              Where xx, yy, and zz are hexadecimal (00 to FF)
  370.              values defining the levels of Red (xx), Green (yy),
  371.              and Blue (zz).  The \A command gives finer detailed 
  372.              control over color usage than \a.
  373.  
  374.          \Z <RGB Color>
  375.              
  376.              Set background color of the currently open GUI window
  377.              using <RGB color>. <RGB color> numbers are formed using 
  378.              the following pattern:
  379.  
  380.              &H00xxyyzz
  381.  
  382.              Where xx, yy, and zz are hexadecimal (00 to FF)
  383.              values defining the levels of Red (xx), Green (yy),
  384.              and Blue (zz).  The \A command gives finer detailed 
  385.              control over color usage than \a.
  386.  
  387.  
  388.          EXAMPLE VWC FILES
  389.          ═════════════════
  390.  
  391.                 The default Virtual Advanced package comes with dozens
  392.          of ready-to-use VWC files.  You may modify these files,
  393.          or use them as-is.  Please feel free to examine these files
  394.          and compare them to the information in this documentation.
  395.  
  396.  
  397.          COMMANDING VWC WITH SCRIPTS
  398.          ═══════════════════════════
  399.  
  400.                 There is a lot that can be done with "static" VWC
  401.          files, as has been previously described.  However, when
  402.          using Virtual Advacned script language to specifically
  403.          work with VWC, there lies true potential.
  404.  
  405.          First off, you'll need a way to detect from within script
  406.          when VWC is being used by the remote caller.  !23 is the
  407.          special script variable that gives the current video mode
  408.          as a number between 0 and 4:
  409.  
  410.          0 ASCII  
  411.          1 ANSI  
  412.          2 ANSI-Enhanced  
  413.          3 RIP  
  414.          4 VWC
  415.  
  416.          The following script code fragments demonstrate.  A lot of
  417.          comments (') have been put in for clarity.
  418.          
  419.          'Example showing how to branch to another
  420.          'part of the script if VWC is being used
  421.          '
  422.          ifval !23=4 goto vwcyes
  423.          '
  424.          'script code for non-VWC callers goes here
  425.          '
  426.          exit
  427.          '
  428.          vwcyes:
  429.          '
  430.          ' code for VWC callers goes here
  431.          '
  432.          exit
  433.          
  434.  
  435.          'Example showing how to skip over the entire script if VWC
  436.          'is not being used (ie..use for VWC-only script)
  437.          '
  438.          ifval !23<4 goto exitscript
  439.          '
  440.          'script code for VWC callers goes here
  441.          '
  442.          exitscript:
  443.          exit
  444.  
  445.          Now, for some real examples of script code that illustrate
  446.          how to command VWC interactively, dynamically, and how to
  447.          send data on-the-fly.
  448.  
  449.          The first example shows how to display a BMP file on the fly.
  450.          The bitmap has not been pre-compressed by PAK.EXE.  The bitmap 
  451.          file LOGO.BMP is assumed to reside in the Virtual Advanced main 
  452.          directory, waiting for occassions where it needs to be transmitted.
  453.  
  454. ?
  455. ? "\t LOGO.BMP"
  456. ? "\w 0 0 8000 6000 1"
  457. ? "\t &Close"
  458. ? "\m 0 0 1200 400 1 ^M"
  459. ? "\X LOGO.BMP 0 0 0"
  460. let x = "vxy " % !12 % " -YS LOGO.BMP"
  461. shell x
  462. delay 2
  463. pause
  464.  
  465.          Note that in the above example, the <overwrite> field is set to
  466.          0, meaning that the file will need to be transmitted from
  467.          the BBS to the remote caller if the file doesn't already
  468.          exist on the caller's system.  Here is the same example
  469.          with comments:
  470.  
  471. ?                                        <-- Required Blank Line
  472. ? "\t LOGO.BMP"                          <-- Set Text Caption For Window
  473. ? "\w 80 2000 8000 6000 1"               <-- Open GUI Window
  474. ? "\t &Close"                            <-- Set Text Caption For Button
  475. ? "\m 0 0 1200 400 1 ^M"                 <-- Create Close Button
  476. ? "\X LOGO.BMP 0 0 0"                    <-- VWC Download/Display BMP
  477. let x = "vxy " % !12 % " -YS LOGO.BMP"   <-- Prepare Command Line For BBS
  478. shell x                                  <-- Start VXY For Transfer
  479. delay 2                                  <-- Delay 2 Seconds
  480. pause                                    <-- Wait Click On Close Button
  481.  
  482.          Note that in all of these examples, the window sizes, button
  483.          sizes, captions, etc can be altered to suit your needs and/or
  484.          fit your BMP.
  485.          
  486.          The next example shows how to display a BMP file on the fly.
  487.          The bitmap has been pre-compressed by PAK.EXE.  The bitmap 
  488.          file BIRTHDAY.BM$ is assumed to reside in the Virtual Advanced main 
  489.          directory, waiting for occassions where it needs to be transmitted.
  490.  
  491. ?
  492. ? "\t BIRTHDAY.BMP"
  493. ? "\w 80 200 12000 8000 1"
  494. ? "\t &Close"
  495. ? "\m 0 0 1200 400 1 ^M"
  496. ? "\X BIRTHDAY.BMP 0 0 0"
  497. let x = "vxy " % !12 % " -YS BIRTHDAY.BMP"
  498. shell x
  499. delay 2
  500. pause
  501.  
  502.          Note that in the above example, the <overwrite> field is set to
  503.          0, meaning that the file will need to be transmitted from
  504.          the BBS to the remote caller if the file doesn't already
  505.          exist on the caller's system.  If you wanted to make sure
  506.          to overwrite any previous older version of the file:
  507.  
  508. ?
  509. ? "\t BIRTHDAY.BMP"
  510. ? "\w 80 200 12000 8000 1"
  511. ? "\t &Close"
  512. ? "\m 0 0 1200 400 1 ^M"
  513. ? "\X BIRTHDAY.BMP 0 0 1"
  514. let x = "vxy " % !12 % " -YS BIRTHDAY.BMP"
  515. shell x
  516. delay 2
  517. pause
  518.  
  519.          The following example illustrates how to make VWC play
  520.          a WAV file on-the-fly:
  521.  
  522. ?
  523. ? "\x WELCOME.WA$ 0"
  524. let x = "vxy " % !12 % " -YS WELCOME.WA$"
  525. shell x
  526. delay 2
  527.  
  528.          Note that it wasn't required to open a window to play a sound.
  529.          Note also that the <overwrite> field is set to 0, indicating
  530.          that the file will only be retransmitted if necessary.  If you
  531.          wanted to update the file you would instead use:
  532.  
  533. ?
  534. ? "\x WELCOME.WA$ 1"
  535. let x = "vxy " % !12 % " -YS WELCOME.WA$"
  536. shell x
  537. delay 2
  538.  
  539.          The next example is more complex than the previous examples.  
  540.          It details a complete script, using GUI windows with command
  541.          buttons as interactive menus, displaying the weather map
  542.          (.BM$ picture) requested by the user:
  543.  
  544. 'Required start
  545. ?
  546. ? "\$"
  547. top:
  548. 'Display menu to user
  549. suspendpagebreak
  550. ? "\t Weather Information"
  551. ? "\w 1600 1500 5540 4150 1"
  552. ? "\t &High Temps"
  553. ? "\m 200 100 2400 400 0 1"
  554. ? "\t &Low Temps"
  555. ? "\m 200 600 2400 400 0 2"
  556. ? "\t &Extended Forecast"
  557. ? "\m 200 1100 2400 400 0 3"
  558. ? "\t &24hr Precip"
  559. ? "\m 200 1600 2400 400 0 4"
  560. ? "\t &Precip Forecast"
  561. ? "\m 200 2100 2400 400 0 5"
  562. ? "\t S&unshine Forecast"
  563. ? "\m 200 2600 2400 400 0 6"
  564. ? "\t US &Radar"
  565. ? "\m 2800 100 2400 400 0 C"
  566. ? "\t Northern Radar"
  567. ? "\m 2800 600 2400 400 0 A"
  568. ? "\t Southern Radar"
  569. ? "\m 2800 1100 2400 400 0 B"
  570. ? "\t National &Satellite" 
  571. ? "\m 2800 1600 2400 400 0 F"
  572. ? "\t Eastern Satellite"
  573. ? "\m 2800 2100 2400 400 0 D"
  574. ? "\t Western Satellite"
  575. ? "\m 2800 2600 2400 400 0 E"
  576. ? "\t E&xit"
  577. ? "\m 200 3100 5000 400 0 Q"
  578. resumepagebreak
  579. 'Get user input & execute choice
  580. rc a
  581. if a="Q" goto quit
  582. if a="1" goto ht
  583. if a="2" goto lt
  584. if a="3" goto ext
  585. if a="4" goto 24hr
  586. if a="5" goto p2us
  587. if a="6" goto snus
  588. if a="A" goto rne_
  589. if a="B" goto rse_
  590. if a="C" goto rus
  591. if a="D" goto es
  592. if a="E" goto ws
  593. if a="F" goto us
  594. goto top
  595. quit:
  596. ?
  597. ? "\W"
  598. ? "\#"
  599. exit
  600. ht:
  601. let f="HT??.bm$"
  602. let z="High Temps"
  603. let n=2
  604. gosub dofiles
  605. goto top
  606. lt:
  607. let f="LT??.bm$"
  608. let z="Low Temps"
  609. let n=2
  610. gosub dofiles
  611. goto top
  612. ext:
  613. let f="?EWX.bm$"
  614. let z="Extended Forecast"
  615. let n=3
  616. gosub dofiles
  617. goto top
  618. 24hr:
  619. let f="24hr.bm$"
  620. let z="Past 24hr Precipitation"
  621. let n=1
  622. gosub dofiles
  623. goto top
  624. p2us:
  625. let f="p2us.bm$"
  626. let z="Next 24hr Precipitation Forecast"
  627. let n=1
  628. gosub dofiles
  629. goto top
  630. snus:
  631. let f="snus.bm$"
  632. let z="Sunshine Forecast"
  633. let n=1
  634. gosub dofiles
  635. goto top
  636. rne_:
  637. let f="rn?_.bm$"
  638. let z="Northern Radar"
  639. let n=3
  640. gosub dofiles
  641. goto top
  642. rse_:
  643. let f="rs?_.bm$"
  644. let z="Southern Radar"
  645. let n=3
  646. gosub dofiles
  647. goto top
  648. rus:
  649. let f="rus_.bm$"
  650. let z="US Radar"
  651. let n=1
  652. gosub dofiles
  653. goto top
  654. es:
  655. let f="se0?.bm$"
  656. let z="Eastern Satellite"
  657. let n=2
  658. gosub dofiles
  659. goto top
  660. ws:
  661. let f="sw0?.bm$"
  662. let z="Western Satellite"
  663. let n=2
  664. gosub dofiles
  665. goto top
  666. us:
  667. let f="su0?.bm$"
  668. let z="National Satellite"
  669. let n=2
  670. gosub dofiles
  671. goto top
  672. 'Get files by filemask and deliver to caller
  673. dofiles:
  674. let c=0
  675. ?
  676. ? "\W"
  677. ? "\t ", z, " [", n, " view(s)]"
  678. ? "\w 0 0 9600 7200 1"
  679. let g="f:\fs\weather\"%f
  680. findfirst a,g
  681. loop1:
  682. let c=c+1
  683. ifval n=1 goto nonext
  684. ? "\t &Next (",c," of ",n,")"
  685. ? "\m 1600 0 1600 400 0 N"
  686. nonext:
  687. ? "\t E&xit"
  688. ? "\m 0 0 1600 400 0 ^M"
  689. if a="" goto nofiles
  690. let x="copy f:\fs\weather\"%a%" demand.bm$ >nul"
  691. shell x
  692. ? "\X DEMAND.bm$ 0 0 1"
  693. let x = "VXY " % !12 % " -YS DEMAND.bm$"
  694. shell x
  695. delay 1
  696. rc a
  697. if a<>"N" goto nofiles
  698. findnext a
  699. ?
  700. goto loop1
  701. nofiles:
  702. ?
  703. ? "\W"
  704. return
  705.  
  706.          Note: The above example specifies a number of .BM$ files
  707.          which are assumed to be already existing at f:\fs\weather.
  708.          Also, notice that the file is copied to DEMAND.BM$ before
  709.          transmission; this is so that each successive DEMAND.BM$
  710.          overwrites the previous, and the weather maps do not
  711.          "pile up" on a user's system.  If you wanted to save
  712.          the pictures on the user's hard drive so that they could 
  713.          review it later, offline with a BMP viewer, we'd replace
  714.          the following segment:
  715.  
  716. let x="copy f:\fs\weather\"%a%" demand.bm$ >nul"
  717. shell x
  718. ? "\X DEMAND.bm$ 0 0 1"
  719. let x = "VXY " % !12 % " -YS DEMAND.bm$"
  720. shell x
  721. delay 1
  722.  
  723.          with:
  724.  
  725. let x="copy f:\fs\weather\"%a%" "%a%" >nul"
  726. shell x
  727. ? "\X ",a," 0 0 1"
  728. let x = "VXY " % !12 % " -YS "%a
  729. shell x
  730. delay 1
  731.  
  732.          For an example batch file showing how to convert from
  733.          a different format and then compress the BMP with PAK.EXE,
  734.          see the following chapter.
  735.  
  736.  
  737.          PAK.EXE, BMP FILES, WAV FILES
  738.          ═════════════════════════════
  739.  
  740.                 PAK.EXE is a single-file compression/decompression
  741.          utility program.  It operates on a command line basis:
  742.  
  743.          PAK c <infile> <outfile>
  744.  
  745.               Compress the contents of <infile>, yielding <outfile>.
  746.  
  747.          PAK d <infile> <outfile>
  748.  
  749.               Decompress the contents of <infile>, yielding <outfile>.
  750.  
  751.          PAK.EXE does not make any assumptions about filename extensions,
  752.          so make sure you include extensions.  PAK was mainly designed   
  753.          to be used in conjunction with VWC, as it yields excellent
  754.          compression ratios with .BMPs and .WAVs -- two items that VWC
  755.          can work with, although there are bound to be other uses.
  756.  
  757.          Examples for using PAK.EXE with VWC are as follows:
  758.  
  759.          For BMP Files: 
  760.          
  761.            PAK c filename.bmp filename.bm$
  762.  
  763.          For WAV Files: 
  764.          
  765.            PAK c filename.wav filename.wa$
  766.  
  767.          Note the $ on the end of the output filename.  When VWC
  768.          receives this file as part of a \x or \X transfer, it
  769.          will automatically call upon the VWC-included version
  770.          of PAK.EXE to decompress the .BM$ to .BMP and .WA$ to
  771.          .WAV before trying to make use of the file.
  772.                 
  773.                 The only type of accepted BMP files for use with
  774.          VWC are Standard BMP files, and another type called
  775.          compressed BMP files (has nothing to do with PAK.EXE).
  776.  
  777.          If the source data you have is in a different format, you
  778.          can get a shareware program to convert whatever you have
  779.          into stardard or compressed bitmaps.  From there, you can
  780.          you PAK.EXE to compress a standard or compressed bitmap
  781.          even further.  Ratios of 4:1 to 10:1 are not uncommon.
  782.  
  783.          One such shareware program is called Image Alchemy.
  784.  
  785.          Here is an example from an actual batch file I used
  786.          to use with Planet Connect to make the weather maps
  787.          available to VWC callers.  The batch file would run
  788.          as an event. The weather map data file would come in as
  789.          WEATHER.ARC (even though it was ZIPed).  Inside each
  790.           ZIP was several PCX format graphic. Comments have been
  791.          added:
  792.  
  793.          'Check to see if new weather file received
  794.          if not exist z:\weather\weathmap.arc goto nosat
  795.  
  796.          'If so, copy it to a storage area
  797.          copy z:\weather\weathmap.arc f:\fs\weather >nul
  798.  
  799.          'And delete the copy from the Planet Connect computer
  800.          del z:\weather\weathmap.arc
  801.  
  802.          'Unzip it to get the PCX files out (unzip is an OS2 util)
  803.          'DOS users instead use:
  804.          'pkunzip f:\fs\weather\weathmap.arc f:\fs\weather
  805.          unzip -j f:\fs\weather\weathmap.arc -d f:\fs\weather
  806.  
  807.          'Convert the PCX files (about 200k) to compressed .BMP files 
  808.          '(about 40k)
  809.          alchemy f:\fs\weather\*.pcx f:\fs\weather -o -w -p1
  810.  
  811.          'Delete the PCX files
  812.          del f:\fs\weather\*.pcx
  813.  
  814.          :nosat
  815.          'Check to see if any files need PAKing
  816.          if not exist f:\fs\weather\*.bmp goto nobmp
  817.  
  818.          'Do a rename from .BMP to .BM
  819.          ren f:\fs\weather\*.bmp *.bm
  820.  
  821.          'PAK each .BM file to .BM$ 
  822.          for %%i in (f:\fs\weather\*.bm) do pak c %%i %%i$
  823.  
  824.          'Delete the .BM files
  825.          del f:\fs\weather\*.bm
  826.  
  827.          :nobmp
  828.  
  829.          After the batch file executes, all unneeded files have
  830.          been cleaned up, and what is leftover is the original
  831.          WEATHER.ARC (so you can let non-VWC use download it and
  832.          view offline), and the .BM$ files which are now ready
  833.          for transmission to VWC as needed by a Virtual Advanced
  834.          script.  The resultant .BM$ files are in the 8k to
  835.          20k size range -- they transmit quickly, efficiently.
  836.          
  837.          Considering that the original PCX file may have
  838.          been 160k to 200k in size, that is an awesome amount
  839.          of overall data compression without any lossiness.
  840.  
  841.                 Use PAK.EXE to compress WAV files also.  When selecting
  842.          and/or creating WAV files, bear in mind that higher sampling
  843.          rates, and/or use of stereo over mono will have a direct
  844.          bearing on file size, and that not all sound cards have the
  845.          exact same capabilities.
  846.  
  847.