home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / v611docs.zip / VMAIN611.ZIP / V-P < prev    next >
Text File  |  1993-10-12  |  13KB  |  367 lines

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