Possibilities - Stupid QAL Tricks 8/92

Contact:   eSoft, Inc. (Makers of TBBS)
           15200 E. Girard Ave., Suite 3000
           Aurora, CO  80014
           (303) 699-6565      Voice
           (303) 699-6872      Fax
           (303) 699-8222      BBS
           support@esoft.com   E-Mail

STUPID QAL TRICKS 8/92
----------------------

*** From August 1992 Possibilities Newsletter ***
*** Copyright 1992 by eSoft, Inc.  All Rights Reserved ***

Stupid QAL Tricks
by Alan Bryant

One of the most significant and useful new features of the new TBBS 2.2 
release is the Question and Answer Language, or QAL.  This keyword based 
script language for developing questionnaires is a major advancement over 
what it replaced:  QAEDIT, the questionnaire editor which has been part of 
TBBS since its inception over 10 years ago.  Each month this column
describes ways you can use QAL to do things you may not have though possible 
with TBBS. 

Power Beyond the Obvious

In past "Stupid QAL Tricks" columns we have focused on using QAL for its 
primary function of questionnaires and voting.  We've shown you how to build 
elaborate questionnaires that change based on user input, ask conditional 
questions, and even create a sort of user database from the answers.

In this issue, however, we will show you how you can use QAL in combination 
with the TBBS auto-execute menu capability to solve problems in ways that 
may not be obvious at first glance.  The type of solution we will describe 
here is an example of the advanced capabilities of TBBS.  The menu template 
capability of TBBS, coupled with QAL and insertion parameters can solve far 
more problems that it may first appear.

Tracking Usage of Specific Features

The TBBS billing classes allow you to either allot time for, or track usage 
of, up to nine menu classes on your system.  But sometimes you want to know 
how many times a particular feature is used or what group of users are using 
it.  This is beyond what is revealed by the simple accumulation of time 
spent by all users in a menu.

By combining a QAL program and auto-execute menu entries, however, you can 
build an unlimited number of specific tracking statistics for whatever area 
of your BBS you wish to track.  For our example let's assume you wish to 
track the number of people who enter a specific download area and when they 
enter it.  First you need to alter the menu that contains the download entry 
by changing the download entry to a MENU GOSUB entry as follows:

Entry: <D>ownload Files
KEY=D TYPE=5 OPTDATA=DTRK

Then you must create a new menu DTRK which implements the tracking QAL as 
well as the download.  This menu would be as follows:

MENU: DTRK
Entry:
KEY=^@ TYPE=32 OPT DATA=TRACKDL /NL /NP
Entry:
KEY=^@ TYPE=46
OPT DATA=your original download entry
Entry:
KEY=^@ TYPE=12 OPT DATA=1
ENDMENU:

This menu will execute the QAL file TRACKDL when the user selects the 
download command from the original menu.  The /NL switch keeps this QAL 
execution from being logged in the normal dayfile and the /NP switch 
prevents the "Press any Key" prompt from occurring.  This means that there 
is no indication the QAL file has run other than what the QAL itself does.

After running the QAL file, this menu will then execute the original 
download command.  When the user exits the download command, this menu will 
then return to the original menu.  To the user the operation will look the 
same as before, but the QAL file TRACKDL will have been executed.

Now that we have set TBBS up to automatically execute a QAL when the user 
does a download, let's look at what that QAL might do to create a tracking 
file.  One example of such a QAL file might be:

Q&A: TRACKDL
PUTSVY: 
%NAME% %DATE% %TIME%
ENDBLOCK:
ENDQ&A:

With this QAL file, the TRACKDL.SVY file will build a list of one line 
entries that show who entered the download area and when.  You can, of 
course, expand this with any information you wish to add to the tracking 
file.

Making .SVY files dBASE compatible...

If you have TDBS, or use another off-line database such as dBASE, Paradox 
etc., you may want to make your .SVY file "ready-to-go" for those programs 
to read.  Then you can easily create analysis utilities to get the 
information you are after.

Most database programs support a data format called "comma delimited ASCII".  
This simple, text based format is a de facto standard for import and export 
of data between database products that otherwise wouldn't be able to pass 
data.

To make the TRACKDL.SVY file store it's data in comma delimited ASCII, you 
would make the following small change to the previous QAL source code:

Q&A: TRACKDL
PUTSVY: 
"%NAME%","%DATE%","%TIME%"
ENDBLOCK:
ENDQ&A:

By explicitly adding the quote marks to the QAL command line you have 
changed the output to comma delimited ASCII format.  It can be imported and 
manipulated by virtually any database application.  This opens the door to 
report generation, billing of usage, etc.  The comma delimited data 
technique can be applied to a variety of questionnaires, including new user 
registrations.  It's a convenient way to get input from a user that can be 
worked with later using your favorite database program.

If you start to use tricks like these you will find that the power of TBBS 
to solve your problems is much larger than it appears.  Feel free to 
experiment with using QAL files in innovative ways and we'd like to hear 
about any interesting solutions you come up with.

- END -
PS0892-6
Rev. 8/92

Copyright (C) 1994 eSoft, Inc., All Rights Reserved.  Permission granted
to distribute this file in its entirety, without modification, to any
interested party.  Any other use requires the written permission of
eSoft, Inc.

IMPORTANT:  The information herein is subject to change without notice.
Please call or write to confirm factual information of importance to you
or your organization.

