home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / v611docs.zip / VMAIN611.ZIP / VC10-AF < prev    next >
Text File  |  1993-10-08  |  8KB  |  186 lines

  1.                                             VBBS 6.11 Documentation -- 10-F-1
  2.  
  3.  
  4.          ╔════════════════════════════════════════════════════════════════╗
  5.          ║ CHAPTER TEN ANNEX F      CONTROL COMMANDS                      ║
  6.          ╚════════════════════════════════════════════════════════════════╝
  7.  
  8.  
  9.          GENERAL REDIRECTION
  10.          ═══════════════════
  11.  
  12.          # ->  # <label>
  13.  
  14.                 This command allows you to set points up within your script
  15.            that the various other control commands can use.
  16.                    ex:  TR "Hello "
  17.                         GO skipit
  18.                         TR "You wont see this text..."
  19.                         # skipit
  20.                         TR "Because you just jumped down to here!!"
  21.  
  22.          CALL ->  CALL <label>
  23.  
  24.                 This forces the script to go to <label> and continue to
  25.            run from there.  When a RET is found the script will go back
  26.            to the line after the CALL command.
  27.  
  28.          GO ->  GO <label>
  29.  
  30.                 This forces the script to go to <label> just like the CALL
  31.            command, with the only difference being that it will not return
  32.            if it encounters an RET statement.
  33.  
  34.          RET <---
  35.  
  36.                 This returns a script from a routine CALLed to the line
  37.            after the CALL statement.  Note: RET is ignored if there was
  38.            no CALL statement used.
  39.  
  40.  
  41.          LOOPS AND COMPARISONS
  42.          ═════════════════════
  43.  
  44.                 VSCRIPT supports some of the more common forms of loops
  45.            and comparison structures.  These are all covered below but
  46.            note that the script language can not generally handle nested
  47.            loops easily, so some testing must be done before you create
  48.            any scripts using such combinations.
  49.  
  50.          DO LOOPS
  51.          ────────
  52.  
  53.          ->  DO <variable1> = <value2> <value3>
  54.                   [body of the loop]
  55.              LOOP
  56.  
  57.                 This type of loop begins with <variable1> equal to
  58.  
  59.  
  60.                                             VBBS 6.11 Documentation -- 10-F-2
  61.  
  62.  
  63.            <value2>.  Each time it reaches the LOOP it adds 1 to it
  64.            and continues until <variable1> is greater than <value3>.
  65.  
  66.          ->  DO WHILE <variable1>   {must store a numeric!}
  67.                   [body of the loop]
  68.              LOOP
  69.  
  70.                 This type continues to loop until <variable1> = 0. You
  71.            must have some way to either exit the loop, or have a place
  72.            where <variable1> is set to 0 or the script will lock into an
  73.            endless loop.
  74.  
  75.  
  76.          IF/IFVAL STRUCTURES
  77.          ───────────────────
  78.  
  79.                 IF structures allow you to compare 2 strings to see if they
  80.            match, valid <relation> operators are = and <> ONLY! The IFVAL
  81.            structures are identical to IF structures, but they are used to
  82.            compare numeric variables.  Valid IFVAL <relations> are =, >,
  83.            >=, <, <= and <>.
  84.  
  85.          ->  IF <variable1> <relation> <variable2> THEN
  86.                   [then-code]
  87.              ENDIF
  88.  
  89.                 This performs the [then-code] if <relation> is true.
  90.  
  91.          ->  IF <variable1> <relation> <variable2> THEN
  92.                   [then-code]
  93.              ELSE
  94.                   [else-code]
  95.              ENDIF
  96.  
  97.                 This performs similar to the IF structure, but if the
  98.            <relation> is false it performs the [else-code].
  99.  
  100.  
  101.          TEST/TESTVAL COMMANDS
  102.          ─────────────────────
  103.  
  104.          ->  TEST <variable1> <relation> <variable2> <label>
  105.          ->  TESTVAL <variable1> <relation> <variable2> <label>
  106.  
  107.                 The two TEST commands allow you to compare two variables,
  108.            and if the comparison is true, to go to a separate part of the
  109.            script (as if a GO <label> had been used.)  The only difference
  110.            in the two commands is that TEST performs a non-case-sensitive
  111.            string comparison and TESTVAL performs a mathematic comparison.
  112.            Valid <relations> are =, <, <=, >, >= and <>.
  113.  
  114.  
  115.                                             VBBS 6.11 Documentation -- 10-F-3
  116.  
  117.  
  118.          PASSING CONTROL
  119.          ═══════════════
  120.  
  121.                 There are a total of four ways that you can pass control
  122.            from a script to something else.  These four ways each have
  123.            special uses and are covered below.
  124.  
  125.                Note: These commands will only accept one token following
  126.                      the actual command.  If you wish to have more items
  127.                      on the line then you must place them into a variable
  128.                      and place the variable on the command line.
  129.                      ex: $doscom = "dir " & $pathused & " /w"
  130.                          SHELL $doscom
  131.  
  132.          LINK ->  LINK <filename>
  133.  
  134.                 This command causes the present script to terminate and
  135.             begin running a script called <filename> (do not use any
  136.             extension or globals in the filename.)  All of your
  137.             variables will be cleared before the new script begins
  138.             operation.
  139.  
  140.          EXIT ->  EXIT <filename>
  141.  
  142.                 This command causes the present script to terminate and
  143.             then exits to the function block <filename> (as with LINK,
  144.             do not use extensions or globals.)  If no <filename> is
  145.             specified then the script will exit to the .FB file that
  146.             it was called from UNLESS the script did a shrinkout (see
  147.             DOOR, below) in which case it will always exit to START.FB.
  148.  
  149.          SHELL ->  SHELL <pathfile or DOS command line>
  150.  
  151.                 This will drop to DOS while keeping the BBS in memory.
  152.             It will then execute the command following SHELL and then
  153.             return to the line after the SHELL command.  All of your
  154.             variables are retained because the script is never taken
  155.             from memory.
  156.  
  157.          DOOR ->  DOOR <pathfile or DOS command line>
  158.  
  159.                 This will shrink the BBS out of memory and drop to DOS.
  160.             Implementation of the DOOR command writes the dropfiles
  161.             CHAIN.TXT, DOOR.SYS and DORINFOx.DEF to disk.  If nothing
  162.             else is specified on the command line then the script will
  163.             bring up your list of Doors as set in VCONFIG, otherwise it
  164.             will execute the required command line.  All of the script
  165.             variables will be cleared by the DOOR command.  After the
  166.             DOOR has been exited the user will return to the function
  167.             block that the script was called from unless one of the
  168.             following two commands are used just before the line that
  169.             contains the DOOR command:
  170.  
  171.  
  172.                                             VBBS 6.11 Documentation -- 10-F-4
  173.  
  174.  
  175.          RETURNFB -> RETURNFB <function block name>
  176.          RETURNSCRIPT -> RETURNSCRIPT <script name>
  177.  
  178.                 If either of these two commands precedes the DOOR command
  179.             the user will be returned to the function block selected OR
  180.             the beginning of the selected script.  If an invalid function
  181.             block name or script name is given it will restore the user to
  182.             the START.FB function block. If you do not have a START.FB then
  183.             the BBS will shut down.
  184.  
  185.  
  186.