Programming in FlashBASIC Using The Update Processor

Programming in FlashBASIC Using The Update Processor


prestored commands Index Level Upgrading R83 to D3, Part 1 of 3
Syntax
Category Article
Type Article
Description short discussion on using the Update processor for programming in FlashBASIC.

Contributed by Terri Hale
(Original article was published in PickWorld)

If you have D3 and you are a programmer, consider using the Update processor (UP) to build your FlashBASIC programs. (Note: The verb "ed" does not exist in my vocabulary anymore.  Why?  Read on.)

UP is a full screen editor, unlike 'ed', which is a line-editor.  This means that you have full text editing capabilities within your FlashBASIC programs.

All of the UP commands for moving the cursor and text are available.  Some of the most commonly used commands in writing programs are listed in the following table:

mark beginning of text to cut        <ctrl>+cd or <ctrl>+cl
mark end of text to cut              <ctrl>+cc
paste cut text                       <ctrl>+cp
read cut text from specified item    <ctrl>+cr
write cut text to specified item     <ctrl>+cw
load prestore buffer                 <ctrl>+zl
read saved prestore command          <ctrl>+zr
write prestore command to a file     <ctrl>+zw
execute prestore command             <ctrl>+p
sentence forward and backward        <ctrl>+f, <ctrl>+d
word forward and backward            <ctrl>+u, <ctrl>+y
character forward & backward         <ctrl>+k, <ctrl>+j
delete character                     <ctrl>+l
go to top of program                 <ctrl>+t
delete word                          <ctrl>+o
delete sentence                      <ctrl>+e
delete program                       <ctrl>+xo
redisplay screen                     <ctrl>+zp
display columnar positions           <ctrl>+zc
undo previous delete (aka: oops!)    <ctrl>+zz
page forward                         <ctrl>+zn
page backward                        <ctrl>+zy
toggle insert / overtype modes       <ctrl>+r  

UP has two modes, insert and overtype. When UP is initially entered, it is in overtype mode.

There is a prestore processor available with D3 which is quite a sophisticated programming language in and of itself. There is no limit to the number of prestore commands available. Prestores can be saved in any file on the system and recalled as needed. (See the article in the March/April 1992 issue of Pickworld  titled 'Advanced Pick Prestore Commands' for more information on prestore commands.)

Level pushing, or the ability to suspend your program and go list a dictionary or look at another program, is a handy tool to use in writing programs in D3. Level pushing is available from anywhere in D3, not just in the Update processor.

There are several ways to exit a FlashBASIC program from UP, as shown i the following table:  

exit without filing                     <ctrl>+xe
exit and file changes                   <ctrl>+xf
exit, file changes, compile & catalog   <ctrl>+xc
exit, file changes, compile & run       <ctrl>+xr
exit, rename the item & file            <ctrl>+xi
exit and go to a new item (program)     <ctrl>+xn
exit out of a list back to TCL          <ctrl>+xk
exit and return to previous item        <ctrl>+xb

Unlike R83, you do not have to file, compile, catalog and run your program with separate editor and TCL commands.  In UP, you can do it all with two keystrokes from within the program itself.  This is a great time-saver.

Subroutines can be called from within a FlashBASIC program either at the time the program is filed or anytime during the update session.  A subroutine can be called by putting "call subroutine.name" in the file-defining item of the FlashBASIC program file on the correlative field (file time processing) or on any of the hotkey fields (for in-line program calls). To call a FlashBASIC subroutine from within a program use <ctrl>+x0-9. A handy use for a subroutine call from a FlashBASIC program file is to record the time, date and user who updated the program.

Programs can be entered in either upper or lower or mixed case.  You never have to hit the caps lock or shift key.

In D3, the TCL verbs "compile" and "basic" behave differently. When you exit a FlashBASIC program using either <ctrl>+r or <ctrl>+c, the compile form is used.

The "compile" verb is case-insensitive. This means that the variable names, TOTAL, total, and Total will all evaluate to the same symbol.  So beware, if you are using the compile verb on programs written in R83 Pick with variable names in both upper and lower case which have different meanings.

On the other hand, "basic" compiles the source code with case sensitivity  in effect. This means that the variable names, TOTAL, total, and Total will evaluate to three different symbols.

There are many features available in the Update processor which make writing, compiling and executing FlashBASIC programs easier, faster and a lot more fun.
Options
See Also
Example
Warnings
Compatibility D3 7.0 AP
prestored commands Index Level Upgrading R83 to D3, Part 1 of 3