home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / vdocs.zip / VC10C < prev    next >
Text File  |  1993-12-16  |  16KB  |  381 lines

  1. .TOPIC:                                            
  2. Database Operations
  3.  
  4.                                             VBBS 6.12 Documentation -- 10-C-1
  5.  
  6.  
  7.          ╔════════════════════════════════════════════════════════════════╗
  8.          ║ CHAPTER TEN ANNEX C      DATABASE OPERATIONS                   ║
  9.          ╚════════════════════════════════════════════════════════════════╝
  10.  
  11.  
  12.                 Each database (DB) in VBBS can be used in many different
  13.          ways for storing info.  A DB can store normal messages, file
  14.          descriptions, or even messages with attached files. Also, there
  15.          is no reason why you can't redefine the fields and use them for
  16.          other types of data storage, like a special voting booth or
  17.          customized daily news section.
  18.  
  19.                 Each DB entry is made up of two parts - The Header and the
  20.          Memo Section. The Header contains things like the subject, the
  21.          sender's name, addressee, etc. The Memo Section is the actual
  22.          body of the entry.  The body, while always text, may contain
  23.          either a standard message or a long file description, depending
  24.          on how you are using the database.
  25.  
  26.  
  27.          DATABASE SELECTION
  28.          ══════════════════
  29.  
  30.                 Before you can implement any database commands you must
  31.           first select the exact database you wish to use.  This is done
  32.           with the commands DBGROUP and DB.  You must use the commands
  33.           in the order shown for proper results.
  34.  
  35.           DBGROUP ->  DBGROUP <group identifier>
  36.  
  37.                 This selects the database group that you will be using in
  38.           the script.  The <group identifier> is the character representing
  39.           the DBG as it appears in VCONFIG, Ascii characters 33-255.
  40.           ex: DBGROUP A     <-- This makes DBGroup A the active area.
  41.  
  42.                 Before you can select a database to use, you must first
  43.           select a database group.  Grouping was implemented so that it
  44.           would be much easier to implement global functions and so that
  45.           databases may be added and deleted (using VCONFIG.EXE) without
  46.           the need to edit the scripts every time.  The <group identifier>
  47.           is a single alphabetic character (from A to Z) and you can set
  48.           your database groups up any way you like.  A common set of DB
  49.           Groups might be:
  50.            <A> Public message bases    <H> Hidden/restricted message bases
  51.            <F> Public file bases       <I> Hidden/restricted file bases
  52.            <O> Special bases like voting sections, daily news, etc.
  53.  
  54.           The following read-only variables are loaded when you execute
  55.           the DBGROUP command:
  56.           --------------------
  57.            $DBNUMBER - Stores the total number of databases in the selected
  58.                        group.  The lowest numbered DB in a group is always
  59.                        a 1, so this number supplies the upper limit for
  60.                        loop operations within a database group.
  61.  
  62.  
  63.                                             VBBS 6.12 Documentation -- 10-C-2
  64.  
  65.  
  66.            $DBGROUP  - This stores the character you selected on the DBGROUP
  67.                        command line. Note: This variable is not cleared
  68.                        when you LINK to another script (see section 7.3),
  69.                        so this can be used to keep track of your location.
  70.            --------------------
  71.  
  72.          DB ->  DB <database number>
  73.  
  74.                The DB commands sets the current database for use. You
  75.            must select a database using this command somewhere in your
  76.            script before any of the other database commands (except
  77.            DBGROUP) are used. Once you set the database, it stays set
  78.            until another DB command is executed. Also, the database must
  79.            have been defined previously using VCONFIG.EXE.
  80.  
  81.            The following read-only variables are loaded when you execute
  82.            the DB command:
  83.            --------------------
  84.            $DB       - This stores the database number you have selected.
  85.                        Like $DBGROUP it is not cleared when you LINK
  86.                        between scripts and so using the two variables you
  87.                        can maintain a constant position within your DBs.
  88.            $DBNAME   - The long name of the selected database.
  89.            $DBPATH   - The path (if any) in the 'File Path' section of the
  90.                        VCONFIG Database entry.
  91.            $DBFILE   - The filename of the actual database storage file.
  92.            $HIGHDB   - This is the pointer that stores the number of the
  93.                        user's highest-read entry in the database.
  94.            $NUMBERDB - This stores the total number of entries in the
  95.                        database.
  96.            $WRITESL  - This contains the minimum security level needed to
  97.                        write to the database.
  98.            --------------------
  99.  
  100.  
  101.          LOAD RELATED COMMANDS
  102.          ═════════════════════
  103.  
  104.                 The next few commands are all used to manually load in a
  105.          database entry for display and/or analysis.
  106.  
  107.          LOAD ->  LOAD <value1> <option>
  108.  
  109.                This command loads the database entry <value1> and has
  110.            one command <option>. Adding /Q to the command line will set
  111.            it so the user's $HIGHDB pointer is not updated. The command
  112.            also loads the following variables:
  113.            --------------------
  114.            $ATTFILE  - Filename of a file that is attached to the message,
  115.                        if any.
  116.            $DBCOUNT  - This variable starts at 0 and can be increased by
  117.                        using the ADDCOUNT command (see section 4.3).  It
  118.                        can not be decreased and has one value for each DB
  119.                        (not for each individual message or file.)
  120.  
  121.  
  122.                                             VBBS 6.12 Documentation -- 10-C-3
  123.  
  124.  
  125.  
  126.            $DBDATE   - Creation date and time of the entry.
  127.            $DBFLAG   - The value can have a value of 0 or 1 and can be
  128.                        toggled with the DBFLAG command (see section 4.3).
  129.                        The value of this variable is constant, so if it is
  130.                        turned ON it is treated as ON for all users who
  131.                        access the message/file affected.
  132.            $FROM     - The handle of the person who created the entry.
  133.            $FROMNO   - The user # of the person who created the entry.
  134.            $FROMNODE - VirtualNET node number of sender.
  135.            $SIZE     - Size of attached file, set to 0 if none.
  136.            $SUBJECT  - The subject of the message, or brief description
  137.                        for a file entry.
  138.            $TO       - The handle of the addressee, if any.
  139.            $TONO     - The user # of the addressee, 0 if to ALL.
  140.            $TONODE   - VirtualNET node number of addressee.
  141.            $RESULT   - This variable contains one of these items:
  142.                          DEL if <value1> is marked for deletion
  143.                          OUT if <value1> is greater than the number of
  144.                              available entries (listed in $NUMBERDB)
  145.                          PRI if the DB is private and the user is not
  146.                              the sender, addressee, or has an SL below
  147.                              250 (ie Sysop or CoSysop)
  148.                          OK  in all other cases
  149.            --------------------
  150.  
  151.          DISPLAYMSG <---
  152.  
  153.                 This command displays the message header info to the user.
  154.            It will clear the screen before showing this info if the user
  155.            is using enhanced ANSI (see VBBS.DOC for more information.)
  156.  
  157.          DISPLAYTEXT <---
  158.  
  159.                 This command displays the memo section of the message to
  160.            the user.  It clears the screen like DISPLAYMSG for enhanced
  161.            ANSI users.
  162.  
  163.  
  164.          EDITING COMMANDS
  165.          ════════════════
  166.  
  167.                 All of these commands operate independently of the LOAD
  168.          command.  They do still require you to select a DBGROUP and DB
  169.          before use, however.
  170.  
  171.          ADDCOUNT ->  ADDCOUNT <value1>
  172.  
  173.                 This command increases the number stored in the $DBCOUNT
  174.            by 1 if <value1> is a positive number.
  175.  
  176.  
  177.                                             VBBS 6.12 Documentation -- 10-C-4
  178.  
  179.  
  180.  
  181.          CLEANUP <---
  182.  
  183.                 This performs the PACK function (below) on all databases.
  184.            This command does not require the use of the DBGROUP or DB
  185.            commands before use.
  186.  
  187.          DBFLAG ->  DBFLAG <value1> <switch>
  188.  
  189.                 This command toggles the value stored in $DBFLAG for the
  190.            entry <value1>.  The valid switches are ON or OFF and the
  191.            matching $DBFLAG values are 1 and 0, respectively.
  192.  
  193.          DEL ->  DEL <value1>
  194.  
  195.                This command marks the entry <value1> for deletion.  It
  196.            also returns the $RESULT variable with the possible values
  197.            being OUT, PRI, and OK (see LOAD entry above.)
  198.  
  199.          PACK <---
  200.  
  201.                This command deletes all messages within the selected DB
  202.            that have been marked for deletion and then resequences the
  203.            database.  All user and network pointers are automatically
  204.            updated to show the change in message numbers.
  205.  
  206.          QS ->  QS <value1>
  207.  
  208.                Manually set the user's $HIGHDB pointer to <value1>. If
  209.            <value1> exceeds the value in $NUMBERDB then $HIGHDB is set
  210.            to equal $NUMBERDB.
  211.  
  212.          SAVE -> (command on next line due to length)
  213.          SAVE <value1> <value2> <string3> <value4> <filename5> <value6>
  214.  
  215.                This command makes a database entry and saves it in the
  216.            current database.  The variables used are:
  217.            --------------------
  218.            <value1>    - This is the user # that the message is addressed
  219.                          to, this should be set to 0 if to ALL.
  220.            <value2>    - This is the network address of the addressee,
  221.                          use $NODE if the addressee is local.
  222.            <string3>   - This will be the $SUBJECT of the saved message.
  223.            <value4>    - This contains the size of the attached file, use
  224.                          0 if none.
  225.            <filename5> - This is the name of the attached file, use "" if
  226.                          none.
  227.            <value6>    - This is the network ID of the addressee, use 1 if
  228.                          the addressee is local.
  229.            --------------------
  230.                The message saved uses the above information to create the
  231.            header and then takes the contents of the buffer and uses it as
  232.            the main body of the message.  See section 5.x for information
  233.            on how to use the buffer.  This command can not be used to send
  234.            files attached to emails, it can only be used to add files to a
  235.            database listing.
  236.  
  237.  
  238.                                             VBBS 6.12 Documentation -- 10-C-5
  239.  
  240.  
  241.  
  242.          SEARCH ->  SEARCH <value1> <number2> <string3>
  243.  
  244.                This command searches the contents of the database for
  245.            <string3> starting at the entry <value1>. The search is case
  246.            insensitive on <string3>. The value for <number2> can be any
  247.            of the following:
  248.              1 - Search the TO field    ┌<string3> is ignored here as it┐
  249.              2 - Search the FROM field  │looks for the current user only│
  250.                                         └  with both of these settings. ┘
  251.              3 - Search the SUBJECT/TITLE field, <string3> can be any word
  252.                  or group of words.
  253.              4 - Search the FILENAME field, <string3> must be an acceptable
  254.                  DOS filename including wildcards.
  255.              5 - Search the FILENAME field, <string3> must be an acceptable
  256.                  DOS filename with no wildcards.
  257.  
  258.            This command also returns two variables:
  259.            --------------------
  260.            $RESULT = OUT if <string3> is not found, OK if otherwise.
  261.            $SEARCH = the entry number where <string3> was found.
  262.            --------------------
  263.  
  264.  
  265.          VIEWING & WRITING
  266.          ═════════════════
  267.  
  268.          ╔════════════════════════════════════════════════════════════════╗
  269.          ║** Note:All commands marked with a (*) before the description **║
  270.          ║**      will only work properly if implemented from within    **║
  271.          ║**      a script that was called from a function block that   **║
  272.          ║**      has DBGroup(s) listed in it.  They take the letters   **║
  273.          ║**      for the DBGroups to use from the second line of the   **║
  274.          ║**      .FB the script was called from.  The DBGROUP and DB   **║
  275.          ║**      commands do not affect any of these commands.         **║
  276.          ╚════════════════════════════════════════════════════════════════╝
  277.  
  278.                These commands allow the user to view messages and move
  279.            around within your databases.
  280.  
  281.          CHOOSETOPIC <---
  282.  
  283.          (*)   This command lists all the DBGroups (also known as topics)
  284.            and allows the user to switch over to a different one.  The
  285.            user can also view an index of all databases available from
  286.            within this option.
  287.  
  288.          LISTBASES <---
  289.  
  290.          (*)   This lists all the DB's in the current DBGroup.
  291.  
  292.          NEXTBASE <---
  293.          PREVBASE <---
  294.  
  295.                These commands move to the next or previous database within
  296.            the selected DBGroup, respectively.
  297.  
  298.  
  299.                                             VBBS 6.12 Documentation -- 10-C-6
  300.  
  301.  
  302.  
  303.          POST <---
  304.  
  305.                This lets the user to enter a message into the active DB.
  306.  
  307.          READSEQMSG <---
  308.  
  309.                This command allows the user to read the messages within
  310.            the current database.  It also contains a search feature.
  311.  
  312.          READNEWMSG <---
  313.  
  314.                This starts the user's new message scan, showing all new
  315.            messages in databases that are in the user's quick-scan list.
  316.  
  317.  
  318.          SCANMSG <---
  319.  
  320.                This command brings up a summary of the messages in the
  321.            selected database.  The user can select a message to read from
  322.            this listing and has access to all sub-menu commands while
  323.            reading the messages.
  324.  
  325.          SELECTBASE <---
  326.  
  327.          (*)   This command lists all the bases and then allows the user
  328.            to select a different DB as the current one.  The user can
  329.            also switch to a different DBGroup with this command.
  330.  
  331.          SETQUICKSCAN <---
  332.  
  333.          (*)   This command allows the user to select what databases he or
  334.            she would like to view during a new message scan.
  335.  
  336.  
  337.          E-MAIL FUNCTIONS
  338.          ════════════════
  339.  
  340.                The E-mail section of the database structure is a separate
  341.            entity.  To make it the active database for using the SAVE
  342.            and BUFFER commands you need to execute the following command:
  343.  
  344.          SETEMAIL <---
  345.  
  346.               This command is used instead of the DBGROUP & DB commands to
  347.            make the e-mail section the active database for use with BUFFER
  348.            and SAVE (see sections 5.x and 4.3, respectively.)
  349.  
  350.          FEEDBACK <---
  351.  
  352.                This brings up the multi-feedback list (see VBBS.DOC)
  353.            and prompts the user to send a message to the sysop.
  354.  
  355.  
  356.                                             VBBS 6.12 Documentation -- 10-C-7
  357.  
  358.  
  359.  
  360.          QUICKMAIL <---
  361.  
  362.                This brings up the multi-mail menu for sending e-mail to
  363.            a group of people all at once.
  364.  
  365.          READALLEMAIL <---
  366.  
  367.                This is a sysop command that allows you to read all E-mail
  368.            currently in the system.
  369.  
  370.          READEMAILFROM <---
  371.          READEMAILTO <---
  372.  
  373.                These commands allow the user to read all the E-mail FROM
  374.            them or addressed TO them, respectively.
  375.  
  376.          SENDEMAIL <---
  377.  
  378.                This command allows the user to send E-mail to other users.
  379.  
  380.  
  381.