home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / v612docs.zip / VAC < prev    next >
Text File  |  1993-12-17  |  13KB  |  370 lines

  1. .TOPIC:
  2. Virtual Developer's ToolKit
  3.                                     VBBS 6.12 Documentation--C-1
  4.  
  5.        ╔═════════════════════════════════════════════════════════════╗
  6.        ║   APPENDIX C         VIRTUAL DEVELOPERS TOOLKIT             ║
  7.        ╚═════════════════════════════════════════════════════════════╝
  8.  
  9.        The Virtual Developer's Toolkit is a set of files that enable
  10.        you to create doors for VBBS systems quickly and easily. The
  11.        "toolkit" enables you to write multi-user serial port-based
  12.        programs, using serial port access methods similar to that used
  13.        by VBBS. It is designed for writing doors (games, utilities,
  14.        etc) for VBBS specifically.
  15.  
  16.        It is assumed that you know how to program in QuickBASIC. The
  17.        toolkit gives competent BASIC programmers an easy interface for
  18.        writing VBBS doors by taking care of serial port access, user
  19.        data loading, and VBBS specifics automatically.
  20.  
  21.        Your programs will essentially act as "extensions" to the main
  22.        VBBS program -- accessing the same user data -- using the same
  23.        serial port access methods (via internal routines, or FOSSIL,
  24.        depnding on VCONFIG switch). Think of the toolkit as being a
  25.        quick and easy way to build auxillary modules for your VBBS
  26.        System.
  27.  
  28.        The routines included in the Virtual Developer's TookKit are
  29.        listed below.  The VDTK is available for $49 from Virtual
  30.        Technologies.  Documentation includes examples on how to use
  31.        each routine, what variable is called, what is returned, and
  32.        a complete example of a game written using the toolkit.
  33.  
  34.        Routines Descriptions
  35.        ═════════════════════
  36.  
  37.        DECLARE SUB openport ALIAS "OPENPORT" (PORT%, PORTX%, IRQ%, FLOW%)
  38.        Function:
  39.        This statement opens up the serial port at the
  40.        hardware level. The appropriate INT vector is captured, with the
  41.        old value being saved. The appropriate IRQ is enabled. The
  42.        UART's IRQs are enabled for "interrupt on character received."
  43.  
  44.        DECLARE SUB closeport ALIAS "CLOSEPORT" ()
  45.        Function:
  46.        This statement closes the serial port at the hardware
  47.        level. The old INT vector is restored. The appropriate IRQ is
  48.        disabled. The UART's IRQs are disabled.
  49.  
  50.        DECLARE SUB outline ALIAS "XMIT" (x$)
  51.        Function:
  52.        This statement sends a string through the serial port.
  53.        (at lightening speed)
  54.  
  55.        DECLARE SUB cdcheckz ALIAS "CDCHECKZ" (x%)
  56.        Function:
  57.        This statement checks the carrier status.
  58.                                          VBBS 6.12 Documentation--C-2
  59.  
  60.        DECLARE SUB comhitz ALIAS "COMHITZ" (x%)
  61.        Function:
  62.        Checks the status of the serial input buffer.
  63.  
  64.        DECLARE SUB readport ALIAS "RDPORT" (a%)
  65.        Function:
  66.        This statement retrieves a character from the serial
  67.        input buffer. This statement should only be called after first
  68.        calling "comhitz" to make sure that there is actually a
  69.        character waiting.
  70.  
  71.        DECLARE SUB dtrz ALIAS "DTRZ" (a%)
  72.        Function:
  73.        This statement sets or resets the DTR line as needed.
  74.        During a normal session the DTR line should be logical level 1.
  75.        Lowering the DTR line should have the effect of hanging up the
  76.        modem.
  77.  
  78.        DECLARE SUB rtsz ALIAS "RTSZ" (a%)
  79.        Function:
  80.        Sets or reset the RTS (Request To Send) as needed.
  81.        This line should always be logical level 1.
  82.  
  83.        DECLARE SUB dvpausez ALIAS "DVPAUSEZ" ()
  84.        Function:
  85.        Tell desqview this task is just waiting for user
  86.        input, and give time to other tasks.
  87.  
  88.        DECLARE SUB chkfile ALIAS "CHKFILEZ" (x$, x&)
  89.        Function:
  90.        Checks for file existance, and returns size if found.
  91.  
  92.        DECLARE FUNCTION comhit ()
  93.        Function:
  94.        Returns the status of the input buffer. 1 = character
  95.        waiting, 0 = no characters waiting -
  96.  
  97.        DECLARE FUNCTION ctime (a, b)
  98.        Function:
  99.        This function is used to calculate the time elapsed
  100.        between two time values. Time values are in minutes (1440 per
  101.        day).
  102.  
  103.        DECLARE FUNCTION ctime2& (a&, b&)
  104.        Function:
  105.        This function is similar to ctime(), but it works in
  106.        seconds instead of minutes.
  107.  
  108.        DECLARE FUNCTION form$ (x, y, n!)
  109.        Function:
  110.        This function is used to justify numeric data. You
  111.        specify the number of digits on left and right of the decimal
  112.        point (for whole numbers 'y' can be set to 0).
  113.  
  114.        DECLARE FUNCTION num1$ (a)
  115.        Function:
  116.        Converts a number to a string.
  117.                                          VBBS 6.12 Documentation--C-3
  118.  
  119.        DECLARE FUNCTION num2$ (a&)
  120.        Function:
  121.        Converts a number to a string.
  122.  
  123.        DECLARE FUNCTION num3$ (a!)
  124.        Function:
  125.        Converts a number to a string.
  126.  
  127.        DECLARE FUNCTION opencntl ()
  128.        Function:
  129.        This function opens up the CONTROL.DAT file.
  130.  
  131.        DECLARE FUNCTION openuser ()
  132.        Function:
  133.        This function opens up the user file, using file
  134.        number 9.
  135.  
  136.        DECLARE FUNCTION readchar ()
  137.        Function:
  138.        This function is used to read characters form the
  139.        serial input queue. Note: You must use the comhit function to
  140.        insure there are characters waiting!
  141.  
  142.        DECLARE FUNCTION strlen (a$)
  143.        Function:
  144.        This function is similar to BASIC's LEN() function,
  145.        except that heart code characters and ANSI codes are not
  146.        counted.
  147.  
  148.        DECLARE FUNCTION sysdate$ ()
  149.        Function:
  150.        This function retrieves the current date in YYMMDD
  151.        format
  152.  
  153.        DECLARE SUB ansic (x)
  154.        Function:
  155.        This statement causes the program to emit the ANSI
  156.        sequences needed to change the color to the ones desired.
  157.  
  158.        DECLARE SUB broadcast (t$, prt)
  159.        Function:
  160.        Broadcast a string message to a certain channel. Use in a loop to
  161.        broadcast system-wide
  162.  
  163.        DECLARE SUB bs (a)
  164.        Function:
  165.        Performs the number of backspaces needed.
  166.  
  167.        DECLARE SUB cdcheck ()
  168.        Function:
  169.        Sets COMMON SHARED variable cdchk to the current
  170.        carrier detect status.
  171.  
  172.        DECLARE SUB charin (a)
  173.        Function:
  174.        This is the basic low-level character input statement.
  175.        It handles SysOp Local Function Keys also.
  176.                                          VBBS 6.12 Documentation--C-4
  177.  
  178.        DECLARE SUB checkbrk ()
  179.        Function:
  180.        Check for user abort key. Returns status in the COMMON
  181.        SHARED variable brkf.
  182.  
  183.        DECLARE SUB checkq ()
  184.        Function:
  185.        Checks the user's broadcast input queue and prints out
  186.        any data it finds.
  187.  
  188.        DECLARE SUB checktime ()
  189.        Function:
  190.        Sets COMMON SHARED variable left with the time user
  191.        has left on in minutes. Sets COMMON SHARED variable timeon with
  192.        the time user has been on in minutes.
  193.  
  194.        DECLARE SUB cll ()
  195.        Function:
  196.        Clears the local screen.
  197.  
  198.        DECLARE SUB clrs ()
  199.        Function:
  200.        Clears the local screen and the remote user's screen.
  201.  
  202.        DECLARE SUB cxy (y, x)
  203.        Function:
  204.        Sets cursor position on the local screen and the
  205.        remote user's screen.
  206.  
  207.        DECLARE SUB deinitport ()
  208.        Function:
  209.        This statement closes the serial port. It should be
  210.        called before exiting the program. See initport, below.
  211.  
  212.        DECLARE SUB del (f$)
  213.        Function:
  214.        Delete the file specified. Cannot contain wildcards.
  215.  
  216.        DECLARE SUB docr ()
  217.        Function:
  218.        Does a carriage return/line feed sequence.
  219.  
  220.        DECLARE SUB dos (z$)
  221.        Function:
  222.        Perform a DOS function or execute another program ON
  223.        TOP of your program. Control returns to your program where it
  224.        left off when the called function or program exits.
  225.  
  226.        DECLARE SUB drawtextbox (j$, rpr$, iblen)
  227.        Function:
  228.        This command boxes in text with or without an input
  229.        box on the end.
  230.  
  231.        DECLARE SUB dtr (a)
  232.        Function: Sets or resets the DTR line.
  233.                                          VBBS 6.12 Documentation--C-5
  234.  
  235.        DECLARE SUB dvpause ()
  236.        Function:
  237.        Tell desqview this task is just waiting for user
  238.        input, and give time to other tasks.
  239.  
  240.        DECLARE SUB echofile (f$)
  241.        Function:
  242.        Prints the contents of a text file to the screen and
  243.        remote user.
  244.  
  245.        DECLARE SUB endprogram ()
  246.        Function:
  247.        Ends your program safely. This should be the very last
  248.        statement executed by your program. See 'initialize.'
  249.  
  250.        DECLARE SUB flush ()
  251.        Function:
  252.        Flushes the serial input buffer
  253.  
  254.        DECLARE SUB getclr (c, c$)
  255.        Function:
  256.        This function is useful for retreiving the color code
  257.        in string format for storage (and later printing) from the
  258.        numeric code.
  259.  
  260.        DECLARE SUB getline (t$, e$)
  261.        Function:
  262.        e$ plays a key role in the use of this statement.
  263.  
  264.        DECLARE SUB getny (a$, p$)
  265.        Function:
  266.        Displays (optional) prompt, and gets YES or NO input,
  267.        with default (Enter) being NO. Its usually a good idea to check
  268.        for carrier after any type of input statement.
  269.  
  270.        DECLARE SUB getyn (a$, p$)
  271.        Function:
  272.        Displays (optional) prompt, and gets YES or NO input,
  273.        with default (Enter) being YES. Its usually a good idea to check
  274.        for carrier after any type of input statement.
  275.  
  276.        DECLARE SUB initport ()
  277.        Function:
  278.        Reads the serial channel configuration file and
  279.        initializes the serial port.
  280.  
  281.        DECLARE SUB initialize ()
  282.        Function:
  283.        This is the MAIN statement that should be the first
  284.        statement in the main code level of your program. It will take
  285.        care of setting up everything. See 'endprogram.'
  286.  
  287.        DECLARE SUB lockfile (a%)
  288.        Function:
  289.        This statement lets you lock a resource for critical
  290.        multiuser operation. Bits 0 to 12 are *reserved for use by VBBS
  291.        internally.
  292.                                          VBBS 6.12 Documentation--C-6
  293.        DECLARE SUB loopkey (a)
  294.        Function:
  295.        This statement is the main loop of activity during
  296.        user input. Inactivity timeout used is that set in VCONFIG, and
  297.        in addition, user time limits are continually monitored.
  298.  
  299.        DECLARE SUB menu2 (file$)
  300.        Function:
  301.        Searches the VBBS Text Directory in the following
  302.        sequence:
  303.  
  304.        <filename>.MNU   -- Universal Heart Code Menus  if not found:
  305.        if user has ansi:        <filename>.ANS  -- ANSI    else
  306.        <filename>.ASC  -- Pure ASCII
  307.  
  308.  
  309.        DECLARE SUB pause (v$)
  310.        Function:
  311.        The basic "press any key to continue" type statement.
  312.  
  313.        DECLARE SUB rl (a$, m$, ul, j$)
  314.        Function:
  315.        Displays the optional prompt, and waits for user
  316.        input. Only characters in the list of allowed input characters
  317.        will be accepted for input, or numeric input within the range 1
  318.        to ul will be allowed. Numeric input features a smart
  319.        "auto-enter" feature.
  320.  
  321.        DECLARE SUB rr (a$, r$, j$)
  322.        Function:
  323.        Displays the optional prompt, and waits for user
  324.        input. Only characters in the list of allowed input characters
  325.        will be accepted for input.
  326.  
  327.        DECLARE SUB serwrt (t$)
  328.        Function:
  329.        Prints a string to the serial port and screen exactly
  330.        as it is. NO carriage returns or line feeds are added.
  331.  
  332.        DECLARE SUB setloc (x$)
  333.        Function:
  334.        Sets the user's current "action" or "location" on the
  335.        system.
  336.  
  337.        DECLARE SUB statusline ()
  338.        Function:
  339.        Refreshes the status line on the top of the screen.
  340.  
  341.        DECLARE SUB syslog (v$)
  342.        Function:
  343.        This statement appends information into the VBBS
  344.        system log.
  345.  
  346.        DECLARE SUB unlockfile (a%)
  347.        Function:
  348.        This statement lets you unlock a resource for critical
  349.        multiuser operation. Bits 0 to 12 are *reserved for use by VBBS
  350.        internally.
  351.                                          VBBS 6.12 Documentation--C-7
  352.  
  353.        DECLARE SUB waits (s)
  354.        Function:
  355.        Performs time delays, defined in seconds.
  356.  
  357.        DECLARE SUB who ()
  358.        Function:
  359.        Displays who is currently online, and what they are
  360.        doing.
  361.  
  362.        DECLARE SUB writeln (t$)
  363.        Function:
  364.        Prints a string of data to the serial port and the
  365.        local screen, with a carriage return/line feed sequence
  366.        automatically being printed after the string. Writeln also does
  367.        "break checking" (space bar), pause checking (P), and also
  368.        checks the line count to see if its time for a page break.
  369.  
  370.