home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / BBS / VBBS550.ZIP / VSCRIPT.DOC < prev    next >
Text File  |  1992-06-03  |  33KB  |  1,035 lines

  1.  
  2.                      The Vscript script language
  3.                     =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4.  
  5. One of VBBS' unique features is it's powerful built-in script language
  6. processor. Vscripts(tm) let you "re-program" your VBBS quickly and easily
  7. by creating them in any ASCII editor and compiling them using VBBS's
  8. built in VCOM.EXE script compiler (syntax: VCOM <script name>)
  9. Vscripts are easy to learn for the even those who have never
  10. programmed anything before. You can learn, share and exchange scripts with
  11. fellow VBBS SysOps on VirtualNET and elsewhere in what has become one
  12. of the VBBS SysOps's most favorite past times.
  13.  
  14. A Vscript program is just a simple ASCII text file of commands.
  15.  
  16. Example:
  17. tr $clear
  18. tr "Hello World!"
  19. pause
  20.  
  21. [The 3-line program above clears the screen, prints out Hello World!,
  22. and then prompts the user to press a key to continue.]
  23.  
  24. The script languange itself has some similarities to REXX. A script
  25. is composed of lines of pure ASCII text that can be written using
  26. just about any word processor in ASCII mode.
  27.  
  28. A few features of the language are:
  29.  
  30. -Scalar variables which can be used for storing numbers, strings, characters
  31. -Numeric and String operators
  32. -Commands supporting various types of serial input and output
  33. -Built-in database/data buffer commands
  34. -User account modify sysop-defined fields commands
  35. -Commands which provide functions for a multi-user system
  36. -Transfer control, subroutine, relational testing/branching
  37. -Chain execution to another script
  38. -Definable Break processing
  39. -SHELL to DOS capability
  40. -Compiled Script Language (Loads and Executes Faster!)
  41. -FINDFIRST and FINDNEXT commands for searching DOS directories
  42. -Automatic ANSI control
  43. -File I/O Commands
  44.  
  45.  
  46.  
  47.                             The SCRIPT Language
  48.                            ~~~~~~~~~~~~~~~~~~~~~
  49. VBBS 5.50 comes default with one script file. It is called START.V.
  50. It is, by default, the first script run when a user logs into VBBS.
  51. You can think of START.V as a sort of user start-up sequence -- a
  52. sequence you can easily modify.
  53. [Note: When START.V ends, Function Block execution begins.]
  54.  
  55. When you have written a script, you must compile it before you can run it.
  56. [Note: INSTALL.EXE compiles START.V for you when you install VBBS.]
  57.  
  58. A script is a simple ASCII file containing your commands, one per line.
  59. When your script is compiled, it is parsed ("tokenized") and coded into a
  60. binary form which loads and executes much faster. When it is executed, the
  61. coded form is loaded entirely into memory.
  62.  
  63. The definition of a TOKEN under VBBS is very important. The commands
  64. use these tokens are their parameters.
  65.  
  66. A token is defined as:
  67. 1. Any unspaced string of characters,
  68. or
  69. 2. Any string surrounded either by single quotes or double quotes.
  70.    (So that you can embed spaces in strings.)
  71.    Of course, the outside quotes are NOT actually a part of the string.
  72.  
  73. (This definition of a token is very similar to that for REXX.)
  74.  
  75. As you can surmise from the definition, spaces are used to delimit words,
  76. with quotes as an over-ride.
  77.  
  78. Up to seven tokens may be specified per line. With the exception of
  79. the assignment statement, the first token in the line must be a script
  80. command. Tokens may be either string literals or script variables.
  81. The VBBS script language is NOT CASE-SENSITIVE. (Capitalization used in
  82. this text is not required and is done only for clarity.)
  83.  
  84. Scalar variables in the VBBS script language begin with a $ character. All
  85. variable data is stored as string data, even numeric data. Numeric data is,
  86. however, temporarily converted to binary single-precision form for computations.
  87.  
  88. Assignment to variables is done with the = character. For example:
  89.  
  90.    $test = 1             {Loads the string '1' into the variable $test}
  91.    $test = "1"           {Exactly equivalent to $test = 1}
  92.    $greeting = "Hello"   {Sets variable $greeting to 'Hello'}
  93.  
  94. There are several numeric and string operators. You may only use operators
  95. in assignment statements, and you may do up to two operations per line
  96. (because of the 7 token per line maximum).
  97.  
  98. + Addition
  99. - Subtraction
  100. * Multiplication
  101. / Division
  102.  
  103.    $test = $value * 10       {Multiplies the contents of $value by 10
  104.                               and stores the result in $test}
  105.    $test = $value - $loss    {Subtracts the value of $loss from $value
  106.                            and stores the result in $test}
  107.    $test = $count - 1 * 100  {Takes value of $count, subtracts 1, then
  108.                               multiplies by 100 and stores the result in
  109.                               $test}
  110.  
  111. & String Concatenation
  112.  
  113.    $test = "Welcome Back, " & $name
  114.  
  115. In addition to above, there are a few of built-in functions.
  116. Syntactically, though, they look more like operators. Actually, the
  117. way they were implemented is "Quite Illogical, Captain."
  118. But it was done this way for speed, and it works!
  119.  
  120. INT Chops off the fractional part of a number.
  121.  
  122.    $test = $value INT 0      {Takes the value of $value, chops the fractional
  123.                               part and stores the result in $test. The 0 is a
  124.                               dummy placeholder, and is REQUIRED}
  125.  
  126. RND Generates Psuedo-random numbers in a specified range.
  127.  
  128.    $random = 1 RND 10  {Generates a random number between 1 and 10, inclusive}
  129.  
  130. UPPER Returns the upper-case equivalent of a string.
  131.  
  132.    $test = "abc" UPPER 0 {Converts abc to upper-case, puts the result in $test
  133.                           Note the dummy 0 placeholder}
  134.  
  135. ASC Returns the ASCII code of the first character in the string.
  136.  
  137.    $test = $string ASC 0 {Computes the ASCII code of the first character
  138.                           of the contents of $string, stores in $test}
  139.  
  140. CHR Returns the corresponding string character, given the ASCII code.
  141.  
  142.    $test = $code CHR 0
  143.  
  144. INSTR Scans a string for a given substring. Returns 0 if not found.
  145.       Returns position of substring otherwise.
  146.  
  147.    $position = $mainstring INSTR $substring
  148.  
  149. LEN Returns the length of a string.
  150.  
  151.    $length = $string LEN 0
  152.    $length = "hello" LEN 0
  153.  
  154. LEFT Returns the leftmost number of specified characters.
  155.  
  156.    $leftpart = $string LEFT 4   {Returns leftmost 4 characters of contents
  157.                                  of $string}
  158.  
  159. MID Returns a substring from the middle of a string to the end.
  160.  
  161.    $midpart = $string MID 5     {Returns all characters from position 5
  162.                                  to the end of the contents of $string}
  163.  
  164.    $extract = "123456789" MID 3 LEFT 4 {In this example, two operations are
  165.                     performed. First, the MID is done, returning 3456789. Then
  166.                         LEFT is applied returning 3456, the final result.}
  167.  
  168. SQR Returns the square root of a value.
  169.  
  170.    $root = $value SQR 0
  171.  
  172.                                   ==*==
  173.  
  174.                          Display/Serial I/O Commands
  175.                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  176.  
  177. RS <variable> <prompt>
  178.  
  179.   Transmits optional prompt and reads a line of input into a variable. Input
  180.   is echoed character by character, and terminates with a carriage return.
  181.   The length parameter limits to the length of the input line.
  182.   RS $name "What is your Name?"
  183.  
  184. RX <variable> <prompt>
  185.  
  186.   Transmits optional prompt and reads a line of input into a variable.
  187.   X's are echoed as characters are input. Input terminates with a
  188.   carriage return.
  189.   RX $newpassword "What is your new password?"
  190.  
  191. RW <variable> <prompt>
  192.  
  193.   Transmits optional prompt and reads a line of input into a variable.
  194.   Input is echoed character by character, and WORD-WRAP is taken care of
  195.   automatically. Input terminates with a carriage return, or when the
  196.   line limit is reached. In the case of the line limit, the "broken" word
  197.   on the end is removed from the string and stored internally for the next
  198.   use of RW and the remaining line is stored in the script variable.
  199.   Use RW as the input command for message and text editors.
  200.   RW $line ">"
  201.  
  202. RN <variable> <prompt>
  203.  
  204.   RN is a lot like RS except it should be used to read numeric input.
  205.   RN will not allow bad characters or too many digits to be input.
  206.  
  207. RF <variable> <prompt>
  208.  
  209.   RF is similar to RS execpt it should be used to get filename input.
  210.   It will not allow a user to enter an invalid filename.
  211.  
  212. RC <variable> <prompt>
  213.  
  214.   Transmits optional prompt and waits for the user to press a key.
  215.   The key is stored in the variable, but is not echoed.
  216.   RC $char "Your Command? "
  217.  
  218. RR <variable> <restricted character list> <prompt>
  219.  
  220.   Transmits an optional prompt and waits for the user to press a key.
  221.   Keys not in the "restricted character list" are ignored.
  222.   The keystroke is not echoed. Not case-sensitive.
  223.   RR $key ABCD "Select: A, B, C, or D. "
  224.  
  225. RL <variable> <restricted character list> <numeric limit> <prompt>
  226.  
  227.   RR works with a restricted character list. RL uses a restricted character
  228.   list and a numeric range in forming user input. The low end of the rnage
  229.   is always 1. The high end of the range is the <numeric limit>.
  230.   For example:
  231.   RL $var Q 20 "Please Select 1-20, Q to Quit:"
  232.   Allows input of character Q or number between 1 and 20.
  233.   RL is very flexible and very handy. For more exmaple of use, see the
  234.   scripts.
  235.  
  236. RI <variable> <prompt>
  237.  
  238.   Much like RF, except it allows wildcard filenames.
  239.  
  240. TR <token 1> <token 2> ... <token 6>
  241.  
  242.   Automatically concatenates all of the tokens you specify
  243.   (both contents of variables and literals) and transmits the string
  244.   with a Carriage Return and Linefeed appended.
  245.  
  246.   TR "Welcome back to the BBS!"
  247.   TR "Hello " $name ", how are you doing today?"
  248.  
  249.   Additionally, optional output formatters can be used to make your numeric
  250.   and string variables print neatly.
  251.  
  252.   TR %s20 $s <= Variable $s, left justifies, pads to 20 length
  253.   TR %i4 $i  <= Variable $i, formatted to a 4 digit integer.
  254.   TR %d3.2 $d <= Variable $d, formatted to a decimal with form ###.##
  255.  
  256. TS <token 1> <token 2> ... <token 6>
  257.  
  258.   Same as TR except no Carraige Return/Linefeed is appended.
  259.  
  260. PAUSE <optional prompt string>
  261.  
  262.   If no string is specified, uses the default set-up by VCONFIG.EXE.
  263.   Transmits the prompt, waits for any key, then back-spaces over the prompt.
  264.  
  265.                                 ==*==
  266.  
  267.  
  268.                              Database Commands
  269.                             ~~~~~~~~~~~~~~~~~~~
  270.  
  271. DBGROUP <group identifier>
  272.  
  273.   Before you can execute the DB command, below, you must select a
  274.   database group. Grouping was implemented so that it would be much
  275.   easier to implement global functions and so that databases may be added
  276.   and deleted (using VCONFIG.EXE) without the need to edit the scripts
  277.   every time. The <group identifier> is a single identification character.
  278.   A to Z recommended.
  279.  
  280.   When you execute a DBGROUP command, the special variable $DBNUMBER
  281.   is loaded. It contains the number of databases in the group. The first
  282.   database in any group is number 1. This makes it easy for a script
  283.   to do global operations by using these lower and upper limits in a loop.
  284.  
  285.   The special variable $DBGROUP is loaded with the group id. Since LINK
  286.   clears normal variables, $DBGROUP could be used to pass group select
  287.   information to another script.
  288.  
  289.   How you group your databases is up to you. An example might be:
  290.   A for public message bases
  291.   F for public file bases
  292.   O for other databases (custom, imaginative database uses...)
  293.  
  294. DB <database #>
  295.  
  296.   The DB commands sets the current database for use. You must select a
  297.   database using this command somewhere in your script before any of the
  298.   other database commands (except DBGROUP) are used. Once you set the
  299.   database, it stay's set until another DB command is executed. Also, the
  300.   database must have been defined previously using VCONFIG.EXE.
  301.  
  302.   When a DB command is executed, "special" read-only variables
  303.   are automatically loaded:
  304.  
  305.   $DB     - The <database #> you specified. Use for passing this info to
  306.             other scripts when using the LINK command.
  307.   $DBNAME - The long name of the database.
  308.   $DBPATH - The path where database is located.
  309.   $DBFILE - The database filename.
  310.   $HIGHDB - This is the user's highest-database-entry-read quick-scan pointer.
  311.   $NUMBERDB - Number of entries in the database.
  312.   $WRITESL  - The database's write security level.
  313.  
  314. LOAD <entry number> <option>
  315.  
  316.   This command loads a database entry into special variables:
  317.  
  318.   $FROM     - The handle of the person who created the entry.
  319.   $FROMNO   - The User # of the person who created the entry.
  320.   $FROMNODE - VirtualNET node number of sender.
  321.   $TO       - The handle of the addressee, if any.
  322.   $TONO     - The User # of the addressee. 0 if to ALL.
  323.   $TONODE   - VirtualNET node number of addressee.
  324.   $SUBJECT  - The subject of the message, or brief description for a file.
  325.   $ORIGIN   - Origin - Optional - Use for BBS Tag Line, etc.
  326.   $ATTFILE  - Filename of 'attached' file, if any. Useful for DOWNLOAD command.
  327.   $SIZE     - Size of attached file. If no file, set to 0.
  328.   $DBFLAG   - Use is optional. Can be used as a message received flag
  329.               or any other desired purpose.
  330.   $DBCOUNT  - Use is optional. Can be used to count replies or
  331.               # of downloads, or any other desired purpose.
  332.   $DBTIME   - Creation time of entry.
  333.   $DBDATE   - Creation date of entry.
  334.  
  335.   Plus an additional variable called $RESULT. This is the result of
  336.   the LOAD operation. Returns:
  337.  
  338.   DEL if entry is marked as deleted,
  339.   OUT if entry number is out of range,
  340.   PRI if PRIVATE database, and user is not sender, addressee, or
  341.       SYSOP/Co-SYSOP (access with security level 250 or greater),
  342.   OK  otherwise.
  343.  
  344.   LOAD loads only the database special variables. It does not
  345.   load the memo file contents.
  346.  
  347.   LOAD updates the user's quick-scan pointer, unless you specify
  348.   /Q for <option>.
  349.  
  350.   A typical use of the LOAD command to read messages might go like this:
  351.  
  352.   LOAD $num
  353.   TR "Special Data"
  354.   DISPLAYMSG
  355.   DISPLAYTEXT
  356.  
  357.   DISPLAYMSG and DISPLAYTEXT are related commands.
  358.  
  359.   DISPLAYMSG prints out, in standard VBBS format, the header information
  360.   of the most recenlty LOADed database record.
  361.  
  362.   DISPLAYTEXT prints out, in standard VBBS format, the memo information
  363.   of the most recenlty LOADed database record.
  364.  
  365. DEL <entry number>
  366.  
  367.   Marks an entry for deletion. This command, also, returns a result
  368.   in the special variable $RESULT. Returns:
  369.  
  370.   OUT if entry number is out of range,
  371.   PRI if the user is not sender, addressee, or SYSOP/Co-SYSOP.
  372.   OK  otherwise.
  373.  
  374. PACK
  375.  
  376.   Pack removes records which have been marked for deletion, and re-sequences
  377.   the database. It also updates user and network quickscan pointers.
  378.  
  379. ADDCOUNT <entry number>
  380.  
  381.   Adds 1 to the $DBCOUNT field of the entry number specified.
  382.  
  383. DBFLAG <entry number> <switch>
  384.  
  385.   Sets or Resets the $DBFLAG field of the entry number specified.
  386.   <switch> is either ON or OFF.
  387.  
  388. SEARCH <entry number> <key> <string>
  389.  
  390.   Searches the database, starting at the entry number specified.
  391.   <key> is either:
  392.         1 - Search TO field
  393.         2 - Search FROM field
  394.         3 - Search SUBJECT field
  395.         4 - Search FILENAME field (wildcards allowed)
  396.         5 - Search FILENAME field (wildcards not allowed)
  397.  
  398.   If <key> is 3, 4, or 5, then <string> is data to search for in field.
  399.  
  400.   SEARCH returns two results:
  401.   In $RESULT, OUT if not found,
  402.               OK otherwise.
  403.   In $SEARCH, the entry number where the search data was found.
  404.  
  405. QS <entry number>
  406.  
  407.   Manually change the user's quick-scan pointer to the entry number specified.
  408.  
  409. SAVE <to user #> <to node address> <subject> <size> <filename> <to net #>
  410.  
  411.   Saves a database entry:
  412.     Header Information (the parameters on the line with SAVE).
  413.     Saves Memo Lines (the current contents of the BUFFER).
  414.  
  415.   <to user #>         User # of addressee. If TO ALL, use 0.
  416.   <to node address>   Network Address. (If local, use $node)
  417.   <subject>           Data for subject field.
  418.   <size>              Size of attach file, if any. Use 0 if none.
  419.   <attached filename> Filename of attached file, if any.
  420.   <to net #>          Network ID # (If local, use 1.)
  421.  
  422.   The new entry header info is saved at the end of the current database file.
  423.   The BUFFER part is saved in a binary file and indexed (for speed).
  424.  
  425.  
  426.                                  ==*==
  427.                            File Transfer Commands
  428.                           ~~~~~~~~~~~~~~~~~~~~~~~~
  429. **   Note: To use the file transfer commands, you must have DSZ.COM, an    **
  430. ** external protocol driver. DSZ version 04-11-90 or newer is recommended! **
  431.  
  432. DOWNLOAD <path\filename>
  433.  
  434.   Prompt user for desired protocol (as they have been set up using VCONFIG)
  435.   and then sends a file to the user. You may include a full path specification
  436.   along with the filename.
  437.  
  438. UPLOAD <path\filename>   
  439.  
  440.   Just like DOWNLOAD except receives a file from a user.
  441.  
  442. BATCH
  443.  
  444.   Brings up the batch functions handling routine.
  445.  
  446. REMOTEUPLOAD
  447.  
  448.   Allows user to upload one or more files to the SysOp Review Directory.
  449.  
  450. LISTFILES
  451.  
  452.   Prompts for a file mask (can include wildcards), and lists all files
  453.   in the current selected (DB) database.
  454.  
  455. SEARCHALL
  456.  
  457.   Prompts for a file mask (can include wildcards), and lists all files.
  458.  
  459. NEWFILES
  460.  
  461.   Lists all NEW files, all databases in the current DBGROUP.
  462.  
  463. FINDFILES
  464.  
  465.   Searches the description, all databases in the current DBGROUP.
  466.  
  467. SYSOPUPLOAD
  468.  
  469.   Local SysOp Upload.
  470.  
  471. REVIEWUPLOADS
  472.  
  473.   Allows Sysop to Review new uploads.
  474.  
  475. REVIEWFILE
  476.  
  477.   Review/download files sequentially by file number.
  478.  
  479. DOWNLOADFILE
  480.  
  481.   Review/download files by wildcard filename mask.
  482.  
  483. RATIO
  484.  
  485.   Displays User Ratio.
  486.  
  487. TOPDOWNLOADS
  488.  
  489.   Display List of Most Popular Downloads.
  490.  
  491.                                    ==*==
  492.  
  493.                       High Level Communications Functions
  494.                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  495.  
  496. SENDEMAIL
  497.  
  498.   Send Email to another User.
  499.  
  500. FEEDBACK
  501.  
  502.   Send Email to the SysOp.
  503.  
  504. READEMAILTO
  505.  
  506.   Read all Email to User.
  507.  
  508. READEMAILFROM
  509.  
  510.   Read all email from User.
  511.  
  512. READALLEMAIL
  513.  
  514.   SysOp read all mail on system.
  515.  
  516. SETQUICKSCAN
  517.  
  518.   Set database in current DBGROUP join/ignore during newscan.
  519.  
  520. LISTBASES
  521.  
  522.   Lists the databases in the current DBGROUP.
  523.  
  524. SELECTBASE
  525.  
  526.   Select a database from the current DBGROUP.
  527.  
  528. PREVBASE
  529.  
  530.   Switch to the previous database.
  531.  
  532. NEXTBASE
  533.  
  534.   Switch to the next database.
  535.  
  536. READSEQMSG
  537.  
  538.   Read messages, sequentially.
  539.  
  540. READNEWMSG
  541.  
  542.   Read new messages in all selected databases.
  543.  
  544. SCANMSG
  545.  
  546.   Scan the current database.
  547.  
  548. POST
  549.  
  550.   Write a message in the current database.
  551.  
  552. QUICKMAIL
  553.  
  554.   Use the MultiMail Functions.
  555.  
  556.                                    ==*==
  557.  
  558.                                BUFFER Commands
  559.                               ~~~~~~~~~~~~~~~~~
  560.  
  561. BUFFER CLEAR
  562.  
  563.   Clears out the BUFFER.
  564.  
  565. BUFFER APPEND <text>
  566.  
  567.   Appends the line of text to the BUFFER.
  568.  
  569. BUFFER LIST
  570.  
  571.   Transmits the current contents of the buffer.
  572.   Strips ANSI from the buffer if the online user's ANSI preference is
  573.   turned off.
  574.  
  575. BUFFER EDIT
  576.  
  577.   Starts up the user's selected editor, editing the current contents
  578.   of the BUFFER.
  579.  
  580. [Note: In order to accomodate larger memo sizes, VBBS' BUFFER is a disk
  581. file in the format Bx.TMP, where x is the channel number.]
  582.  
  583.  
  584.                                ==*==
  585.  
  586.                          Other Main Functions
  587.                          ~~~~~~~~~~~~~~~~~~~~
  588.  
  589. DOOR
  590.  
  591.          DOOR can be used with two different syntaxes:
  592.  
  593.          When used by itself, it brings up a list of DOOR programs
  594.          which can be run, as configured by VCONFIG, Doors
  595.          configuration. If a door is selected, the door info files
  596.          CHAIN.TXT, DORINFO1.DEF, and DOOR.SYS are written to disk.
  597.          Then the door is executed, with VBBS shrinking out.
  598.  
  599.          When used with a parameter, (as in DOOR "RUN-ME"),
  600.          the door info files are written, and the door is run
  601.          immediately.
  602.  
  603. AUTOPOST
  604.  
  605.   Brings up the autopost functions.
  606.  
  607. EDITFILE
  608.  
  609.   Allows Sysop to edit a text file. (200 line limit)
  610.  
  611. SYSINFO
  612.  
  613.   Displays the systsem information screen.
  614.  
  615. CLEANUP
  616.  
  617.   Packs all of the databases.
  618.  
  619. RANDOM
  620.  
  621.   Pulls up a random blurb from your random blurbs files and displays it.
  622.  
  623. ACCOUNT
  624.  
  625.   Brings up the account defaults set-up and allws the user to change them.
  626.  
  627.  
  628.                                ==*==
  629.  
  630.                            Sequential File I/O
  631.                           ~~~~~~~~~~~~~~~~~~~~~
  632.  
  633.  
  634. OPEN <filename> <access>
  635.  
  636.   <access> is INPUT, OUTPUT, or APPEND.
  637.  
  638. CLOSE
  639.  
  640.   Closes file previous opened with OPEN.
  641.  
  642. READ <var>
  643.  
  644.   Reads a line of input text from the file.
  645.   Returns !EOF! if the end of file has been reached.
  646.  
  647. WRITE <token1> <token2> ... <token7>
  648.  
  649.   Writes a line of text to the file.
  650.  
  651.                                  ==*==
  652.  
  653.                              Mutli-User Support
  654.                             ~~~~~~~~~~~~~~~~~~~~
  655.  
  656.  
  657. WHO
  658.  
  659.   Who else is on-line? Lists port #, user #, handle, current BBS activity.
  660.  
  661. ACTION <text>
  662.  
  663.   Sets the user's current BBS activity for the WHO command.
  664.  
  665.  
  666.                                ==*==
  667.                          Transfer/Control Commands
  668.                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  669. # <label>
  670.  
  671.   Defines a label line.
  672.  
  673. GO <label>
  674.  
  675.   Go to the label specified.
  676.  
  677. CALL <label>
  678.  
  679.   Call a subroutine located at <label>.
  680.  
  681. RET
  682.  
  683.   Return from a CALL command.
  684.  
  685. EXIT <Function Block Name>
  686.  
  687.   Exit the current script and begin the function block specified.
  688.   (If none specified, EXIT returns you to the function block most
  689.   recently used. However, if the script SHRINKS OUT for any reason,
  690.   (DOOR command, etc), the function block name MUST be specified.)
  691.  
  692. TEST <token1> <relation> <token2> <label>
  693.  
  694.   Perform a non-case-sensitive string comparison and go to <label> if true.
  695.   <token1> and <token2> may be either variables or constants.
  696.   <relation> is one of the following:
  697.   <> Not equal
  698.   =  Equal
  699.   <= Less than or equal
  700.   >= Greater than or equal
  701.   <  Less than
  702.   >  Greater than
  703.  
  704. TESTVAL <token1> <relation> <token2> <label>
  705.  
  706.   Perform a numeric comparison and go to <label> if true.
  707.   <token1> and <token2> may be either variables or constants.
  708.   <relation> is the same as for TEST.
  709.  
  710. LINK <script filename>
  711.  
  712.   Chain to a new script file. All old variables are cleared before the new
  713.   script starts executing. It is recommended that your break your scripts
  714.   into small modules and use LINK to jump from one script to another.
  715.   [Note: The script filename should be a name of 8 characters or less and not contain an extension.]
  716.  
  717. SHELL <text>
  718.  
  719.   Shell to DOS, executing <text> on command.com startup.
  720.   When the shell process is finished, control returns to VBBS and
  721.   the script processor.
  722.  
  723. BREAK <label>
  724.  
  725.   Specifies the label to branch to if Ctrl-C is detected. To turn off
  726.   Ctrl-C checking, issue a BREAK OFF command.
  727.  
  728.                              ==*==
  729.  
  730.                             User Data Commands
  731.                            ~~~~~~~~~~~~~~~~~~~~
  732.  
  733. SETFLAGS <flag> <switch>
  734.  
  735.   These are optional, sysop-defined general purpose flags.
  736.   <flag> is a character from A to Z.  <switch> is ON or OFF.
  737.   When a user logs on, the special variable $FLAGS is automatically loaded.
  738.  
  739. SETEXTRA <extra #> <text>
  740.  
  741.   There are 9 extra 16-character fields for your use.
  742.   <extra #> is 1 to 9. <text> is text to write into the data field.
  743.   When a user logs on, the special variables $EXTRA1 to $EXTRA9
  744.   are automatically loaded. More special variables, loaded at login-time:
  745.  
  746.   $SECURITY - User's security level. 250 and up is considered
  747.               Co-sysop/Sysop access. Use TESTVAL and this variable to
  748.               implement your own security.
  749.   $NAME     - User's real name.
  750.   $TITLE    - SysOp-Defined field.
  751.   $HANDLE   - User's handle.
  752.   $USER     - User's account number.
  753.   $TIMESON  - Number of logons
  754.   $TOTALMIN - Total number of minutes on since account was created.
  755.   $TIMEON   - Number of minutes on for this session.
  756.   $TIMELEFT - Number of minutes left for this session.
  757.   $MAXTIME  - Maximum minutes per day.
  758.   $ANSI     - Contains ON or OFF depending on user's selection of ANSI.
  759.   $PAGE     - Number of lines to print before pause.
  760.  
  761.                                     ==*==
  762.  
  763.                             Miscellaneous Commands
  764.                            ~~~~~~~~~~~~~~~~~~~~~~~~
  765.  
  766.  
  767. KILL <filename>
  768.  
  769.   A clean way to delete a file.
  770.  
  771. CHECKFILE <variable> <path/filename>
  772.  
  773.   Stores size of file into variable. If file is non-existant, returns 0.
  774.  
  775. JR <variable> <size>
  776.  
  777.   Right-justify the contents of a variable, padding with spaces.
  778.  
  779. JL <variable> <size>
  780.  
  781.   Left-justify the contents of a variable, padding with spaces.
  782.  
  783. JC <variable> <size>
  784.  
  785.   Center-justify the contents of a variable, padding with spaces.
  786.  
  787. EF <path/filename>
  788.  
  789.   Transmits the contents of the text file.
  790.  
  791. LOG <text>
  792.  
  793.   Write text to the BBS log file, BBS.LOG.
  794.  
  795. LOGOFF
  796.  
  797.   Terminates script execution and logs the user off.
  798.  
  799. LOGOFFYN
  800.  
  801.   Much like LOGOFF, but prompts for confirmation first.
  802.  
  803. BEEP
  804.  
  805.   Beeps the PC speaker. Useful if you want a "Page the SYSOP" feature.
  806.  
  807. ! <comment line>
  808.  
  809.   A ! at the beginning of a line denotes a script comment line.
  810.   These lines are ignored by the VBBS script loader/parser.
  811.  
  812. USEREDIT
  813.  
  814.    The USEREDIT script command lets the sysop do remote user editing.
  815.  
  816. MENU <filename>
  817.  
  818.    VBBS first checks for a file as named, with a .MNU extension.
  819.    If this is not found, VBBS transmits file <filename>.ans is user has
  820.    ANSI, <filename>.asc otherwise.
  821.  
  822.    [Note:.MNU are a sort of universal menu file for both ANSI and non-ANSI
  823.    users. However, you can still use separate ANSI and ASCII menus if you
  824.    wish.]
  825.  
  826.    If ! is the first character of the line, VBBS interpets this as
  827.    "don't print this line unless the user's security level is greater
  828.    or equal to the immediately preceeding three-digit number."
  829.  
  830.    Examples:
  831.    !255 S) SysOp Menu  <== Line not printed unless the user has SL >= 255.
  832.    !100 F) Forward     <==  "    "     "      "     "   "    "  "  "  100.
  833.  
  834. FINDFIRST <variable> <mask to search>
  835.  
  836.    Searches the DOS Directory, for the first file to match the mask
  837.    specified.
  838.  
  839. FINDNEXT <variable>
  840.  
  841.    Finds the next matches after a FINDFIRST. Will return a null string ""
  842.    when the search has ended.
  843.  
  844. NEWPAGE
  845.  
  846.   Resets the "Pause on screen" line counter.
  847.  
  848. PAGESYSOP
  849.  
  850.   Pages the SYSOP BEEPER is Scroll Lock is activated.
  851.  
  852. DELAY <# of seconds>
  853.  
  854.   Pauses Script Execution for the number of seconds specified.
  855.  
  856. SUSPENDPAGEBREAK
  857.  
  858.   Temporarily turn off page break checking.
  859.  
  860. RESUMEPAGEBREAK
  861.  
  862.   Turn pagebreak checking back on.
  863.  
  864. STACK <keystroke string>
  865.  
  866.   "Fake" keyboard/remote user input.
  867.  
  868. More Commands:
  869. ~~~~~~~~~~~~~~~
  870.  
  871. The DO LOOP:
  872.  
  873.    In this form, the variable loops from start to end.
  874.  
  875.    DO <var> = <start> <end>
  876.       [body of loop]
  877.    LOOP
  878.  
  879.    In this form, DO performs while a specific variable is non-zero.
  880.  
  881.    DO WHILE <var>
  882.      [body of loop]
  883.    LOOP
  884.  
  885. IF-THEN-ELSE-ENDIF:
  886.  
  887.    IF <expr> <relation> <expr> THEN
  888.       [then-code]
  889.    ELSE
  890.       [else-code]
  891.    ENDIF
  892.  
  893.    IF <expr> <relation> <expr> THEN
  894.       [then-code]
  895.    ENDIF
  896.  
  897.    Use IFVAL to test numeric relationships.
  898.    Relations are the same as for TEST and TESTVAL.
  899.  
  900. A few miscellaneous special variables:
  901.   $DATE  - Current system date.
  902.   $TIME  - Current system time.
  903.   $PORT  - Port Number.
  904.   $BAUD  - Baud Rate of Connection.
  905.   $NODE  - Your system's VirtualNET node number as defined by VCONFIG.EXE.
  906.   $BBSNAME  - Name of BBS as defined by VCONFIG.EXE.
  907.   $SYSOP    - Name of SysOp as defined by VCONFIG.EXE.
  908.   $AVAILABLE - SysOp Available. Contains Y or N.
  909.  
  910. A few miscellaneous special constants:
  911.   $CLEAR - Set to Ctrl-L (ascii code 12) when ANSI is OFF, Otherwise set to
  912.            the ANSI clear screen command.
  913.   $CR    - Carriage Return (ascii code 13).
  914.   $LF    - Linefeed        (ascii code 10).
  915.   $BS    - Back Space      (ascii code 8).
  916.   $BELL  - Bell            (ascii code 7).
  917.   $CRLF  - Carriage Return and Linefeed.
  918.  
  919.         =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  920.       
  921.                          COMMANDS IN VBBS-AUX.EXE
  922.  
  923.   The following commands are located in VBBS-AUX.EXE, and should   
  924.   be called from function blocks directly, as type 4 function block
  925.   directives (run DOS command with shrinkout):
  926.  
  927.   Example:
  928.  
  929.   B 001 4 VBBS-AUX %1 TEXTFILES
  930.  
  931.   B         Key to press
  932.   001       Minimum security level
  933.   4         Execute DOS command with shrinkout
  934.             The %1 paramater is the VBBS channel number.
  935.  
  936. VBBS-AUX %1 TEXTFILES
  937.  
  938.   Brings up the text files (bulletins) functions.
  939.  
  940. VBBS-AUX %1 VOTE
  941.  
  942.   Brings up the voting booth functions.
  943.  
  944. VBBS-AUX %1 CHECKVOTE
  945.  
  946.   Brings up the voting booth functions, checks for new votes.
  947.  
  948. VBBS-AUX %1 LISTNET
  949.  
  950.   Brings up the network listings functions.
  951.  
  952. VBBS-AUX %1 TELECON
  953.  
  954.   Enter the VBBS Teleconference Mode.
  955.  
  956. VBBS-AUX %1 LISTUSERS
  957.  
  958.   Lists out all user accounts.
  959.  
  960. VBBS-AUX %1 SECURITY
  961.  
  962.   Lists out all user accounts with:
  963.   Security lvl > 150 or non-zero Group Code
  964.  
  965. VBBS-AUX %1 TEST <name of test file>
  966.  
  967.   Execute a TEST (test, exam, quiz, etc) file as named on the command line.
  968.   For information on this function, please see VBBS550.DOC.
  969.  
  970. VBBS-AUX %1 HELP <number of help system>
  971.  
  972.    Execute the hypertext help system, using the LOOKUP file specified
  973.    on the command line. Please see VBBS550.DOC for more information.
  974.       
  975.         =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  976.  
  977.                                The Database
  978.                               ~~~~~~~~~~~~~~
  979.  
  980. The database can be used for a lot of different purposes. You can store
  981. messages, file descriptions, or even messages with attached files.
  982. Also, there is no reason why you can't redefine the fields and use them
  983. for other types of data storage.
  984.  
  985. There are two parts to each database entry; The HEADER INFORMATION, and
  986. the MEMO LINES. Header info is data like sender's name, subject,
  987. addressee, etc. Memo Lines are the actual body of the entry.
  988. They are the message text or long file description, dpending on how you
  989. are using the database.
  990.  
  991.     =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  992.  
  993.                     Compiling Scripts with VCOM.EXE
  994.                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  995.  
  996. VCOM.EXE is the Virtual BBS/NET script language compiler. VCOM expects the
  997. source code file for the script to have a .V extension.
  998.  
  999. During compilation, VCOM generates two files for the script:
  1000.  
  1001.    .LIT file: The literal data from the source code.
  1002.    .COD file: The actual program in numeric integer-coded form.
  1003.  
  1004. If your script is called MAIN.V, then the command line to compile the
  1005. script would be:
  1006.  
  1007. VCOM MAIN
  1008.  
  1009. And the compiler will generate MAIN.LIT and MAIN.COD.
  1010.  
  1011. The compiler will trap any GO, TEST, TESTVAL, CALL, or BREAK commands which
  1012. do not have a valid destination label. You will have to fix the error and
  1013. compile again. This error message may also appear if there is a syntax error
  1014. in the GO/TEST/TESTVAL/CALL/BREAK command line.
  1015.  
  1016. It will also trap any attempt to use duplicate line labels.
  1017.  
  1018. Include Files Compiler Directive
  1019.  
  1020. Also, you may "include" other .V files in the compilation of your scripts.
  1021. That way, you can write a common routine once, and use it with other script
  1022. modules without the need to type (or cut/paste) the code into the modules
  1023. by hand. The include directive is & and it must be the first character
  1024. on the line. It must be followed by a space, and then the filename of
  1025. the file to include. Example:
  1026. & editor.v
  1027.  
  1028.                          -=-=-=-=-=-=-=-=-=-=-=-=-=-
  1029.  
  1030.     For further discussion of Vscripts and access to modifications,
  1031.   modified and additional Vscripts, please join us on the VirtualNET
  1032.   Vscripts Discussion sub board and the VirtualNET networked Vscripts
  1033.   and Source Mods File listings.
  1034.  
  1035.