home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_BAS / PRO98DOC.ZIP / README < prev   
Text File  |  1994-01-29  |  41KB  |  896 lines

  1. A PROZOL COMPILER !!!!
  2. = ====== ======== ====
  3. Well, almost.  Prozol can now "prep" it's programs.  It is more like tokenizing
  4. then compiling, but for our purposes here, we will refer to raw programs as
  5. "interpreted" and prepped programs as "compiled".  The compiled programs run
  6. a HELL of a lot faster than the regular interpreted ones.  In fact, because
  7. of some significant internal changes to prozol, the interpreted programs
  8. now actually run a lot slower.  About ten times slower.  I'll see if I can
  9. up this.  Prozol can automatically tell if a file is compiled or not when
  10. you LOAD or RUN it, so you can freely intermix compiled programs with
  11. interpreted ones.  The compiled ones are loaded very fast and instantly
  12. begin running.  The interpreted ones are loaded and then executed with
  13. prozol compiling each line before it is executed.  This still makes it easy
  14. to write and debug programs, but the slow speed can be a real drag.  I will
  15. take steps to speed up the interpreted programs in the next version.
  16.  
  17. To make compiling easier, I have built in a command line switch that tells
  18. prozol to compile one or a bunch of files, and then exit to DOS when it's
  19. done.
  20.  
  21. To see the big difference between version .96 and .97, try this line
  22. on each one:
  23.  
  24.         incr x:print x:until len inkey
  25.  
  26. (since prozol will compile the whole line before executing it, it will
  27. run just as fast as if you had compiled it to a disk file.)
  28.  
  29. To see how much slower prozol .97 is at interpreting, try the same
  30. program, like this:
  31.  
  32.         1 start
  33.         2 incr x
  34.         3 print x
  35.         4 goto start if not len inkey
  36.  
  37. then type RUN.  OUCH!  My five year old can count on his fingers faster
  38. than this!
  39.  
  40. To compile this program, simply type
  41.  
  42.         XSAVE "test.prx"
  43.  
  44. Saving it as a compiled file will also compile it in memory, so now when
  45. you run it, you will see the dramatic speed difference of compiled PROZOL!
  46.  
  47.  
  48.  
  49. BUGS not yet corrected
  50. ======================
  51. - PCBTYPE and DISPLAY can crash on <> and @() symbols
  52. - internal Xmodem does not work.  Use DSZ instead.  I might just phase it out.
  53. - sometimes a keyboard hit doesn't do anything in scrolling menus. ???
  54. - Because of a bug in the internal ANSI driver I am using, the blue background
  55.   is actually showing up as orange (low intensity yellow).  Hopefully this
  56.   is corrected in a newer version which I will look for.  The internal ANSI
  57.   driver is quite a bit faster than DOS and does not require ANSI.SYS to
  58.   be loaded, so memory is saved.
  59. - UPDATE, and DELETE of the high performance indexes is not yet
  60.   implemented.  (Gee, that makes them extremely useful, huh?)
  61. - DBASE indexes are updated without deleting the old entry
  62. - INPUT to a dbase field does not work.  You must use a temporary variable
  63. - Error handler closes all files (oops)
  64.  
  65. FIXES/CHANGES to version 0.98
  66. + DO now required before WHILE or UNTIL.  DO must be used alone, WHILE and
  67.   UNTIL are followed by an expression.  This allows DO loops to be placed
  68.   in the middle of a line or subroutine.  DO loops may be nested to 32 levels.
  69. + Lost carrier is detected immediately.
  70. + Fixed baud rates (no adjust) at 9600 and above
  71. + Added PROC keyword (see below)
  72. + Compiles programs about twice as fast.
  73. + Went back to DOS level ANSI driver.  Hanlin's didn't work in monochrome
  74.   under Desqview 2.4+
  75. + Implemented RIPScript commands (see RIP.DOC)
  76. + Com ports 3 and 4 addresses are poked into BIOS (required by most machines)
  77. + dBASE indexes (BTREE) can now handle 2 trillion records instead of just
  78.   65,535 records.
  79.  
  80. PROC keyword
  81. ============
  82. Anywhere in your program (you must compile or XSAVE it to use PROC) you can
  83. have a procedure defined like this:
  84.  
  85.         procname proc : { statements ......
  86.                             .......}
  87.  
  88. or
  89.  
  90.         procname proc : statement
  91.  
  92. Then, anywhere in your program (or in subsequently loaded and executed programs)
  93. you can say
  94.  
  95.         call procname
  96.  
  97. and the procedure will execute.
  98.  
  99.  
  100. FIXES/CHANGES to version 0.97
  101. + Error on GOTO/GOSUB shows the right line number where it crashes
  102.   (it was showing line number -2)
  103. + Interpreted programs execute a LOT slower now (Sorry, this has to be)
  104.   (to make them run faster, block them with { and }.  There are certain
  105.   restrictions to lines blocked like this, so do this carefully)
  106. + "compiled" programs execute a LOT LOT LOT LOT faster.
  107. + A command line compiler is built into prozol:
  108.         To compile programs with prozol from the command line, type:
  109.  
  110.                 PROZOL -ext filespec
  111.  
  112.         where "ext" is any extension to give your compiled programs, and
  113.         "filespec" is any file, wildcard spec, or list of files to compile.
  114.         For example,
  115.  
  116.                 PROZOL -PRX *.PRO
  117.  
  118.         This will compile every file in the current directory with a .PRO
  119.         extension to files with the same name and a .PRX extension.  To set
  120.         PROZOL to assume that all RUN and GO commands will look for .PRX,
  121.         use the EXT command (EXT ".PRX").  Prozol will look for files with
  122.         this extension.  If there is no file with a PRX extension, prozol
  123.         will try to run .PRO, .TTY, and .BBS before giving up.
  124.  
  125.         One more example:
  126.  
  127.                 PROZOL -PRX MAIN.PRO LOGIN.PRO LOGIN.MAP COLORS.PRO
  128.  
  129.         This will compile the four files.  All files will have an extension
  130.         of .PRX
  131.  
  132.  
  133. + LOAD and RUN automatically detect whether a program is compiled.
  134. + LOAD and RUN try default extension, then PRO, BBS, TTY, then PRX
  135. + PLOAD and PRUN will load and pre-compile an interpreted program to memory
  136. + XLOAD will load a compiled prozol program (so will LOAD and RUN)
  137. + XSAVE will save an uncompiled program to disk in compiled format
  138. + PRX is assumed, but not required, for "compiled" prozol programs
  139. + a single line or block of interpreted code will run just as fast as
  140.   compiled code.  use { and } to block several lines of interpreted code
  141. + CALL FILE will work on raw or compiled prozol files.
  142. + All PROZOL commands must be 8 letters or less, therefore...
  143. + the EXTENSION command has been changed to EXT
  144. + GETCOMMENT has been changed to GETCOMM
  145. + EDITCOMMENT has been changed to EDITCOMM
  146. + SETPROMPT has been changed to SETPRMPT
  147. + CREATEINDEX is now CREATEI
  148. + CREATEFORMAT is now CREATEF
  149. + !!!! You cannot RE-SAVE a compiled program. DON'T TRY (you'll kill it) !!!!
  150.   (in otherwords, you can't load a compiled program and then type XSAVE ...)
  151. + Internal representation of string constants is high ASCII characters
  152.   (this is not important) allowing thousands of string constants per program
  153. + the LINE command now works as it should.  Returns the contents of a line
  154.   (i.e. CALL LINE TimeOfDay)
  155. + ERRORMSG [on|off] (default on) OFF disables full error message at prog end
  156. + GOTO and GOSUB now support line numbers (must be physical line).  This
  157.   is not reccommended, since brackets and line continuation makes it difficult
  158.   to tell what a line number will be when the program is loaded)
  159. + Added some new functions (the were in the old @fun() format, but not
  160.   available directly in prozol statements):
  161.         LOOKUP file,searchstring
  162.                 returns the entire line of a file where searchstring occurs
  163.                 at the beginning of that line.
  164.         USING formatstring,number
  165.                 works just like the BASIC USING$ function
  166.         FIX string,size
  167.                 returns a string fixed to a specific length
  168.         PARM
  169.                 returns the current modem parameters (i.e. 2400,N,8,1)
  170.         PORT
  171.                 returns the current port number (1-4)
  172.         CRC string
  173.                 returns a 16 bit CRC of the string argument
  174.         DUP character,number
  175.                 returns the character duplicated a number of times
  176.         BAUD
  177.                 returns the current baud rate (i.e. "2400")
  178.  
  179. + PCBTYPE prompts differently at the end of file
  180.  
  181. FIXES/CHANGES to version 0.96
  182. + PCBTYPE function returns a filename or filenames selected.  It is used to
  183.   dump a PC-board file listing to the screen and prompt the user to select
  184.   one or more files.  The syntax is: SET F TO PCBTYPE "pcbfile",""
  185.   The second parameter may contain an optional search string and only files
  186.   that contain the search string will be displayed, like ".ZIP", etc.  Date
  187.   ranges are coming soon.
  188. + DISPLAY command dumps a file with [S]top, [N]onstop, continue... use the
  189.   MORE nn command to specify number of lines before pause, or MORE 0 to
  190.   disable pause.  DISPLAY does not execute $metacommands in the file, just
  191.   vars, symbols, and functions.  Similar to the TYPE command.
  192. + SUBDIR function returns true if a specified directory name exists
  193. + added EDLIN line editor, Invoke with EDLIN "filename", includes help screen
  194. + added DIR function which works just like PB's DIR$ function
  195. + Default file extension is .PRO, however, if whatever the default is, is
  196.   not found, prozol will attempt to load or run .TTY, .BBS, then .PRO in
  197.   that order.
  198. + Increased number of variables from 256 to 2048
  199. + Fixed problem with assigning values to mapped strings not overwriting
  200.   remaining space (i.e., if A.B was "abcdefg" and you said SET A.B to "X"
  201.   it would have set A.B to "Xbcdefg".  This is now fixed.
  202. + fixed READ from a sequential file
  203. + added EXTENSION command to set default program extension
  204. + fixed direct input to a mapped element (input "prompt:",main.field)
  205. + GO commands only execute the contents of variables.  For instance, if
  206.   you were to say GO FILES, prozol would look for a variable named
  207.   $$FILES$$.  If this variable exists, then whatever is in it will be
  208.   executed as a literal command.  For instance, you could say
  209.   SET $$FILES$$ TO "run '\pro\files.pro'" and then it would work.  The
  210.   GO commands will be ignored if there is no GO variable.
  211. + Removed calls to task manager with a settable constant (we don't really
  212.   need that part yet, for god's sake)
  213.  
  214. FIXES/CHANGES to version 0.95
  215.  
  216. + added a working program example, PROFILE.PRO.  See PROFORM.DOC for more info.
  217.  
  218. + IXCREATE High performance index - see further down chapter on INDEXES
  219.  
  220. + PROFORM.EXE program creates map structures and input field code
  221.   SEE PROFORM.DOC
  222.  
  223. + remarks can be embedded anywhere in code with /* remark */
  224.   if the remark is the last thing on the line, you can omit the closing */
  225.  
  226. + INPUT FIELDS is now a function which returns false if user pressed ESC
  227.   Now, instead of just saying INPUT FIELDS to get fullscreen data entry,
  228.   you should say something like SET OK TO INPUT FIELDS, then OK will contain
  229.   true if the field editing routine was terminated normally (save the data)
  230.   or FALSE if the user had pressed ESCAPE (abort the data).  Remember that
  231.   the FIELD statement is used to define up to 256 data entry fields on
  232.   the screen.
  233.  
  234. + Line continuation is possible with underscore _
  235.   The underscore must be the very last character on the line.  Prozol looks
  236.   for underscores which are immediately followed by a carriage return.  If
  237.   there is an additional space (or a remark) after the underscore it will
  238.   not work properly.
  239.  
  240. + Execution of programs is about twice as fast as version 0.94.  I figured
  241.   out a simple way to parse out the interpreted lines without having to
  242.   make recursive calls to the EXEC function.  Also the ANSI output is based
  243.   on an internal driver rather than calls to DOS.
  244.  
  245. + CALL FILE can invoke much larger file subroutines.  Since the calls to
  246.   EXEC are not recursive, a true 32K limit to CALL FILE is achieved.  The
  247.   earlier method was running out of stack space after about 50 lines of
  248.   code were loaded.  CALL FILE invokes a prozol program in a disk file
  249.   as though it were a subroutine, and the disk cache will make it pretty
  250.   much memory resident if used often.
  251.  
  252. + INPUT FIELDS do not show first half of a map variable (i.e. USER.NAME).
  253.   For instance, specifying a screen field for the variable USER.ID would
  254.   only show the fieldname ID: before the field, and not the word USER or
  255.   the period.
  256.  
  257. + GO or CTRL-G can only specify programs to run, not execute commands
  258.  
  259. + Labels can be followed by remarks (/* xxx */)
  260.  
  261. + ANSI.SYS is no longer required, ANSI driver is internal.  This driver
  262.   currently has a color bug which causes an instruction to change the
  263.   background color to blue actually changes it to low intensity yellow, or
  264.   orange.  This will be fixed as soon as possible, I hope.
  265.  
  266. + Source code debugging options - there are two constants defined near the
  267.   beginning of PROZOL.BAS.  if MONOWATCH is set to %TRUE then all video
  268.   i/o will appear simultaneously on a secondary monochrome monitor.  This
  269.   will allow you to see how your output looks on both a color screen and
  270.   a mono screen at the same time, or to keep an eye on a copy of prozol
  271.   which is running in the background while you do something else in the
  272.   foreground.  The other constant is KILLF10.  If this constant is set to
  273.   true then a key trap is enabled around the F10 key.  Any time the F10
  274.   key is pressed, prozol will immediately terminate.  This helps you get
  275.   out of infinite loops and other jam ups while debugging prozol programs.
  276.   You must re-compile PROZOL for these constants to work.
  277.  
  278. FIXES/CHANGES to version 0.94
  279. + TIMEOUT with no argument returns current minutes for usertime#
  280. + IXSTITCH command adds a record to a "Stitch" index
  281. + Quoted strings do not need to be spaced or separated by a comma or semicolon
  282. + Fixed WRITE # error
  283. + TASK n,Task - sets background execution of certain statements
  284.   ==The remainder of the task functions are pending (do not use these yet!)==:
  285.   TASK     - set a task to a prozol program on disk
  286.   SUSPEND  - suspend a certain task or ALL
  287.   RESUME   - resume a certain task or ALL
  288.   FINISHED - returns true if a certain task is finished
  289.   STATUS   - returns a status flag of a certain task
  290.   FREETASK - returns the next free task number
  291.   KILLTASK - kills a certain task, or ALL
  292.   SIGNAL   - returns true if a certain signal has been set by a certain task
  293.   DEVOTE   - devotes all time to a certain task or ALL until it's finished
  294.   DEPTH    - sets the depth of background processing for tasks
  295.   ============================================================================
  296. + SETENV "envar=value" - sets environment variables
  297. + INSIDE searchstring, search1, search2, search3 ...
  298.   - returns true if any of the arguments is contained within searchstring
  299. + FLIP - places the first word of an argument at the end, i.e., if NAME is
  300.   set to "OLSON ERIK L" then FLIP NAME would make NAME="ERIK L OLSON"
  301. + CAPS - converts argument to lower case and caps the first letter of each word
  302.   i.e. if NAME is "ERIK L OLSON" then CAPS NAME would make NAME="Erik L Olson"
  303.  
  304. FIXES/CHANGES to version 0.93
  305. + PREP supports up to 676 string constants per block or line instead of 26.
  306. + AUTOEDIT command formats names, addresses and salutations. (see below)
  307. + Fixed GO to support only program files and not direct commands
  308. + Added support for unlimited OPENs for sequential or random access (see below)
  309. + data structs (MAPs) for reading and writing random access files (see below)
  310. + High performance index functions for random access files (see below)
  311. + READ and READ ALL fixed for sequential file input
  312. + The syntax of all file I/O has changed
  313.   - OPEN
  314.   - READ
  315.   - WRITE
  316.   - EOF,LOF
  317.   - MAP
  318.   - GET MAPPED
  319.   - PUT MAPPED
  320.  
  321.   OPEN - Open a file for any type of access
  322.  
  323.          OPEN mode, buffer, filename [,length]
  324.  
  325.         Where mode is "I", "O", "A", "R", or "B", just like BASIC.  Buffer
  326.         is any valid variable name or an arbitrary number with a pound sign
  327.         (the pound sign MUST be used if using a number).  The filename is
  328.         a variable or quoted string, and if it is a random access file, then
  329.         a length parameter must be specified.  For instance,
  330.  
  331.         OPEN "R", #1, "DATABASE.DAT", LEN User
  332.  
  333.         This would open a random access file with the record length of
  334.         a mapped variable called "User".
  335.  
  336.   READ and READ ALL - Input a line or field from a sequential file
  337.  
  338.         READ #1,A,B,C,D
  339.         READ #1, ALL Temp   or  READ ALL #1, Temp
  340.  
  341.         The READ statement can be followed by many variables.  Elements
  342.         are read one item at a time from a comma-delimited ASCII file.
  343.         READ ALL is followed by one variable which will contain an
  344.         entire line read from the file.  The buffer can be any variable
  345.         or number with a pound sign used to open the file.
  346.  
  347.   WRITE - writes a line to a file opened for "O" or "A"
  348.  
  349.         WRITE #1, "This is a line for the file!" & CR
  350.  
  351.         WRITE will not put a carriage return or delimit variables, you
  352.         must do that yourself.  Write can process embedded variables
  353.         and functions just like PRINT and TYPE.  As in:
  354.  
  355.         WRITE #1, "<NAME>,<ADDRESS>,<PHONE>,@DATE()" & CR
  356.  
  357.         WRITE will write all arguments in sequence to the file without
  358.         delimiters.
  359.  
  360.   EOF, LOF - functions return End Of File and Length of File.  EOF returns
  361.        true if the end of file has been reached.  LOF returns the current
  362.        length of an open file.
  363.  
  364.         IF EOF #1:PRINT "End of file!"
  365.  
  366.         PRINT "File is " LOF #1 " bytes long."
  367.  
  368.   MAP
  369.   ===
  370.   MAP allows you to define a record and the fields it contains.  A MAP
  371.   variable can be used directly or with a file.  MAP variables are for
  372.   defining the record structure of a random access file "R".
  373.  
  374.         MAP mapvar TO length, n as var1, n as var2, n as var3...
  375.  
  376.   The sum total of the fields within the map string do not have to equal
  377.   the size of the map string, but they may not exceed it.  Once a MAP
  378.   variable has been assigned, you may use the elements within it, or
  379.   read the MAP variable directly, but you may not directly alter the
  380.   MAP variable (except to copy it to another MAP variable).
  381.  
  382.         MAP Main TO 60, 10 AS FName, 10 AS LName, 20 AS Add1, 20 AS Add2
  383.  
  384.    This line would create a fixed length string called "Main" which would
  385.    be 60 characters long.  The string would contain four fields of 10, 10,
  386.    20, and 20 characters within it.  To use these variables, you must
  387.    refer to them in this manner:
  388.  
  389.         SET Main.FName to "Erik"
  390.         SET Main.LName to "Olson"
  391.  
  392.   Main.FName will not conflict with another variable called "FName" if
  393.   it exists, but you cannot have another variable called "Main".  Thus,
  394.   you could map two strings with the same field names, and they would
  395.   not conflict with each other.  You can copy one mapped string to another:
  396.  
  397.         SET Main TO Main2
  398.  
  399.   But the mapping information will not copy over.  You must individually
  400.   map each string.  To erase a string and it's mappings, simply CLEAR the
  401.   main string.  You may also clear an individual field, which will just
  402.   set it to nul.  If you attempt to redefine MAIN, as in
  403.  
  404.         SET Main to "Hey!"
  405.  
  406.   You will destroy the string, and an Invalid Map error will occur the
  407.   next time you attempt to use it.
  408.  
  409.   GET MAPPED
  410.   ==========
  411.   GET a mapped record from a random access file ("R").  The syntax is:
  412.  
  413.         GET MAPPED variable IN buffer AT record
  414.  
  415.   For instance, if we had a file which contained many 60 byte records
  416.   like the "Main" that we mapped above, then to open it and print the
  417.   100th record, we'd use these lines:
  418.  
  419.         MAP Main TO 60, 10 AS FName, 10 AS LName, 20 AS Add1, 20 AS Add2
  420.         OPEN "R", #1, "NAMES.DAT", LEN Main
  421.         GET MAPPED Main IN #1 AT 100
  422.         PRINT Main.FName
  423.         PRINT Main.LName
  424.         PRINT Main.Add1
  425.         PRINT Main.Add2
  426.  
  427.   PUT MAPPED
  428.   ==========
  429.   To write a record to a random access file, simply assign the fields of
  430.   the mapped variable and then use the PUT MAPPED command with this syntax:
  431.  
  432.         PUT MAPPED variable IN buffer AT record
  433.  
  434.  If we wanted to append a new record to the end of the above database, we
  435.  would simply figure out how many records are in the database and then
  436.  PUT MAPPED a new record to the end, like this:
  437.  
  438.         PUT MAPPED Main IN #1 AT CALC (LOF #1/LEN Main)+1
  439.  
  440.   HIGH PERFORMANCE INDEXES
  441.   ========================
  442.   IXCREATE - Create a high performance index.
  443.  
  444.   You must have a MAPPED database currently open.  The syntax for indexing
  445.   it is:
  446.  
  447.         IXCREATE indexfile, mapname.fieldname, mapbuffer
  448.  
  449.   For instance, if you have a database opened for random access reading and
  450.   writing, and you are using a structure named USERS to get and put records
  451.   to the file (USERS is a MAP structure), and you wanted to index on the
  452.   field named "ID", then you could say something like this:
  453.  
  454.         IXCREATE "USERID.IX", USERS.ID, #1
  455.  
  456.   Where "USERID.IX" would be the name of the index file to create, USERS is
  457.   the name of the current structure being used to access the database, ID
  458.   is a field of the USERS structure, and #1 is the file handle of the
  459.   database which is currently open.  For instance, here is a whole program
  460.   which might be used to index an existing file:
  461.  
  462.     MAP USERS AS 100, 10 AS NAME, 10 AS ID /* we don't care about the rest */
  463.     OPEN "R", #1, "USERS.DAT" LEN USERS    /* open the database file */
  464.     IXCREATE "USERID.IX", USERS.ID, #1     /* create an index for ID field */
  465.  
  466.   Then, to use the index, you could do this:
  467.  
  468.     IXOPEN "USERID.IX" AS #2               /* open the index */
  469.     SET R TO IXFIND #2, "ERIK"             /* find a field, return in R */
  470.     GET MAPPED USERS FROM #1, RECORD R     /* get the actual record now */
  471.  
  472.   You can have as many open indexes at once as you wish, for as many
  473.   different databases as you wish.  An index does not have to be associated
  474.   with any given database, and vice versa.  All of the stand-alone index
  475.   functions return a numeric record number.  You can then use that
  476.   record number to get a record from a database.
  477.  
  478.         IXOPEN "filename" AS buffer
  479.  
  480.   For example, if you had an index called "NAME.IX" you could prepare it
  481.   for use like this:
  482.  
  483.         IXOPEN "NAME.IX" AS #1
  484.  
  485.   IXFIND and IXSCAN are functions which return a record number of a match
  486.   was found in the index.  IXFIND searches alphabetically for a matching
  487.   item which starts with the same sequence of characters as the search string,
  488.   while IXSCAN will scan the index sequentially from the beginning and
  489.   will stop when it finds the search string anywhere in the indexed field.
  490.  
  491.         SET R TO IXFIND #1, "OLSON, E"
  492.  
  493.   If "OLSON, E" occurs in the index, then IXFIND will return the record
  494.   number.  The above statement has this record number assigned to the
  495.   variable R.
  496.  
  497.         SET R TO IXSCAN #1, "ERIK"
  498.  
  499.   If the word "ERIK" occurred anywhere within the index, R will be assigned
  500.   to it's first occurance.
  501.  
  502.         SET R TO IXSCAN REST #1, "ERIK"
  503.  
  504.   This will continue the scan from where the previous IXSCAN left off,
  505.   or from whatever is the current point in the index.
  506.  
  507.         IXSKIP buffer,records
  508.  
  509.   IXSKIP will return a new record number after the indexed has been skipped
  510.   in forward or backward.  I.E:
  511.  
  512.         SET R TO IXSKIP #1, 1
  513.  
  514.   Will skip forwards one record in the index and return the record number
  515.   in R
  516.  
  517.         IXNEXT buffer
  518.         IXPREV buffer
  519.         IXTOP buffer or IXFIRST buffer
  520.         IXBOTTOM buffer or IXLAST buffer
  521.  
  522.   These functions skip forwards to the next or backwards to the previous
  523.   record, to the beginning or end of the index, and return the record
  524.   number it corresponds to.
  525.  
  526.   IXBOF returns true if you are currently at the top of the index
  527.   IXEOF returns true if you are currently at the end of the index
  528.  
  529.   IXWAS returns the last record number you were at and relocates
  530.         the index pointers to continue on from there again (like if
  531.         you had just tried to search for something else and wanted to
  532.         go back to where you were).  An unsuccessful search will always
  533.         retain the most recent record number, which can be retrieved
  534.         with IXWAS.
  535.  
  536.   IX returns the current record number value for an index, in case you
  537.      need it again without searching (like if you had switched indexes
  538.      or something).
  539.  
  540.   IXCREATE - Create a high performance index.
  541.  
  542.   You must have a MAPPED database currently open.  The syntax for indexing
  543.   it is:
  544.  
  545.         IXCREATE indexfile, mapname.fieldname, mapbuffer
  546.  
  547.   For instance, if you have a database opened for random access reading and
  548.   writing, and you are using a structure named USERS to get and put records
  549.   to the file (USERS is a MAP structure), and you wanted to index on the
  550.   field named "ID", then you could say something like this:
  551.  
  552.         IXCREATE "USERID.IX", USERS.ID, #1
  553.  
  554.   Where "USERID.IX" would be the name of the index file to create, USERS is
  555.   the name of the current structure being used to access the database, ID
  556.   is a field of the USERS structure, and #1 is the file handle of the
  557.   database which is currently open.  For instance, here is a whole program
  558.   which might be used to index an existing file:
  559.  
  560.     MAP USERS AS 100, 10 AS NAME, 10 AS ID /* we don't care about the rest */
  561.     OPEN "R", #1, "USERS.DAT" LEN USERS    /* open the database file */
  562.     IXCREATE "USERID.IX", USERS.ID, #1     /* create an index for ID field */
  563.  
  564.   Then, to use the index, you could do this:
  565.  
  566.     IXOPEN "USERID.IX" AS #2               /* open the index */
  567.     SET R TO IXFIND #2, "ERIK"             /* find a field, return in R */
  568.     GET MAPPED USERS FROM #1, RECORD R     /* get the actual record now */
  569.  
  570.   IXUPDATE - todo - updates a single record to an index
  571.   IXDELETE - todo - deletes a single record from an index
  572.   IXRESORT - todo - re-alphabetizes an index
  573.  
  574.   (the structure of these indexes is simple.  The first four bytes are a
  575.   long integer which contains the length of each field in the index.  The
  576.   rest of the index is a simple random access file of records that length,
  577.   offset from the start by the remainder of the size of the first field
  578.   minus 4, in other words, an indexed field 20 characters wide would be like
  579.   this:
  580.  
  581.         HHHH____________________
  582.         aardvark____________nnnn
  583.         abacus______________nnnn
  584.         acme________________nnnn
  585.  
  586.   where HHHH is a 4-byte number which equals 24 (field length+4 bytes) and
  587.   then there are filler bytes equal to the size of a field.  The second
  588.   field begins with the first index entry followed by a 4 byte record number
  589.   and so on and so forth.  The high performance index, due to it's simplicity,
  590.   can be searched faster than any other index format and allows high speed
  591.   scanning.  The search speed does not degrade, regardless of the size of the
  592.   index.  The only drawback is these indexes are much harder to update.  I have
  593.   figured out some tricks that will make this task much quicker, but I want
  594.   to implement them before I discuss them.  Suffice it to say that if this
  595.   works, I will have little use for Binary Trees in the future.)
  596.  
  597.  
  598.   AUTOEDIT
  599.   ========
  600.   AutoEdit requires the file FEMALES.DAT to be in the current directory.
  601.   Prior to calling AUTOEDIT you must set some variables which contain the
  602.   raw data for AUTOEDIT to act on
  603.  
  604.         SET AUTONAME      TO "SMITH JOHN Q AND MARY J"
  605.         SET AUTOADDRESS   TO "123 ANYWHERE ST"
  606.         SET AUTOCITYSTATE TO "NEW YORK NY"
  607.         SET AUTOZIP       TO "12345"
  608.  
  609.   If these four variables have been defined, then AUTOEDIT will do some
  610.   fancy footwork with them and create some new ones that you can use.  To
  611.   invoke AUTOEDIT, just say
  612.  
  613.         AUTOEDIT
  614.  
  615.   Once this routine has been called, these variables will be created:
  616.  
  617.         NAME     = "John and Mary Smith"
  618.         ADDRESS  = "123 Anywhere St."
  619.         CITYLINE = "New York, NY  12345"
  620.         FORMAL   = "Mr. & Mrs. Smith"
  621.         INFORMAL = "John and Mary"
  622.  
  623.   As you can see, AutoEdit humanizes data, and using some name pattern and
  624.   gender recognition it can produce a wide range of formal and informal
  625.   salutations.  AutoEdit chokes on some foreign names, particularly asian
  626.   ones.  It removes extraneous initials or titles, and can tell whether or
  627.   not two individuals have the same last name, and if one is female, and
  628.   then assumes they are married.  A second name can be joined with the first
  629.   in AUTONAME, like "SMITH JOHN Q AND MARY J", or like
  630.   "SMITH JOHN Q AND JONES MARY J", or a second name or spouse may be
  631.   provided under the variable AUTONAME2.  AutoEdit works best with American
  632.   names and American addresses, and 5 digit zip codes.  Try it!
  633.  
  634.  
  635. FIXES to version 0.92
  636. =====================
  637. + Faster execution of programs
  638. + Corrected block errors on CASE..ELSE..ENDCASE and IF..ELSE..ENDIF
  639. + GOTO/GOSUB in middle of line or block jumps immediately
  640. + Default program extension is .PRO if ANSI enabled
  641. + Default program extension is .TTY if ANSI not enabled
  642. + Added EITHER and NEITHER functions to test multiple expressions:
  643. + Added BOTH function too
  644.  
  645.         IF EITHER SAME A,B SAME C,D ...
  646.         IF BOTH A,B
  647.         IF NEITHER VAL A, VAL B
  648.  
  649. + Added SIZEOF function to return the size of a file
  650.  
  651.  
  652. THE CITIDATA BBS PROGRAM
  653. ========================
  654. I am working on a BBS program which will become quite extensive.  I have
  655. included some of the files for this program in three ZIPs
  656.  
  657.         ROOT.ZIP - contains MAIN program and user database
  658.         PRO.ZIP  - for subdir \PRO\ contains programs
  659.         TYP.ZIP  - for subdir \TYP\ contains screen TYPE files
  660.  
  661. The root files and PROZOL.EXE must be in and run from the root dir of a
  662. drive (or SUBSTed drive) to run correctly.  This BBS is far from complete,
  663. so it may not run too far as is.  I have also not included many other
  664. files it needs, like databases and help screens.  Writing these programs
  665. has been a great finder of bugs.
  666.  
  667.  
  668.  
  669.  
  670. MSP:PROZOL 1.0  from Mermaid Software Products
  671. Freeware by Erik Lee Olson  Copyright (C) 1993  All Rights Reserved
  672.  
  673. Read PROZOL.DOC for instructions on how to configure Prozol.  This document
  674. also describes the Prozol language structure, and includes a complete
  675. keyword reference.
  676.  
  677. PROZOL.EXE - The Prozol interpreter
  678. ANSI.COM   - A generic ANSI driver (ANSI is recommended for developing)
  679. SOURCE.ZIP - contains the PowerBASIC 3.x source code to the interpreter
  680.  
  681. This version of Prozol is freeware, which means that it is copyrighted and
  682. may be freely distributed without modification.  If you intend to use
  683. Prozol commercially and wish to recieve updates and tech support, a $100
  684. registration fee is requested, but not required.  If you invent any new
  685. commands or internal procedures for Prozol (the source code is supplied)
  686. you may be entitled to payment for them from the author.  Prozol is
  687. written in the PowerBASIC language and requires PowerBASIC version 3.00B
  688. or later to compile.  You may obtain PowerBASIC from PowerBASIC Inc., Byron,
  689. California.  Their phone number is (800) 730-7707.
  690.  
  691. Prozol is a programming language designed for creating BBS systems.  Prozol
  692. features:
  693.  
  694.         - A fully featured and structured high level language
  695.         - High performance relational database and indexing
  696.         - dBASE database interface and indexing
  697.         - Support for both standard and non-standard COM ports
  698.         - Desqview optimization
  699.         - Built-in XMODEM file transfer capability
  700.         - A DOOR command for running external doors and protocols
  701.         - Network database support
  702.         - Network global variables (available to all nodes)
  703.         - 6-way network color-coded CHAT
  704.         - Topical conferences with public+private reply options
  705.         - Private user messages
  706.         - Live OLMs (On-Line Messages) between users at any input prompt
  707.         - Random and sequential file read/write/append access
  708.         - Full-screen ANSI data entry to database fields or variables
  709.         - DOS commands
  710.         - Support for interrupt calls
  711.         - Callable subroutines and user defined functions
  712.         - Support for calling the contents of a file as a subroutine
  713.         - Structured IF..ELSE..ENDIF and CASE..ELSE..ENDCASE
  714.         - Multiple statement execution on a single line
  715.         - Statement execution within files being TYPEd to the screen
  716.         - Merge of variables, functions and color codes within output
  717.         - Error handling subroutines
  718.         - Logout handling subroutines
  719.         - ANSI boxes and ANSI scrolling menus
  720.         - Full ANSI screen control with CLS, LOCATE and COLOR
  721.         - Uniform filtering out of all ANSI codes in output
  722.         - Support for TVI 900 series terminals
  723.         - Externally created superfast indexes for readonly databases
  724.         - Calling subroutines within string variables
  725.         - Automatic typing of variables (string or numeric)
  726.         - Numeric output formatting (##.####)
  727.         - GO to any other program at any input prompt
  728.         - Hot-key logout (CTRL-C)
  729.         - Hot-key toggle ANSI emulation on or off (CTRL-D)
  730.         - Hot-key printer on/off, form feed and printscreen on TVI terminals
  731.         - PowerBASIC source code included!
  732.  
  733. To run, just type PROZOL at the DOS prompt.  If you have never run Prozol
  734. before you must create a config file PROZOL.CFG.  If the file is not
  735. present Prozol will ask you a series of questions and then create the
  736. config file.  Once the file has been created you can rebuild it by typing
  737. CONFIG at the prozol command prompt, or by erasing PROZOL.CFG and then
  738. running PROZOL again.
  739.  
  740. This config file contains a number of directory paths required by Prozol,
  741. some information about the modem you will be using, and the Prozol command
  742. prompt.  You must also provide a command for Prozol to execute after the
  743. modem connects.  Usually this command will be a RUN or GO command along
  744. with a startup program to run.  The END command will display a command
  745. prompt.
  746.  
  747.   ========================================================================
  748.   To reset Prozol, just press CTRL-C.  To exit to DOS, type "QUIT" at the
  749.   Prozol prompt.
  750.   ========================================================================
  751.  
  752. If you run PROZOL with a COM port parameter, PROZOL will wait for the phone
  753. modem to recieve an incoming call.  When the call connects, PROZOL will
  754. execute the command in the config file specified to execute on connect.
  755.  
  756. Prozol will work with COM1 through COM4 using standard port and IRQ options.
  757. however if you wish to use PROZOL with a non-standard port (such as a
  758. galacticomm, digiboard, or boca multi-channel serial board) you can
  759. specify the port address and IRQ on the command line.  See PROZOL.DOC
  760. for details.
  761.  
  762. Prozol is optimized for the best possible performance running multiple nodes
  763. under Desqview.  You may also run multiple nodes of Prozol on a network.
  764. Prozol supports full file sharing and multi-user record handling.  Prozol
  765. also features network-global variables which can be set or modified by
  766. any node on the network and seen by any other node.  Other network support
  767. includes a 6-way chat system and OLM (hot messages) which can be sent from
  768. any user to any other user on the system.  If the other user is currently
  769. connected the message will pop up on the addressee's screen, otherwise the
  770. message will be queued and displayed the next time the addressee connects.
  771.  
  772. Prozol has evolved over many years of service as a host BBS system which
  773. is used in very large PC network systems that provide real estate agents
  774. access to property records databases and business listings, as well as
  775. file libraries and legal documents.  Prozol has also been used to run an
  776. extremely off-the-wall BBS at the author's house while it was being developed.
  777.  
  778. In the very near future a self-multitasking version of Prozol will be
  779. available.  Sooner than that, I will be concentrating on improving the
  780. database capabilities and writing a ton of example applications and
  781. subroutines.  There is also a great deal of room for improvement in the
  782. message and conference areas.  More and more areas will also be converted
  783. to assembly language which will greatly improved the speed and performance
  784. of the interpreter.
  785.  
  786. If you have any suggestions or ideas for Prozol, please contact the author
  787. at the locations listed below.  Please report any problems as well.  And
  788. of course, if you have any questions at all, I am
  789.  
  790.         Erik Olson
  791.         PowerBASIC Tech Support
  792.         1350 Birchcrest Blvd
  793.         Port Charlotte, FL  33952
  794.  
  795.         (813) 625-1172
  796.  
  797.         Citidata Corp. of Tampa Bay  (813) 393-7804
  798.         Mermaid Software Products    (813) 398-7443
  799.         Digitek Data Systems         (813) 629-9313
  800.  
  801.   CompuServe: 74141,1644
  802.     InterNet: 74141.1644@compuserve.com
  803.           or  erik.olson@rainnet.com
  804.  
  805. THE BIG FAT HAIRY TO-DO LIST (in order of priority)
  806. ============================
  807. ! Support for timed events (by the minute, hour, or day)
  808.  
  809. ! Perminant variables: Variables that are stored in a common network file
  810.   just like the COMMON variables, but the name of the file can be associated
  811.   with a specific user or user group.  These variables can be used to track
  812.   time and system activity for individuals or groups.
  813.  
  814. ! GO list, to provide aliases and security for allowable GO commands.
  815.  
  816. ! Weighted searches:  database queries based on a hierarchy of values
  817.   which are returned in a sorted list (a tag file) in order of probabilility.
  818.   with the first items being the most likely matches, and the last items
  819.   being the least likely match.  Indexed ranges and minimum "score" values
  820.   can be specified.
  821.  
  822. ! Support for pre-processed program file formats that will run through a
  823.   special version of the EXEC subroutine written entirely in assembler, as
  824.   well as declarable integer and floating point data type variables.  These
  825.   enhancements should speed up program execution by a factor of about 100.
  826.  
  827. ! Time and Date functions.  Julian date calculation, days between dates,
  828.   etc.
  829.  
  830. ! Virtual BBS - a full blown generic BBS that can be executed with a single
  831.   config file.  Standard features.  This would allow multiple BBS systems
  832.   to reside "virtually" within the Prozol system.  The VBBS's would contain
  833.   more advanced file, e-mail, conference, and chat facilities.
  834.  
  835. ! A proprietary modem terminal with support for a complete user interface
  836.   terminal emulation, graphics images, line drawing, mouse, disk access
  837.   and other things not usually possible over a modem.  Among these include
  838.   bridging through another serial port on the host to a secondary system,
  839.   DOS access to the remote system in the background, while the remote
  840.   user runs Prozol programs, and retrieval of general PC system information
  841.   from the user's machine.  Also reading and writing disk files and auto-
  842.   matic disk and print logging, automatic uploading and downloading of
  843.   files.
  844.  
  845. ! Enhanced line editing, more like the GWBASIC line editor for remote
  846.   programming.
  847.  
  848. ! ANSI editor, a full screen ANSI editor which returns the entire edited
  849.   document in a single string variable, which can be written to disk or
  850.   stored as an EMS object.
  851.  
  852. ! A special database format for variable length text and attribute fields,
  853.   such as an electronic mail data structure, which can be supported by
  854.   any of of the available indexing schemes.  Also useful for descriptions
  855.   of downloadable files, or database memos.
  856.  
  857. ! EXTENSION command, specifies the default extension of programs executed
  858.   with RUN, GO and LOAD, allows support for multiple interface configurations.
  859.  
  860. ! SUBScript, a language within the language, to allow external developers
  861.   to create customized virtual systems.
  862.  
  863. ! Interactive IDE - I had an IDE with IOCOM that allowed single step,
  864.   trace, and single statement execution, as well as background execution
  865.   behind the editor.  I merely stripped this out while implementing the
  866.   BozoL engine for compile speed while I am debugging the Prozol language.
  867.   I will put the IDE back in the final version.
  868.  
  869. ! CHAT rooms.  Right now, only one CHAT area exists, allowing up to 6
  870.   simultaneous chatters.  I would like to implement an infinite number of
  871.   CHAT areas which can be associated with conferences or any other
  872.   text symbol.
  873.  
  874. ! Load, Type, and object loading of compressed files, and storage of memory
  875.   variables as compressed data.
  876.  
  877. ! Support for the GTEK PCSS8i intelligent serial card
  878.  
  879. ! Support for OS/2 communications drivers
  880.  
  881. ! Support for the X00 fossil driver for up to 16 concurrent sessions per
  882.   machine using standard serial boards (galacticomm, digiboard, boca, etc)
  883.  
  884. ! Create, copy, and modify the structure of dBASE files
  885.  
  886. ! Database conversion utilities and a code generator.
  887.  
  888. ! EMS "objects" - text that can be stored in EMS memory, screens, subroutines,
  889.   variables, menus, database merge templates, documents, etc.
  890.  
  891. ! Multithreading - Prozol subroutines that can run in the background
  892.   This is actually very easy, since it simply involves making a call
  893.   to a background program execution subroutine between each statement
  894.   and during idle times (like INPUT and DELAY).
  895.  
  896.