home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / rbnotes1.zip / RBASE1.NOT
Text File  |  1986-11-06  |  160KB  |  4,101 lines

  1. SDF   ,
  2.                    NEWS FROM TECH SUPPORT, #1
  3.               -----------------------------------
  4. This is a new feature.  Rather than having you sort thru all the messages to
  5. find the new info, we will post it here first and then put it in the message
  6. section later.  We will be trying to keep you up to date on the latest and
  7. greatest ideas, tips, problems, workarounds, etc. as they happen.
  8.  
  9. IMPORTANT:  We are trying to establish how effective this board is to users.
  10.    Please leave a message with your feelings about it in the General area of
  11.    the message section.  Your input is vital to the maintenance and improvement
  12.    of this board.
  13.  
  14. 1) 2 new books about R:base products:
  15.           -Using R:base 4000
  16.              by J. Erickson and N. Baran
  17.              publisher: Osborne Mcgraw-Hill
  18.           -The Book of R:base
  19.              by G. Roeder
  20.              publisher: All-Hands-On Press
  21. 2) Filegateway:  When transferring data from Lotus, many people have commented
  22.       that sometimes integer data in Lotus comes thru as real data in R:base.
  23.       The reason for this is that Lotus allows 16 bits for storage of an
  24.       integer value, 32000 is the largest integer that can be stored.  Over
  25.       this, the number is stored internally by Lotus as a real value, even
  26.       though it is displayed on the screen as an integer.  Use the following
  27.       guidelines:
  28.             numbers <= 32000 : will be transferred as integer unless there is
  29.                                a decimal point and a number past the decimal.
  30.             numbers > 32000  : will be transferred as real
  31.       Also remember that Filegateway will look at ALL data values in the
  32.       incoming file before assigning the data type, so even if there is only
  33.       one value > 32000, it will be assigned to a real data type.
  34. 3) If you are running on a hard disk, but you have to boot it from a floppy
  35.          disk, it can be annoying when it looks to the floppy drive for
  36.          command.com when you exit a program.  To avoid this, put the
  37.          following command in your config.sys file on the floppy booter,
  38.          and put a copy of command.com on the root directory of your
  39.          hard disk.
  40.              SHELL=C:\COMMAND.COM C:\ /P
  41. 4) If you are doing string concatenation (ie firstnm & lstnm), if the total
  42.          number of characters is the same for two consecutive rows, a character
  43.          from the first row will drop into the space in the second row.  To
  44.          fix this, there are two things you can do:
  45.             1) break on firstnm and reset the concatenated variable.
  46.             2) outside report writer, set a variable "space" to "alt 255"
  47.                (alt 255 is the decimal value of the ascii blank)
  48.                Inside report writer, define the following variables:
  49.                    x1 = firstnm + .space
  50.                    name = x1 + lastnm
  51. 5) Reports - how to print a grand total with no detail.
  52.          Mark your report with report headers and report footers, and locate
  53.          your grand total on one of the footer lines.  It is not possible to
  54.          do this procedure without a break of some kind, so what you can do
  55.          is set a report variable to a constant (ie v1 = 3) and set a break
  56.          level on that variable.  Don't mark any break headers or footers and
  57.          don't reset any variables.
  58. 6) When running an application created in Express, many people have mentioned
  59.          that the rules they had defined were not being displayed on the
  60.          screen.  If the rule was violated, the machine would beep, but no
  61.          error message would be displayed.  This is because Express sets the
  62.          error messages off and messages off, and it thinks of these messages
  63.          as error messages.  All you need to do is insert a custom in Express
  64.          and set the error messages on before loading data, and set them off
  65.          again when you're all finished loading (or editing) data.
  66. 7) Time arithmetic:  the only form of time arithmetic that you can do is
  67.          time - time = integer (# of seconds).
  68. 8) This was not a documented feature in R:base 4000, but if you hit the F2
  69.          key during data entry or editing using forms, it would clear every-
  70.          thing to the right of the cursor.  This is not available in R:base
  71.          5000 because they are using F2 for other functions.
  72. 9) XRW - If you are using DOS 3.1, XRW will not output to the printer. You
  73.          will get an error that says there is an error creating the output
  74.          file.  Workaround:  output to a disk file, and use the DOS print
  75.          command to print the file to the printer.
  76. 10) In command files, you can use variables as the row, column specifiers
  77.          in "at 11,12" statements.  ie "at .line,.clmn".  This is very
  78.          useful for controlling screen positions.
  79. 11) After loading R:base 5000, if you try to open a database and get the
  80.          error "out of file handles" and "unable to open file", it means that
  81.          you did not properly configure your system.  You need to have a
  82.          config.sys file on your root directory or boot disk, and reboot
  83.          your machine afterwards.    (config.sys should say files=20)
  84. 12) If you are trying to convert from R:base 4000 to R:base 5000, and your
  85.          convert program seemed to run very quickly and gave the message
  86.          "conversion complete", but it didn't seem to do anything, it is
  87.          probably because the database was not open.  What has happened
  88.          in many cases is that people do not properly configure their system
  89.          (config.sys -->files=20) and when the program tries to open the
  90.          database, it gives an error -out of file handles- unable to open
  91.          database.  However, messages are set off so you never see it.
  92.          You need to go back and configure your system properly and then
  93.          run the convert program one more time.
  94.  
  95. tech notes 2
  96.                    NOTES FROM TECH SUPPORT, #2
  97.                 ---------------------------------
  98. Notes from Sysop:
  99.       -Instead of converting all these items to messages, I am going to be
  100.        putting each editorial file in Files area, Demos section.  They will
  101.        be numbered, so if you call and find out that you missed one, you
  102.        can download or type out the other editorials.
  103.       -A HUGE thank-you to all of you who are leaving messages supporting this
  104.        BBS!   (pssst - I think it's working!)
  105.       -Just wanted to let you know that we will be undergoing some changes in
  106.        the operating procedures of this BBS from our end in the next few weeks.
  107.        Hopefully you won't notice any changes, but if you do, please bear with
  108.        us until we get our new people and procedures in place.
  109.  
  110. 1)  IBM Enhanced Color Graphics appears to work with R:base 5000.
  111.  
  112. 2)  When to use variable forms instead of table forms:
  113.          - whenever you wish to input data from one form into more than
  114.            one table.
  115.          - when multi-page forms are desired
  116.          - when you want to display some data on a data entry form that
  117.            cannot be edited
  118.          - when "lookups" are desired
  119.            ie - you want the operator to enter the customer number and
  120.             R:base to display the customer's name, address, etc.)
  121.          - when on-screen calculations are needed
  122.          - when you want to load information from the screen into variables
  123.            instead of directly into a table
  124. 3)  How to clear a portion of the screen when using variable forms:
  125.          - A) create a "blank" form.  To do this, you must use the edit mode
  126.            in forms to put an "alt 255" in the upper left and lower right
  127.            corners of the form.  By doing this, the form appears blank even
  128.            though it actually has two characters on it.  (Variable forms must
  129.            have some characters on it, it can't be completely blank).
  130.            You can then draw this form at any particular point on the screen.
  131.            The only limitation is that you can only "draw" five times before
  132.            doing a "newpage".
  133.          - B) Another way to clear a portion of the screen is to use the "write"
  134.            command.
  135.                    write "   (40 blanks)   " at 11,1
  136.                    write "   (40 blanks)   " at 11,40
  137.              and repeat for each line you want cleared
  138.          - C) You can also use the "write" command to write 80 blanks:
  139.                    write " ........(lots of blanks - total of 80).......+
  140.                    ......" at 11,1
  141.          - D) To clear several lines, use the method described in C) within
  142.               a while loop:
  143.                    set var line to 11
  144.                    while line lt 24 then
  145.                      write "   (the 80 blank method described in C)
  146.                            " at .line,1
  147.                      set v line to .line + 1
  148.                    endw
  149.          - E) This method involves more typing, but it appears to be a little
  150.               quicker than method D).  Use the method described in C), but
  151.               repeat each write statement for each line you want cleared:
  152.                    write "  (80 blanks)
  153.                          " at 11,1
  154.                    write "  (80 blanks)
  155.                          " at 12,1
  156.                    write "  (80 blanks)
  157.                          " at 13,1
  158.                    etc., etc.
  159.          - F) The last method appears to be the fastest of all.  It involves
  160.               the use of the "alt 255" special character.  You use one
  161.               "write" statement with as many lines as needed of alt 255's.
  162.                    write "....(use your F4 repeat key to repeat an alt255)....
  163.                    ...........................................................
  164.                    ...........................................................
  165.                    ........do this for how ever many lines you want to clear..
  166.                    .........." at 11,1
  167. 4) To select all rows for a particular month, day, or year, use wildcards.
  168.    The only rule for wildcards with dates is that you must include the
  169.    delimiters:
  170.          ...where tdate = */14/*
  171.          ...where tdate = */*/85
  172.          ...where tdate = jun/*/*
  173.          ...where tdate = "jun 14/*"
  174.          ...where tdate = */*/85
  175.          ...where tdate = */*/1985
  176. 5)  If you are a consultant or VAR and would like to have your name in our
  177.          consultant list, please write a letter to that effect to:
  178.              VAR/Consultant Manager
  179.              Microrim, Inc.
  180.              3380 - 146th PL SE
  181.              Bellevue, WA  98007
  182. 6)  XRW - We have a reported workaround for the problem of not being able to
  183.     DOS  output a report to the printer (you have to output to a file and then
  184.     3.1  use the DOS print command to send it to the printer).  When prompted
  185.          for the output device, type in PRN: instead of PRINTER.
  186. 7)  If you are having "strange" problems with programs hanging during loading
  187.          or in some cases during operation, check to see if you have any
  188.          programs installed in memory.  In almost all cases, if you remove
  189.          these memory-resident programs, the R:base programs (Express, Gateway,
  190.          etc.) will work fine.
  191. 8)  A few notes about the operation of this board.
  192.          - If you try calling and it rings and rings and never answers, it is
  193.            because I am on.
  194.          - If you want to escape out of reading the logon files (new product
  195.            info, etc.) hit ^C.
  196. 9)  Reading the answers to the questionnaire question about making the BBS
  197.          user list available, it appears that you are split just about
  198.          even.  Therefor, to avoid any conflict, it will be voluntary.
  199.          If you leave your name, city, st, phone (optional), and what kind
  200.          of applications you're into, I will put this information in a text
  201.          file and put it in one of the Files areas.  I would encourage you
  202.          to become involved in this because a great deal of valuable infor-
  203.          mation is available from other users working on the same type of
  204.          application as you.
  205. 10) A user has very generously contributed a utility that allows you to run
  206.          R:base 4000 in color.  I am putting it in the DEMOS section of the
  207.          Files area.  We have not done extensive testing on it, but he tells
  208.          me he hasn't had any major problems with it.
  209. 11) There is a new version of LABELS.MAC called NEWLAB.MAC in the Applic
  210.          area of the Files section.  There is also another method for
  211.          doing many-up lables called LAB2.CMD, which uses an altogether
  212.          different approach.
  213.  
  214. tech notes 3
  215. ******************************************
  216. NOTES #3 FROM TECH SUPPORT - JULY 12, 1985
  217. ******************************************
  218.  
  219. We will be putting new issues of this file on every 2 or 3
  220. weeks and will be rotating the authorship among all the TECH
  221. SUPPORT ANALYSTS so you will find a variety of writing
  222. styles.  We will also be publishing much of this info in
  223. the R:base EXCHANGE.
  224.  
  225. Back issues of these notes can be found in the FILES
  226. section.
  227.                 
  228.  
  229.  
  230. **************************
  231. SAVING RESULTS OF COMMANDS
  232. **************************
  233.  
  234. It is often useful to save the results of some R:base
  235. commands in a table of their own.  For example, you might
  236. want to save:
  237.  
  238. o  Subtotals and other calculated information from a report
  239. o  The results of a tally command
  240. o  The results of a directory (to keep a table of your
  241.    files).
  242.  
  243. This can be accomplished by sending output to a file and
  244. then loading the file into a previously defined table.  For
  245. example, to store the results of a TALLY command you would:
  246.  
  247. 1. set mess, err mess, and bell off 
  248. 2. output to a filename
  249. 3. issue your TALLY command line
  250. 4. output terminal
  251. 5. load the file as ascii into your table (defined with 1
  252.  
  253. text column to hold the item and 1 integer column to hold
  254. the number of occurances.
  255. 6. check the first row and if it has garbage in it then
  256. delete it.
  257.  
  258. Similarly, if you have 31 daily backup datafiles to be
  259. loaded into a table, you can do it without having to enter
  260. 31 commands at the keyboard.  Simply copy the 31 files to
  261. your hard disk (making sure that they are the only files
  262. with a .BAK extension in the current directory) and use the
  263. following command file to do all the work overnight:
  264.  
  265. OUT TEMPFILE.DAT
  266. DIR *.BAK
  267. OUT TERMINAL
  268. OPEN dbname
  269. DEFINE
  270. COL
  271. FILENAME TEXT 8
  272. TAB
  273. FILES WITH FILENAME
  274. END
  275. LOAD FILES FROM TEMPFILE.DAT AS ASCII
  276. DEL ROWS FRO FILES WHE LIM = 2
  277. DEL ROWS FRO FILES WHE COU = LAS
  278. SET VAR LIMIT INTEGER
  279. SET VAR COUNTER INTEGER
  280. COM LIMIT AS ROWS FROM FILES
  281. WHILE COUNTER LE .LIMIT THEN
  282.   SET VAR CURFILE TEXT
  283.   SET VAR CURFILE TO FILENAME IN FILES WHE COU = .COUNTER
  284.   SET VAR CURFILE TO .CURFILE + ".BAK"
  285.   LOAD tblname FROM .CURFILE AS ASCII
  286.   SET VAR COUNTER = .COUNTER + 1
  287. ENDWHILE
  288.  
  289. The SET POINTER command was not used because in this case,
  290. where only one access is made to a particular row, SET
  291. POINTER will not save any time.
  292.  
  293.  
  294.  
  295. *************************
  296. BACK UP YOUR APPLICATIONS
  297. *************************
  298.  
  299. As a general rule we recommend that you backup all three of
  300. your application files before going into EXPRESS to change
  301. an application.  Before erasing any of your application
  302. backups be sure to fully test your current version to ensure
  303. that it is completely operational.
  304.  
  305.  
  306.  
  307. *************
  308. EXPRESS QUIRK 
  309. *************
  310.  
  311. If you have a column defined as TEXT with a length of 10 or
  312. more and you are entering only numbers into it, you may have
  313. trouble pulling up your record using only the EDIT option if
  314. you are requesting a value at execution time.  The reason
  315. for this is that the EXPRESS does not currently allow you to
  316. put a TEXT datatype on the FILLIN variable used in the EDIT
  317. command. 
  318.  
  319. To avoid this problem, use RBEDIT on your .APP file to add
  320. the code necessary to TYPE the FILLIN variable.  Remember
  321. that after using RBEDIT you should not go back and attempt
  322. changes with EXPRESS or your changes will be obliterated. 
  323. After making the change, use RCOMPILE to make a new
  324. procedure file (the .APP file is the application file and
  325. the .APX file is the current procedure file - but you can
  326. give it any name you choose).
  327.  
  328. An alternative workaround is to use EXPRESS but do not use
  329. the EDIT pick.  Instead, use the CUSTOM pick and write the
  330. four lines of code yourself.  Your code will be similar to
  331. the following:
  332.  
  333. SET VAR WHVAL TEXT
  334. FILLIN WHVL USING "ENTER THE CODE NUMBER YOU WANT: "
  335. EDIT USING formname WHERE colname EQ .WHVAL
  336. CLEAR WHVAL
  337.  
  338.  
  339.  
  340. *******************************
  341. PROBLEMS WITH PRINTING REPORTS?
  342. *******************************
  343.  
  344. If you have problems when printing your reports it may be
  345. setting for the number of lines per page inside your report. 
  346. Try putting the setting at 58 or 60 lines (using the SET
  347. option in the REPORTS command.  Do not set it to be equal to
  348. the number of lines per page (usually 66) or extra pages may
  349. eject when printing your reports. 
  350.  
  351. In general your setting should be equal to the number of
  352. lines you want to print per page.
  353.  
  354.  
  355.  
  356. ****************************
  357. SUBTOTALING WITH R:BASE 4000
  358. ****************************
  359.  
  360. Subtotaling with R:base 5000 can easily be accomplished by
  361. using the report writer.  Subtotaling in R:base 4000 can be
  362. accomplished using the method described below.
  363.  
  364. Customers often want to add up the balance on each of their
  365. accounts (all the invoices minus all the payments) and store
  366. it in a BALANCE field for each of the accounts.  
  367.  
  368. Here is a method.  This method assumes that you have two
  369. relations - one (INVOICES) with the various invoice charges
  370. and payments in it (i.e., a transaction file) and a second
  371. relation (ACCOUNTS) with all the account numbers in it
  372. (i.e., the master relation).  The ACCOUNTS master relation
  373. has only one record per account with all the information
  374. such as the account number, name, address, phone number,
  375. etc. and has one additional field BALANCE that holds the
  376. current balance for the account.
  377.  
  378. The RUNBALS.CMD below is run every night to put the new
  379. balances into the master ACCOUNTS relation, thus always
  380. keeping the account balance information current. 
  381. Admittedly, this is slow but it does work.  
  382.  
  383. LISTING OF RUNBALS.CMD:
  384. COMPUTE LIMIT1 AS ROWS FROM ACCOUNTS
  385. SET VAR COUNTER1 = 1
  386. WHILE COUNTER1 LE .LIMIT1 THEN
  387.   SET VAR VACCT# TO ACCT# IN ACCOUNTS WHE COUNT = .COUNTER1
  388.   SET VAR COUNTER1 TO .COUNTER1 + 1
  389.   COM LIMIT2 AS COU ACCT# FRO INVOICES WHE ACCT# = .VACCT#
  390.   SET VAR COUNTER2 = 1
  391.   SET VAR BAL TO $0.00
  392.     WHILE COUNTER2 LE .LIMIT2 THEN
  393.       SET VAR INV$ TO INVAMT IN INVOICES WHE +
  394.         ACCT# = .VACCT# AND COUNT = .COUNTER2
  395.       SET VAR PAY$ TO PAYAMT IN INVOICES WHE +
  396.         ACCT# = .VACCT# AND COUNT = .COUNTER2
  397.       SET VAR BAL TO .BAL + .INV$
  398.       SET VAR BAL TO .BAL - .PAY$
  399.       SET VAR COUNTER2 TO .COUNTER2 + 1
  400.     ENDWHILE
  401.   CHA NEWBAL TO .BAL IN ACCOUNTS WHE ACCT# = .VACCT#
  402. ENDWHILE
  403.  
  404. Voila!! there you have it.  It works because WHE COU = n
  405. will find the nth occurance of the item meeting the rest of
  406. the where clause.  This allows you to write one devil of a
  407. subtotaling command file.
  408.  
  409. The only teeny little problem with this method is that
  410. it will not work with keys.  You may, therefore, want to
  411. delete keys at the beginning of the procedure and then
  412. rebuild them again at the bottom. 
  413.  
  414. Also, do not forget that you do not want any NULL values in
  415. the INVAMT and PAYAMT fields, so you might want to use the
  416. CHANGE command before running the RUNBALS.CMD to change all
  417. null fields to zero.
  418.  
  419. tech notes 4
  420. ******************************************
  421. NOTES #4 FROM TECH SUPPORT - JULY 26, 1985
  422. ******************************************
  423.  
  424. This is issue number 4 in our series of bi-weekly technical
  425. tips.  Back issues can be found in the FILES section.
  426.  
  427.  
  428.  
  429. ********************************************
  430. AUTOMATICALLY FILLING IN PORTIONS OF COLUMNS
  431. ********************************************
  432.  
  433. Using variable forms along with the string concatenation
  434. feature of R:base 5000 it is easy to automatically fill in
  435. portions of fields eliminating the need for operators to
  436. enter such things as:
  437.  
  438. o  Dashes in social security numbers.
  439. o  Parentheses and dashes in telephone numbers.
  440. o  Slashes in DATE columns.
  441. o  Colons and seconds on TIME columns when all you have is
  442.    hours and minutes.
  443. o  Commas, decimal points, and/or dollar signs in numbers.
  444.  
  445. All the operator need do is enter the appropriate numbers
  446. directly from the number pad.  This can save alot of data
  447. entry time and improve the productivity of your application.
  448. At the same time the column is displayed on the screen with
  449. all the special characters to aid in reading and verifying
  450. accuracy.
  451.  
  452. This feature is easily implemented using variable forms with
  453. the concatenations taking place before a record is loaded
  454. into the table with the LOAD command.  This way you can also
  455. do all your error trapping before actually adding the record
  456. to the database.
  457.  
  458. Use the following steps to implement this idea.
  459.  
  460. 1.  Using the FORMS command set up your variable form and
  461.     locate a text variable for each portion of the column
  462.     that you want to split into pieces leaving a space
  463.     between the end of one (E) and the beginning of the next
  464.     (S).  Then go into edit mode and put the separation
  465.     character between each of the pieces.
  466.  
  467.     For example, social security numbers have 3 pieces
  468.     separated by dashes.  You could name these variables
  469.     VSSN1, VSSN2, and VSSN3.  Now during data entry the
  470.     operator will be bouncing over the dashes to enter the
  471.     various pieces and will still be able to read the final
  472.     result easily because the dashes will be on the screen.
  473.  
  474. 2.  Before loading the SSN into the data base you would want
  475.     to concatenate the three pieces together by using the
  476.     following commands:
  477.  
  478.     SET VAR VSSN TO .VSSN1 + "-"
  479.     SET VAR VSSN TO .VSSN + .VSSN2
  480.     SET VAR VSSN TO .VSSN + "-"
  481.     SET VAR VSSN TO .VSSN + .VSSN3
  482.  
  483. The variable to use in the LOAD command would be .VSSN.  Any
  484. error trapping tests should be performed prior to loading
  485. VSSN to the database.  Remember that RULES work only with
  486. table forms, not with variable forms.
  487.  
  488. Using this same idea you can automatically insert commas,
  489. dollar signs, and/or decimals in long numeric fields when
  490. they are all going to have the same number of commas (e.g.,
  491. they will all be over 1,000 but under 1,000,000).  Again
  492. this allows the best of both worlds - easy readability along
  493. with fast data entry.
  494.  
  495.  
  496.  
  497. **************************************************
  498. WILDCARDS, THE "NOT CONTAINS" CONSTRUCT, AND RULES
  499. **************************************************
  500.  
  501. In most places, other than RULES, where you want to say DOES
  502. NOT CONTAIN textstring, simply use the following where
  503. clause:
  504.  
  505. ...WHERE colname NE *textstring*...
  506.  
  507. where textstring means any string of characters from 1 to
  508. 1500 long and colname has a TEXT datatype.
  509.  
  510. Using wildcards in RULES can be interesting.  In RULES the
  511. asterisk and the question mark are sometimes taken as
  512. literal characters rather than as wildcards when an operator
  513. other than CONTAINS is used in the condition.  After using
  514. some commands, however, RULES may start using the asterisks
  515. as wildcards.  We are currently researching this but in the
  516. mean time it is best not to use the wildcards in your RULES.
  517.  
  518. The one exception is when you want to check for the
  519. existance of certain valid characters in certain positions
  520. in a column.  This can easily be done with RULES.  In order
  521. to do this you need to adhere to the following requirements:
  522.  
  523. o  The column you are checking must be TEXT.
  524. o  The operator used in the condition must be CONTAINS.
  525. o  To check certain postions, use the question mark.
  526.  
  527. For example, the following rule checks for dashes in the
  528. correct position in social security numbers (SS#):
  529.  
  530. "Invalid SS number" SS CON ???-??-????
  531.  
  532. This next rule checks for an X in position 2.
  533.  
  534. "Invalid product code" PRODID CON ?X*
  535.  
  536. We have had several other interesting experiences with
  537. wildcards in R:base 5000 version 1.0 that we want to share
  538. with you.  Because of the global nature of wildcards it
  539. would be a good idea not to use literal asterisks and/or
  540. question marks in your data.  You could get into trouble
  541. later with commands like the following:
  542.  
  543. 1.  DEL ROWS FROM tblname WHE colname CONTAINS *
  544. 2.  DEL ROWS FROM tblname WHE colname CONTAINS "*"
  545.  
  546.  
  547. The first command above will not delete rows even if the
  548. colname does contain an asterisk.  Likewise the SELECT
  549. command using the WHERE clause in 1, will not find rows even
  550. if they do contain an asterisk.  However, the CHANGE command
  551. will change those rows that contain the literal asterisk
  552. when using the WHERE clause in number 1.
  553.  
  554. The second command will delete ALL the rows that have a
  555. value other than NULL.  Be careful with this one.  Using the
  556. where clause in number 2 with the select command results in
  557. only those rows containing the literal asterisk being listed
  558. but using it with the CHANGE command results in all non-NULL
  559. fields being changed. The bottom line:
  560.  
  561. o  It is easy to construct a NOT CONTAINS condition using
  562.    the R:base 5000 wildcards.
  563. o  It is a good idea not to use the asterisk (*) and/or
  564.    question mark (?) in your data.
  565. o  Be very careful when using wildcards in global data
  566.    changing commands like DELETE, CHANGE, and ASSIGN. You
  567.    may get unexpected results.
  568.  
  569.  
  570.  
  571. *******************
  572. AUTOMATIC NUMBERING
  573. *******************
  574.  
  575. With R:base 5000 it is very easy to automatically number
  576. certain columns such as CUST# with sequential numbers.
  577.  
  578. Use variable forms to set up the data entry screen.  This
  579. way you can have the customer number calculated and put into
  580. the VCUST# variable before even showing the form to the
  581. operator to enter the other information for that particular
  582. customer.  In the command file you can calculate the number
  583. to start a given data entry session with the following two
  584. commands:
  585.  
  586. COMPUTE VCUST# AS MAX CUST# FROM tblname
  587. SET VAR VCUST# TO VCUST# + 1
  588.  
  589. From then on all you need do is include the
  590.  
  591. SET VAR VCUST# TO VCUST# + 1
  592.  
  593. command in your WHILE loop right before you DRAW the variable form for the next
  594.  
  595. Note that I have put a V in front of the colname to indicate
  596. that it is a variable that will be loaded into that
  597. particular colname.  Although this is not required; it is a
  598. big help later when you are trying to remember just what is
  599. a variable and what is a colname and which variables go into
  600. which columns.  I even go so far as to try to make all my
  601. colnames 7 characters or less so that if I ever want to use
  602. a corresponding varname it is easy to simply insert a V as
  603. the first character.  You may find this to be a useful
  604. "R:base 5000 programming/documentation standard" it will
  605. make maintenence of your application and training of new
  606. personnel much easier later on.
  607.  
  608.  
  609.  
  610. *********************************
  611. USING ALT 177 IN YOUR APPLICATION
  612. *********************************
  613.  
  614. Application developers have requested the ability to "shade
  615. in" the areas of the screen where operators are supposed to
  616. enter values so that they will know where to put the data.
  617. You can do this easily by using the ALT 177.  To enter this
  618. character, hold the ALT key down and enter 177 on your
  619. number pad (do not use the numbers on top of the letters).
  620.  
  621. The ALT 177 produces a shaded area on your screen the size
  622. of the cursor.  It can be used to indicate the number of
  623. spaces to enter:
  624.  
  625. o  In response to a FILLIN command prompt
  626. o  In a variable form
  627. o  In a table form
  628.  
  629. ALT 177s can be used as defaults in both kinds of forms to
  630. show the operators where to enter data.  You should use it
  631. only when all the characters must be entered so that
  632. operators do not have to "blank over" the ALT 177s before
  633. going on to the next column or entry.  To use them as
  634. defaults the easiest method is to create your form using the
  635. FORMS command, locate your variables or colnames, and then
  636. go back into the (E)DIT mode in FORMS and put ALT 177s in
  637. covering the S, the E, and all the spaces between them.
  638.  
  639. ALT 177s work as text characters and can actually be entered
  640. into the database.  However if your variable (in the case of
  641. variable forms) or your column (in the case of table forms)
  642. is defined as INTEGER, REAL, DOLLAR, TIME, or DATE, the
  643. entire area must be filled in or blanked over to remove all
  644. the ALT 177s or you will get an error message.  This is a
  645. good way to ensure that a required field is entered when you
  646. do not want to have to use a RULE.
  647.  
  648. To make sure that all character positions in a TEXT field
  649. are entered, you might think you could add a rule to trap an
  650. entry containing an ALT 177 in RULES by using the wildcards
  651. to create a "does not contain" condition.  However, this
  652. does not work because RULES usually searches for the literal
  653. * and ? rather than using them as wildcards.
  654.  
  655. The answer is to use variable forms for data entry.  You are
  656. then able to make sure that all characters have been entered
  657. by using a section of "error trapping" code similar to the
  658. following (bear in mind that ALT 177s will not come over the
  659. modem - they look like "1"s):
  660.  
  661. .
  662. .
  663. .
  664. WHILE varname EQ "*▒*" OR varname EQ "* *" THEN
  665. WRITE "ERROR - You must fillin the entire code"
  666. NEW
  667. DRAW varformname WITH ALL
  668. EDIT VAR varname USI varformname RETURN keylist
  669. ENDWHILE
  670. .
  671. .
  672. .
  673.  
  674. This code will trap the operator in a loop until there are
  675. no longer any ALT 177s (or blanks) in the response.  This
  676. particular code should not be used if you want embedded
  677. blanks because it does not allow it.  If imbedded blanks
  678. were allowed the operator could simply blank over the ALT
  679. 177s and get out of the loop.
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687. ************
  688. JUST FO
  689.  FUN
  690. ************
  691.  
  692. Because customers are always asking us how their database
  693. could have been destroyed we put together the following song
  694. lyrics.  Sing it to the tune of 50 WAYS TO LEAVE YOUR LOVER.
  695.  
  696. We know that a destroyed database is no laughing matter, but
  697. we think that a little humor is a great tension reliever and
  698. maybe will even help in preventing future damage by
  699. encouraging you to keep several recent backups.
  700.  
  701. So here it is .....
  702.  
  703. 50 WAYS TO TRASH YOUR DATA
  704. by John Pfeifer with chorus by Microrim Tech Support
  705.  
  706. The problem is all inside your drives, they said to me
  707. The answer is easy if you buy new ones from me
  708. I'd like to help you, but there's the matter of my fee
  709. there must be 50 ways to trash your data
  710.  
  711. Just treat it like a toy, Roy
  712. Spill your coffee or your tea, Lee
  713. Bump the keyboard on a pack, Jack
  714. Control C for a thrill, Jill
  715. Flip the main power switch, Mitch
  716. Swap your disks and retry, Guy
  717. Power surge on the line, Tyne?
  718. Reload the same name, Mame
  719. Copy only file two, Lou
  720. Static charge cause some pain, Jane?
  721. I think ya got the idea, Lia
  722.  
  723. There must be 50 ways to trash your data
  724.  
  725. He said it's really not my style to be so rude
  726. But I hope you realize that your setup is REAL crude
  727. Upgrade your processor and change that attitude
  728. There must be 50 ways to trash your data.
  729.  
  730. Turn off the machine, Jean
  731. Format it all, Paul
  732. Error in your LOC.DAT, Matt
  733. An electrical storm, Norm
  734. Look at all that dust, Gus
  735. Backup bad over good, Wood
  736. Did you have a head crash, Nash?
  737. Wash your disks in the sink, Link
  738. Fry your data in the heat, Pete?
  739. Watch that parity err, Jere
  740. I think ya got the idea, Lia
  741.  
  742. There must be 50 ways to trash your data
  743.  
  744. We hope you don't get caught without a backup!
  745.  
  746.  
  747.  
  748. ********************
  749. HOW TO CALCULATE AGE
  750. ********************
  751.  
  752. Calculating the age of a person or item is easy with R:base
  753. 5000, simply issue the following three commands:
  754.  
  755. SET V VBRTHDAY TO BRTHDAY IN tblname WHERE ...
  756. SET V VDAYS TO .#DATE - .VBRTHDAY
  757. SET V VAGE TO .VDAYS / 365.25
  758. tech notes 5
  759. ********************************************
  760. NOTES #5 FROM TECH SUPPORT - AUGUST 16, 1985
  761. ********************************************
  762.  
  763. New issues of these tech notes are published here every 2 to
  764. 3 weeks and much of the information will also be published
  765. in the R:base EXCHANGE.  Back issues can be found in the
  766. FILES section.
  767.  
  768.  
  769.  
  770.  
  771. ****************************************************
  772. HOW TO MASK OUT THE .00 OF A DOLLAR FIELD IN REPORTS
  773. ****************************************************
  774. By Kay D. Dayss and MariEsther Burnham
  775.  
  776. Using the following trick shot it is possible to mask out
  777. the cents portion (the .00) of a dollar field in the R:base
  778. report writer.  This is especially useful on large dollar
  779. amounts when you don't care about the pennies.
  780.  
  781. STEP 1.  Go into REPORTS and call up your report.  In
  782.          (D)efine mode create a "blank" variable using the
  783.          following expression:  
  784.  
  785.          BLANK = "   " 
  786.  
  787.          Put 3 blanks inside the quote marks.
  788.  
  789. STEP 2.  Go into (L)ocate mode and locate the BLANK variable
  790.          somewhere near the dollar column that you want to
  791.          blank out the decimal point and cents on.
  792.  
  793. STEP 3.  Leave REPORTS saving your changes.  Issue the
  794.          following command:
  795.  
  796.          EDIT ALL FROM REPORTS WHERE RNAME = reptname
  797.  
  798.          Use the down arrow key to get to the LAYOUT
  799.          section.  You will know you are there when you see
  800.          the word LAYOUT in the RDATA column.  
  801.  
  802.          The next rows will have information similar to the
  803.          following in the RDATA column for each of the
  804.          located columns and variables:
  805.  
  806.          col/varname    row#  col#  length  ...
  807.  
  808.          First, find the row containing the colname for the
  809.          DOLLAR column and note the row#.  Next, subtract 3
  810.          from the length and add the result to the col#.
  811.          Note the result.
  812.  
  813.          Now find the row containing the BLANK variable (it
  814.          should be nearby).  Change its row# to the one
  815.          noted above and change its col# to be equal to the
  816.          result of the calculation you did above.
  817.  
  818. The BLANK variable will now print over the the last 3 places
  819. on the dollar column location.  
  820.  
  821. This procedure will only work if you locate the BLANK
  822. variable after you locate the DOLLAR column.
  823.  
  824.  
  825.  
  826.  
  827. *************************************************
  828. LINING UP THE DECIMAL POINTS IN YOUR REAL NUMBERS
  829. *************************************************
  830. By Kay D. Dayss
  831.  
  832. It is possible, using the trick shot below, to line up the
  833. decimal points of REAL numbers in your reports.
  834.  
  835. Keep in mind that without using scientific notation REAL
  836. numbers can use up to 7 total print positions (a maximum of
  837. 6 number positions plus the decimal point).  Up to 5 numbers
  838. are possible to the right of the decimal point (when there
  839. is only 1 on the left) and up to 6 numbers to the left of
  840. the decimal point (when there are none to the right).  When
  841. there are no numbers to the left of the decimal point a zero
  842. is printed and you are still only able to have 5 numbers to
  843. the right.
  844.  
  845. Any numbers larger or smaller than the limits discussed
  846. above will cause the REAL number to be represented in 
  847. scientific notation and this trick shot will not work on 
  848. them.
  849.  
  850. Therefore the trick to getting all the decimal points to
  851. line up is to use a TEXT variable of length 12.  Basically,
  852. you will need to move the numbers into the TEXT variable in
  853. the right place putting the decimal point in position 7. 
  854. Then using the change command place the TEXT variable into a
  855. special TEXT column you have set up in your table to hold
  856. the now alligned value.  You would then print the TEXT
  857. column in your report.  
  858.  
  859. In this example the REAL column is REAL# and the TEXT column
  860. to be printed is PRINT# with a length of 12.  
  861.  
  862. SET VAR BLANK5 = "     " *(5 blanks inside the quotes)
  863. SET VAR BLANK4 = "    "  *(4 blanks inside the quotes)
  864. SET VAR BLANK3 = "   "   *(3 blanks inside the quotes)
  865. SET VAR BLANK2 = "  "    *(2 blanks inside the quotes)
  866. SET VAR BLANK1 = " "     *(1 blank inside the quotes)
  867. SET POINTER #3 VERR FOR tblname WHERE REAL# EXISTS
  868. WHILE VERR EQ 0 THEN
  869.   SET VAR VREAL# TO REAL# IN #3
  870.   SET VAR VREAL# TEXT
  871.   IF VREAL# CON ?.????? THEN
  872.     SET VAR VREAL# TO .BLANK5 + .VREAL#
  873.     GOTO DONE
  874.   ENDIF
  875.   IF VREAL# CON ??.???? THEN
  876.     SET VAR VREAL# TO .BLANK4 + .VREAL#
  877.     GOTO DONE
  878.   ENDIF
  879.   IF VREAL# CON ???.??? THEN
  880.     SET VAR VREAL# TO .BLANK3 + .VREAL#
  881.     GOTO DONE
  882.   ENDIF
  883.   IF VREAL# CON ????.?? THEN
  884.     SET VAR VREAL# TO .BLANK2 + .VREAL#
  885.     GOTO DONE
  886.   ENDIF
  887.   IF VREAL# CON ?????.? THEN
  888.     SET VAR VREAL# TO .BLANK1 + .VREAL#
  889.   ENDIF
  890.   LABEL DONE
  891.   CHANGE PRINT# TO .VREAL# IN #3
  892.   CLEAR VREAL#
  893.   NEXT #3 VERR
  894. ENDWHILE
  895.  
  896.  
  897.  
  898.  
  899. *****************
  900. XRW REPORT SAMPLE
  901. *****************
  902. by MariEsther Burnham
  903.  
  904. This is a sample of how to write an XRW program for the 
  905. following  situation:
  906.  
  907. There is a Master file (PATIENTS) and a Transaction file 
  908. (VISITS).  Each patient may have made 0-n visits. The 
  909. desired report is a listing  of visits by patients, where 
  910. patients who have not made any visits are not listed and the 
  911. patient name is only printed once.
  912.  
  913. The concepts presented in this example can be applied in any
  914. situation where you have a master record with 0-n 
  915. transaction records associated with it.  For example:
  916.  
  917.      o  customers and their invoices
  918.      o  parts and their cost history
  919.      o  finished goods and their parts lists
  920.      o  invoices and their cash receipts
  921.  
  922. This sample report also allows sorting by patient name.
  923.  
  924. REPORT RVISIT FOR DRDB
  925.  
  926. VARIABLES
  927.   FLAG INTEGER
  928. END
  929.  
  930. FOR EACH ROW IN PATIENTS SORTED BY LASTNAME
  931.   FLAG = 0            {Initialize the flag variable}
  932.   FOR EACH ROW IN VISITS SORTED BY TDATE WHERE PID = PID IN PATIENTS
  933.     IF FLAG = 0 THEN  {This is the first time through this loop}
  934.       FLAG = 1    
  935.       PRINT           {print patient info}
  936.       2  10 "Patient name: " STRIP ( FRSTNAME ) " " STRIP ( LASTNAME )
  937.       END {print}
  938.     END {if}
  939.     PRINT             {print visit info}
  940.     1 20 "Visit date: " TDATE
  941.     2 20 DESCRPT
  942.     END {print}
  943.   END {for each .. visits}
  944. END {for each .. patients}
  945.  
  946. tech notes 6
  947. ********************************************
  948. NOTES #6 FROM TECH SUPPORT - AUGUST 30, 1985
  949. ********************************************
  950.  
  951. New issues of these tech notes are published here every 2 to
  952. 3 weeks and much of the information will also be published
  953. in the R:base EXCHANGE.  Back issues can be found in the
  954. FILES section.
  955.  
  956. Note that a small change was made to the NOTES #5 editorial 
  957. article.  You may want to download the new version which can 
  958. be found in the FILES section and is titled EDTORIAL.5.  All 
  959. that was done was to change all references to ALT 255s to 
  960. actual blanks to prevent printer problems later on.
  961.  
  962.  
  963.  
  964.  
  965. ********************************
  966. MOVING STRINGS TO NULL VARIABLES 
  967. ********************************
  968. by Mario Valverde
  969.  
  970. PROBLEM:
  971.  
  972. RE: R:base 5000 version 1.0 (fixed in version 1.01)
  973.  
  974. When moving variable substrings to a variable which was previously null,
  975. if the value being moved is less than four characters in length, then, the res-
  976. ult of the move will produce a variable with a length of four.  That is, the
  977. value being moved will be padded with trailing blanks.
  978.  
  979. SOLUTION:
  980.  
  981. Make sure that the receiving varaible is never null at the time it receives
  982. the character string.  That is, make sure that the variable has been initial-
  983. ized to at least a single character value prior to receiving the new character 
  984. string.
  985.  
  986. EXAMPLE:
  987.  
  988. SET VAR V1 TEXT
  989. SET VAR V2 TEXT
  990. SET VAR V1 TO "ZZZZZZZZZZZZZ"
  991. SET VAR V2 TO "Y"
  992. MOVE 2 FROM V1 TO V2 AT 1
  993.  
  994.  
  995. The example above will produce a V1 variable value with a length of two.
  996. If the variable V2 had not been set to an initial value (i.e., was null), then,
  997. the resulting value of V2 would have been four characters in length.  That is,
  998. it would have been ZZ__ where _ represents a trailing blank.
  999.  
  1000.  
  1001.  
  1002.  
  1003. **********************************
  1004. DEBUGGING YOUR EXPRESS APPLICATION
  1005. **********************************
  1006. by Kay D. Dayss
  1007.  
  1008. Application EXPRESS automatically turns messages, error 
  1009. messages, and echo off.  This makes it hard to debug your 
  1010. application but you will want them off when demonstrating to 
  1011. your customer.
  1012.  
  1013. An easy solution is to add a temporary menu pick on your 
  1014. main menu, choose CUSTOM as the action, and enter the 
  1015. following three commands:
  1016.  
  1017. SET MESS ON
  1018. SET ERR MESS ON
  1019. SET ECHO ON
  1020.  
  1021. Then when you want to debug your application all you have to 
  1022. do is first pick your debug menu choice before going to any 
  1023. of your other choices.
  1024.  
  1025. You may also set up another temporary pick to turn debugging 
  1026. off.
  1027.  
  1028. After the application is fully developed you can delete  
  1029. these picks from your main menu and your application is 
  1030. ready to be used.
  1031.  
  1032.  
  1033.  
  1034. ***********
  1035. QUICKY TIPS
  1036. ***********
  1037. by Kay D. Dayss
  1038.  
  1039.  
  1040.  
  1041. PROBLEM:  When unloading reports and/or forms into files, 
  1042.           editing the files, and then trying to bring them 
  1043.           back into the REPORTS and/or FORMS tables 
  1044.           sometimes gives an error message indicating that 
  1045.           excess data values will be ignored.
  1046.  
  1047.           The problem is that somewhere in your report or 
  1048.           form, you have put quotes in (probably when you 
  1049.           were in EDIT mode of FORMS or REPORTS).  R:base  
  1050.           then trys to make another field out of those 
  1051.           quoted items.
  1052.  
  1053.  
  1054. SOLUTION: Set QUOTES to an unused character such as # before 
  1055.           doing the unload and then after loading the FORM 
  1056.           or REPORT back in set QUOTES back to the " 
  1057.           character.
  1058.  
  1059. ============================================================
  1060.  
  1061. PROBLEM:  A customer reported that a 60K file compiled into 
  1062.           a 1000K file.
  1063.  
  1064. SOLUTION: Before recompiling with RCOMPILE, erase the 
  1065.           original compiled file so that a brand new 
  1066.           compiled file is created.
  1067.  
  1068. ============================================================ 
  1069.  
  1070. PROBLEM:  Using the GT, GE, LT, LE operators in WHERE clause 
  1071.           in combination with TEXT columns and the ASTERISK 
  1072.           as a wildcard does NOT work.  It gives you an 
  1073.           error message:
  1074.  
  1075.           -WARNING- No rows satisfy the WHERE clause
  1076.  
  1077.           even though rows do satisfy it.
  1078.  
  1079. SOLUTION: Use only the EQ or NE operators in combination 
  1080.           with WHERE clauses and the ASTERISK.
  1081.  
  1082. EXAMPLE:  SEL ZIP FRO tblname WHE ZIP GE 11100 AND ZIP LE 55599  - will work
  1083.           SEL ZIP FRO tblname WHE ZIP GE 111*  AND ZIP LE 555*   - won't work
  1084.  
  1085. ============================================================
  1086.  
  1087. PROBLEM:  When printing a report everything bunches over to 
  1088.           the left.
  1089.  
  1090. SOLUTION: You may have ALT 255s in your TEXT columns - get 
  1091.           them out by using the CHANGE command and 
  1092.           everything will be AOK.  The ALT 255 looks like a 
  1093.           blank but when sent to some printers that support 
  1094.           ascii codes only to 127 (such as the OKIDATA 2410 
  1095.           PACEMARK) it can cause some strange things to 
  1096.           happen.  Sometimes it sends a bunch of carriage 
  1097.           returns and sometimes it prevents the printhead  
  1098.           from advancing to the next position or tab stop.
  1099.  
  1100.           Remember to check any variables you are printing 
  1101.           for the ALT 255 also.  And remember that when you 
  1102.           print a program you have written that has ALT 255s 
  1103.           in it, you will find the same problem.
  1104.  
  1105.           Some printers, use ASCII codes up to and even 
  1106.           beyond the ALT 255 and on these printers you will 
  1107.           not experience any problems.
  1108.  
  1109. EXAMPLE:  CHANGE NAME TO -0- WHERE NAME CON "* *" 
  1110.           *(NOTE: THERE IS AN ALT 255 INSIDE THE QUOTES AND 
  1111.           BETWEEN THE ASTERISKS - TO ENTER IT HOLD THE ALT 
  1112.           KEY DOWN, ENTER 255 ON THE NUMBER PAD, AND THEN 
  1113.           RELEASE THE ALT KEY) 
  1114.  
  1115. ============================================================
  1116.  
  1117. **********************
  1118. ERROR CODE DEFINITIONS
  1119. **********************
  1120.  
  1121. The following list contains the meanings of all the error 
  1122. code values that your error variables can take on:
  1123.  
  1124.  CODE       MSG                                                                
  1125.  ---------- ------------------------------------------------------------------ 
  1126.           0 NO ERRORS
  1127.           7 UNABLE TO OPEN DATABASE
  1128.           8 MISSING DATABASE NAME
  1129.           9 ILLEGAL DATABASE NAME
  1130.          10 UNABLE TO CLOSE DATABASE
  1131.          12 -WARNING- UNRECOGNIZED SET KEYWORD
  1132.          13 ERRORS IN VARIABLES. CORRECT WITH REPORT COMMAND.
  1133.          14 MORE THAN 1600 BYTES OF DATA FROM INPUT
  1134.          15 ERROR IN WRITING
  1135.          19 ERROR IN CLOSING
  1136.          22 ILLEGAL BOOLEAN OPERATOR BETWEEN VARIABLE AND VALUE
  1137.          26 SWITCHING INPUT BACK TO KEYBOARD
  1138.          29 THE HELP TEXT FILE IS NOT AVAILABLE
  1139.          30 THERE IS NO HELP TEXT FOR THE <COMMANDNAME>
  1140.          31 UNABLE TO OPEN FILE
  1141.          32 ILLEGAL FILE NAME
  1142.          33 INPUT FILE NOT FOUND
  1143.          39 SYNTAX IS INCORRECT FOR THE COMMAND
  1144.          40 UNRECOGNIZED COMMAND - RETYPE IT
  1145.          41 -WARNING- UNAUTHORIZED ACCESS TO THE TABLE
  1146.          42 ILLEGAL TABLE NAME
  1147.          43 <TBLNAME> IS AN UNDEFINED TABLE
  1148.          44 I/O PROBLEMS - CHECK FOR FULL DISK
  1149.          47 ILLEGAL COLUMN NAME
  1150.          48 TOO MANY TABLES DEFINED - LIMIT IS 40
  1151.          49 NEW TABLE IS WIDER THAN 1530 BYTES
  1152.          50 TOO MANY COLUMNS IN THE DATABASE - LIMIT IS 400
  1153.          51 MORE THAN 10 SORTED COLUMNS
  1154.          52 NEW TABLE HAS TOO MANY COLUMNS
  1155.          55 NEW TABLE NAME IS A DUPLICATE
  1156.          56 -WARNING- NO ROWS SATISFY THE WHERE CLAUSE
  1157.          57 RESERVED WORDS CANNOT BE USED FOR NAMES
  1158.          62 -WARNING- AN OWNER PASSWORD SHOULD BE DEFINED WHEN USING
  1159.             PASSWORDS
  1160.          63 -WARNING- THIS PASSWORD DOESN'T ALLOW YOU TO VIEW ANY TABLE
  1161.          65 I/O ERROR ON OUTPUT FILE - CHECK FOR FULL DISK
  1162.          67 INTERNAL ERROR IN LOC.DAT
  1163.          70 ILLEGAL BOOLEAN OPERATOR BETWEEN COLUMN NAME AND VALUE
  1164.          75 ILLEGAL LIMIT SPECIFICATION
  1165.          82 THE PROMPT FILE IS NOT AVAILABLE
  1166.          83 THERE IS NO PROMPT TEXT FOR THE COMMAND
  1167.          85 YOUR ERROR VARIABLE MUST BE OF TYPE INTEGER
  1168.          89 -WARNING- VALUE TRANCATED TO 40 CHARACTERS
  1169.          89 -WARNING- VALUE TRUNCATED TO 40 CHARACTERS
  1170.          90 TABLE NOT DEFINED
  1171.          91 RULE COMPONENTS MUST APPLY TO THE SAME TABLE
  1172.          92 UNRECOGNIZED BOOLEAN EXPRESSION
  1173.          93 NO DATABASE OPEN
  1174.          94 <COLNAME> IS AN UNDEFINED COLUMN NAME
  1175.          95 COLUMNS MUST BE THE SAME TYPE AND LENGTH
  1176.          96 VALUE INCOMPATIBLE WITH COLUMN
  1177.          97 RULES MUST BE JOINED WITH AND or OR
  1178.          98 TABLE MUST BE SPECIFIED
  1179.         101 INSUFFICIENT SPACE TO PROCESS RULES
  1180.         102 INCOMPATIBLE RULES TABLE ALREADY EXISTS
  1181.         103 TOO MANY TABLES TO DEFINE RULES
  1182.         104 TOO MANY COLUMNS TO DEFINE RULES
  1183.         116 YOU MUST BE THE OWNER TO CHANGE RULE CHECKING
  1184.         118 INCORRECT NUMBER OF VALUES FOR THIS TABLE
  1185.         125 -WARNING- EXCESS DATA VALUES IGNORED
  1186.         126 MISSING TABLE NAME
  1187.         127 CANNOT LOAD WITH PROMPTS AND AN AS CLAUSE
  1188.         128 CANNOT LOAD WITH PROMPTS AND FROM A FILE
  1189.         129 NO FILE SPECIFICATION
  1190.         131 INCORRECTLY SPECIFIED (ROW,COL)
  1191.         132 UNIDENTIFIED AS CLAUSE
  1192.         133 YOUR USER AND OWNER PASSWORD MUST MATCH
  1193.         137 -WARNING- NO ROWS SATISFY THE WHERE CLAUSE
  1194.         138 <RPTNAME> IS AN UNDEFINED REPORT
  1195.         139 ALL VALUES IN QUALIFYING ROWS ARE MISSING
  1196.         149 FUNCTION MUST BE COUNT, MIN, MAX, SUM, AVE, ROWS, OR ALL
  1197.         150 SUM AND AVE ONLY WORK WITH INTEGER, REAL, AND DOLLAR COLUMNS
  1198.         153 COLUMN IS TOO LONG FOR TALLY
  1199.         154 TOO MANY VALUES FOR TALLY
  1200.         166 -WARNING- NO TABLES ARE DEFINED
  1201.         177 -WARNING- NO COLUMNS ARE DEFINED
  1202.         181 COLUMNS MUST BE DEFINED BEFORE TABLES
  1203.         185 ILLEGAL OWNER PASSWORD
  1204.         186 YOU MUST ENTER THE CORRECT OWNER PASSWORD
  1205.         193 EXISTING COLUMN NAMES CANNOT BE REDEFINED
  1206.         194 ALLOWABLE COLUMN TYPES ARE TEXT, INTEGER, REAL, DATE, TIME, AND
  1207.             DOLLAR
  1208.         196 COLUMN LENGTH MUST BE BETWEEN 1 AND 1500
  1209.         197 YOU CANNOT SPECIFY A LENGTH FOR DATE, TIME, OR DOLLAR
  1210.         198 ILLEGAL PASSWORD NAME
  1211.         205 -WARNING- UNRECOGNIZED SET KEYWORD
  1212.         206 ILLEGAL DATE FORMAT SPECIFICATION
  1213.         207 SCREEN WIDTH MUST BE GREATER THAN 40 AND LESS THAN 256
  1214.         209 VARIABLE LIMIT HAS BEEN REACHED
  1215.         213 -WARNING- NO VARIABLES DEFINED
  1216.         214 YOU MUST BE THE OWNER TO CHANGE RULES CHECKING
  1217.         217 TOO MANY NESTER WHILE COMMANDS
  1218.         218 TOO MANY COMMANDS IN A WHILE LOOP
  1219.         219 RBEDIT CANNOT MAKE THIS FILE ANY BIGGER
  1220.         220 DISK I/O ERROR IN PACK COMMAND
  1221.         247 A WHERE CLAUSE IS REQUIRED
  1222.         250 ASSIGN COMMAND REQUIRES INTEGER, REAL, OR DOLLAR COLUMN
  1223.         251 CANNOT ASSIGN VECTOR COLUMN
  1224.         252 EXPRESSION CANNOT BE EVALUATED
  1225.         253 OPERATOR MUST BE + - X / OR %
  1226.         267 OWNER PASSWORD IS INCORRECT
  1227.         275 NEW NAME IS A DUPLICATE
  1228.         276 ILLEGAL PASSWORD NAME
  1229.         301 INCORRECTLY SPECIFIED (ROW,COL)
  1230.         302 UNIDENTIFIED AS CLAUSE
  1231.         303 YOUR USER AND OWNER PASSWORDS MUST MATCH
  1232.         310 JOINING COLUMNS DIFFER IN TYPE OR LENGTH
  1233.         316 UNABLE TO OPEN RELOAD FILE
  1234.         317 MISSING DATABASE NAME
  1235.         318 ILLEGAL DATABASE NAME
  1236.         319 WRITE ERROR ON RELOAD FILE - CHECK FOR A FULL DISK
  1237.         325 NO DATABASE OPEN
  1238.         326 VARIABLES MUST BE 8 CHARACTERS OR LESS
  1239.         336 SOME EXPRESSIONS CANNOT BE EVALUATED
  1240.         344 INCOMPATIBLE REPORTS TABLE ALREADY EXISTS
  1241.         345 TOO MANY TABLES TO DEFINE REPORTS
  1242.         346 TOO MANY COLUMNS TO DEFINE REPORTS
  1243.         349 -ERROR- NO COLUMN NAMES OR VARIABLES HAVE BEEN LOCATED
  1244.         350 CANOT RECOGNIZE VARIABLE NAME
  1245.         355 -ERROR- NOT A COLUMN OR VARIABLE NAME
  1246.         356 ERROR(S) IN VARIABLES. CORRECT WITH DEFINE.
  1247.         363 -ERROR- THERE ARE NO VARIABLES DEFINED
  1248.         366 CANNOT RECOGNIZE TYPE
  1249.         367 INVALID RESULT TYPE FOR EXPRESSION
  1250.         368 CANNOT RECOGNIZE NUMBER
  1251.         369 VARIABLE NOT DEFINED
  1252.         370 NUMBER GREATER THAN THE NUMBER OF VARIABLES
  1253.         371 NUMBER LESS THAN <N>
  1254.         380 -ERROR- ALREADY 40 VARIABLES DEFINED
  1255.         381 CANOT RECOGNIZE VARIABLE NAME
  1256.         382 VARIABLE EXISTS. REDEFINE IT (Y/N)?
  1257.         383 ILLEGAL CHARACTER IN VARIABLE NAME
  1258.         384 VARIABLE NAME CANNOT BE A KEYWORD
  1259.         385 VARIABLE CANNOT HAVE THE SAME AS A COLUMN
  1260.         387 CANNOT RECOGNIZE EUAL SIGN (=)
  1261.         388 CANNOT RECOGNIZE FIRST OPERAND
  1262.         390 CANNOT RECOGNIZE OPERATOR
  1263.         399 A WHERE CLAUSE IS REQUIRED
  1264.         400 NO FORMS HAVE BEEN DEFINED
  1265.         401 <FORMNAME> IS AN UNDEFINED SCREEN FORM
  1266.         402 UNABLE TO OPEN FILE
  1267.         403 ILLEGAL FILE NAME
  1268.         404 INPUT FILE NOT FOUND
  1269.         415 ROW OUT OF BOUNDS
  1270.         417 COLUMN IS OUT OF BOUNDS
  1271.         419 TOO MANY TABLES TO DEFINE FORMS
  1272.         420 TOO MANY COLUMNS TO DEFINE FORMS
  1273.         426 NO FORMS HAVE BEEN DEFINED
  1274.         427 <FORMNAME> IS AN UNDEFINED SCREEN FORM
  1275.         428 -WARNING- NO DATA EXISTS FOR THIS TABLE
  1276.         429 INSUFFICIENT SPACE TO PERFORM EDIT
  1277.         439 YOU HAVE MORE THAN 23 LINES ON THE FORM
  1278.         440 FORM DEFINITION IS INCOMPLETE
  1279.         441 LAYOUT DATA IS INCOMPLETE - CHECK IT OUT
  1280.         442 YOU HAVE TOO MANY COLUMN NAME LAYOUTS
  1281.         443 YOU HAVE DUPLICATE LAYOUT ENTRIES
  1282.         444 YOU DO NOT HAVE ANY COLUMN NAMES DEFINED IN THIS FORM
  1283.         446 REPORT DEFINITION IS INCOMPLETE
  1284.         447 REPORT DATA IS INCORRECT - CHECK IT OUT
  1285.         453 EXPRESSION CANNOT BE EVALUATED
  1286.         455 SPECIFIED OFFSET OUT OF RANGE
  1287.         462 ENDWHILE OR ENDIF MISSING IN AN INPUT FILE
  1288.         464 ATTEMPTING TO IMPROPERLY TERMINATE A WHILE OR IF BLOCK
  1289.         465 WHILE AND IF COMMANDS ARE NESTED BEYOND MAXIMUM
  1290.         466 NO WHILE OR IF BLOCKS ARE OPEN ON CURRENT INPUT SOURCE
  1291.         468 THE SCHEMA OPTION MAY NOT BE USED WITH AS DIF OR AS MPLAN
  1292.         474 YOU DON'T HAVE PERMISSION TO MODIFY REPORTS
  1293.         480 YOUR VALUE DOES NOT HAVE THE SAME TYPE AS YOUR VARIABLE
  1294.         484 VARIABLE TYPE DOES NOT MATCH COLUMN TYPE
  1295.         485 NO COLOR BY THAT NAME
  1296.         486 YOU CAN'T HAVE THE SAME FOREGROUND AND BACKGROUND
  1297.         487 THAT COLOR CAN'T BE USED AS BACKGROUND
  1298.         488 VARIABLE NOT DEFINED
  1299.         490 VARIABLE TABLE IS FULL, USE AN EXISTING VARIABLE OR CLEAR A
  1300.             VARIABLE
  1301.         491 NUMBER OF CHARACTERS MUST BE 1 TO 1500
  1302.         492 VARIABLE MUST BE AN INTEGER
  1303.         493 INVALID ROUTE NUMBER OR ROUTE DOES NOT EXIST
  1304.         494 YOU DON'T HAVE MODIFY PERMISSION ON FORMS
  1305.         495 INVALID OPERATOR
  1306.         496 CANNOT RECOGNIZE SECOND OPERAND
  1307.         498 ERROR(S) IN VARIABLES. CORRECT WITH DEFINE.
  1308.         500 SORTING FILE PROBLEMS - CHECK FOR FULL DISK
  1309.         504 INSUFFICIENT SPACE TO PROCESS REPORTS COMMAND
  1310.         505 -ERROR- MAXIMUM NUMBER OF COLUMN NAMES, VARIABLES LOCATED
  1311.         509 VARIABLE LIMIT EXCEEDED
  1312.         510 -ERROR- PAGESIZE MUST BE LESS THAN 1000
  1313.         512 FILE TOO LARGE FOR RBEDIT
  1314.         526 FILE NOT FOUND
  1315.         527 INVALID DIRECTORY
  1316.         528 INVALID DRIVE
  1317.         538 COLUMN LENGTH MUST BE BETWEEN 1 AND 1500
  1318.         539 YOU CANNOT SPECIFY A LENGTH FOR DATE, TIME, OR DOLLAR
  1319.         540 COLUMN MAKES TABLE WIDER THAN 1530 BYTES
  1320.         545 <COLNAME> IS IN ANOTHER TABLE. USE A DIFFERENT NAME
  1321.         548 TOO MANY COLUMN NAMES IN THE DATABASE - LIMIT IS 400
  1322.         550 UNABLE TO RENAME FILE
  1323.         551 OUT OF FILE HANDLES
  1324.         561 ROW IS OUT OF BOUNDS
  1325.         562 COL IS OUT OF BOUNDS
  1326.         563 VARIABLE IS NOT FOUND
  1327.         564 VARIABLE MUST BE AN INTEGER
  1328.         565 NUMBER IS OUT OF RANGE
  1329.         566 DISPLAY OR RUN PROCEDURE NOT FOUND
  1330.         567 NOT A RUN PROCEDURE
  1331.         568 NOT A DISPLAY PROCEDURE
  1332.         569 CAN'T OPEN SOURCE FILE
  1333.         570 CAN'T CREATE DESTINATION FILE
  1334.         571 DISK FULL
  1335.         576 INVALID DRIVE
  1336.         589 INTERNAL ERROR - OUT OF DYNAMIC SPACE
  1337.         590 INTERNAL ERROR - HEAP ALLOCATION ERROR
  1338.         592 NOT A MENU PROCEDURE
  1339.         593 INVALID DATA IN THE MENU FILE
  1340.         594 UNABLE TO FIND MATCHING LABEL FOR <LABELNAME>
  1341.         595 INTERNAL ERROR - OUT OF DYNAMIC SPACE
  1342.         601 TOO MANY VARIABLES DEFINED. PRESS ANY KEY TO CONTINUE
  1343.         604 CANNOT DRAW ANY PART OF A FORM ABOVE OR BELOW SCREEN LIMIT
  1344.         605 INTERNAL ERROR - OUT OF DYNAMIC SPACE
  1345.         605 NO FORMS HAVE BEEN DEFINED
  1346.         607 <FORMNAME> IS AN UNDEFINED SCREEN FORM
  1347.         609 INTERNAL ERROR REFERENCING VARIABLE
  1348.         612 <TBLNAME> IS NOT A VALID TABLE
  1349.         613 <COLNAME> IS NOT A COLUMN IN TABLE <TBLNAME>
  1350.         614 <OPERATOR> IS NOT A VALID OPERATOR
  1351.         622 CONNOT RECOGNIZE WHERE OPERATOR
  1352.         623 WHERE CLAUSE IS INCOMPLETE
  1353.         624 TOO MANY CONDITIONS IN THE WHERE CLAUSE
  1354.         635 VARIABLE TYPE DOES NOT MATCH COLUMN TYPE
  1355.         637 ERROR VARIABLE NOT FOUND
  1356.         639 INVALID SHOW PARAMETER
  1357.        2020 VARIABLE <VARNAME> IS NOT DEFINED
  1358.        2045 -ERROR- COLUMN <COLNAME> IS NOT IN THE TABLE <TBLNAME>
  1359.        2053 -ERROR- COLUMN NAME <COLNAME> IS USED MORE THAN ONCE
  1360.        2058 -WARNING- LENGTH AFTER INTEGER OR REAL DEFINES A VECTOR. PLEASE
  1361.             ENTER NO LENGTH
  1362.        2071 -ERROR- COLUMN <COLNAME> MUST BE COMPARED TO <DATATYPE> VALUE
  1363.        2076 <COLNAME1> AND <COLNAME2> DATA TYPES CANNOT BE COMPARED
  1364.        2099 TOO MANY CONDITIONS FOR A RULES. THE MAXIMUM IS 10.
  1365.        2121 COLUMN <COLNAME> MUST BE A VALID <DATATYPE>
  1366.        2123 -WARNING- COLUMN <COLNAME> WILL BE TRUNCATED
  1367.        2136 -WARNING- NO DATA EXISTS FOR THIS TABLE
  1368.        2137 -WARNING- NO ROWS SATISFY WHERE CLAUSE  -  END-OF-DATA
  1369.             ENCOUNTERED (SET POINTER)
  1370.        2182 VALID DEFINE COMMANDS ARE OWNER, COLUMNS, TABLES, PASSWORDS,
  1371.             LIST, RULES, ETC.
  1372.        2189 COLUMN <COLNAME> IS ALREADY USED IN THIS TABLE
  1373.        2194 ALLOWABLE COLUMN TYPES ARE: TEXT, INTEGER, REAL, DATE, TIME, AND
  1374.             DOLLAR
  1375.        2199 THE FOLLOWING COLUMNS ARE NOT ASSOCIATED WITH A TABLE
  1376.        2201 THE ABOVE COLUMN NAMES WILL BE LOST IF YOU LEAVE THE DEFINE MODE
  1377.        2273 NEW NAME IS ALREADY BEING USED FOR A COLUMN WHICH DIFFERS IN TYPE
  1378.             OR LENGTH
  1379.        2277 COLUMN <COLNAME> IS NOT COMMON TO EITHER TABLE
  1380.        2279 -ERROR- TABLES <TBLNAME1> AND <TBLNAME2> HAVE NO COMMON COLUMN
  1381.             NAMES
  1382.        2307 -WARNING- <COLNAME> IS A DUPLICATE COLUMN NAME, YOU SHOULD RENAME
  1383.             ONE OF THEM
  1384.        2529 TYPE CONVERSION ERROR CHANGING <VARNAME> TO TYPE <DATATYPE>
  1385.        2531 CANNOT EXECUTE <COMMAND> WITH MORE THAN 39 TABLES DEFINED
  1386.        2534 -ERROR- COLUMN <COLNAME> IS NOT DEFINED
  1387.        2536 ALLOWABLE COLUMN TYPES ARE TEXT, INTEGER, REAL, DATE, TIME, AND
  1388.             DOLLAR
  1389.        2541 -ERROR- COLUMN <COLNAME> IS ALREADY USED WITH THIS TABLE
  1390.        2546 CANNOT USE THE REMOVE COMMAND WITH ONLY ONE COLUMN IN THE TABLE
  1391.        2610 VARIABLE <VARNAME> NOT DEFINED IN THE FORM
  1392.  
  1393.  
  1394.  
  1395. ***************************
  1396. DATA TYPE IN VARIABLE FORMS
  1397. ***************************
  1398. by Marianne Jeager
  1399.  
  1400. When you define a form, it is stored in the Forms table.
  1401. If you do a "select all fro forms" and look in the layout section, you normally
  1402. see 3 numbers after the column name.  These numbers represent the line number,
  1403. beginning position number and the located length.  With variable forms, there is
  1404. a fourth number after the variable name, with a code indicating the data type of
  1405. the variable.  The codes are as follows:
  1406.  
  1407.         1     integer
  1408.         2     real
  1409.         4     date
  1410.         5     time
  1411.         6     dollar
  1412.         -20   text (the negative of the length of the text)
  1413. tech notes 7
  1414. ***********************************************
  1415. NOTES #7 FROM TECH SUPPORT - SEPTEMBER 20, 1985
  1416. ***********************************************
  1417.  
  1418. New issues of these tech notes are published here every 2 to
  1419. 3 weeks and much of the information will also be published
  1420. in the R:base EXCHANGE.  Back issues can be found in the
  1421. FILES section.
  1422.  
  1423.  
  1424.  
  1425. *********************************
  1426. LONG VARIABLE LENGTH TEXT COLUMNS
  1427. *********************************
  1428.  
  1429. Some applications use long text fields and customers have   
  1430. indicated that they would like to be able to store these fields as
  1431. variable length "memos" as some other products allow.
  1432.  
  1433. The following files can be used to mimic this "memo" feature.  You
  1434. may of course adapt the example presented by these files to your
  1435. own needs.  If your application is TEXT intensive, you will want
  1436. to pay particular attention to this article.
  1437.  
  1438.  
  1439. RUN BUILD.CMD      
  1440. -------------
  1441. This command file will create a database with one
  1442. table consisting of 2 columns.
  1443.  
  1444.  
  1445. RUN MEMO.CMD
  1446. ------------
  1447. This command file will present you with a menu of 3 choices:
  1448.  
  1449.     1         Create a memo
  1450.     2         Print a memo
  1451.     3         Quit
  1452.  
  1453.  
  1454. In this example a memo number is assigned to each memo entered. 
  1455. This number is the only thing that is actually stored in the
  1456. database.  Also, the number is turned into a DOS filename by adding
  1457. .MEM as an extension. Therefore, if 55 is the memo number, a file
  1458. called 55.MEM is created.  The actual text inside the memo is
  1459. stored in the 55.MEM DOS file.
  1460.  
  1461. Depending on your needs, a number or a name may be stored in the
  1462. R:base TEXT column that holds the memo name and used as the actual
  1463. DOS filename.  R:base stores the filename and DOS holds the file. 
  1464.  
  1465. This feature could be extended and used to store a long variable
  1466. length text column for every row in your table.  You would only be
  1467. limited by the maximum number of files allowed by DOS.  You could
  1468. set up your application to use the number in your unique record id
  1469. column (such as CUST#, PROJ#, INVOICE#, SSN# or whatever) as the
  1470. memo identifier and DOS file name.  You could use a form to enter
  1471. all the information except the long TEXT column and use macros
  1472. similar to those below to enter the long TEXT column.
  1473.  
  1474. Since DOS files are  used, each memo name would have to be unique
  1475. and conform to DOS file naming conventions. The contents of the
  1476. MEMO is not stored in the database, only its name is stored.  The
  1477. file folding the contents is variable length depending on the data
  1478. stored in that file.  If you were using this feature to store a variable length
  1479. TEXT item for ea
  1480. h row in your table, you would have a DOS file on your disk for
  1481. every row in your table.  
  1482.  
  1483. Clearly, if your DOS systems only allows you to have 64 files, this
  1484. would not be a viable option unless you have only a handfull of
  1485. rows.  You will need to check with your hardware manufacturer to
  1486. find out how many files you can have on your system.  It could be
  1487. different depending on what machine you are on.  For example, if
  1488. you have an IBM machine with an IBM hard disk, are using PC-DOS,
  1489. and have your files in subdirectories, you may have as many files
  1490. as you want.
  1491.  
  1492. Also keep in mind that if you have 10,000 rows you could have
  1493. 10,000 files; so doing directories with the DIR command could take
  1494. a long time.  
  1495.  
  1496. RBEDIT is used to create each file. So the size limit on each
  1497. "memo" is large.  You can have 769 lines times 80 characters per
  1498. line for a maximum of 61,520 characters.  In other words, R:MEMO
  1499. feature (described here) allows memos 15 times larger than those
  1500. that d other memo feature allows.  
  1501.  
  1502. With this R:MEMO feature, you could have a memo well over 10 normal
  1503. pages long for one row in your table and one only a line or two
  1504. long for another row and not waste disk space.
  1505.  
  1506.  
  1507. Contents of the BUILD.CMD:
  1508. --------------------------
  1509. DEFINE MEMO
  1510. COLUMN
  1511. NAME TEXT 8
  1512. MEMOFILE INTEGER
  1513. TABLE
  1514. MEMO WITH NAME MEMOFILE
  1515. END
  1516.  
  1517.  
  1518. Contents of the MEMO.CMD file:
  1519. ------------------------------
  1520. SET ECHO OFF
  1521. SET MESSAGES OFF
  1522. SET ERROR MESSAGES OFF
  1523. SET BELL OFF
  1524. OPEN MEMO
  1525. SET LINES 24
  1526. SET VAR LINE INT; SET VAR LINE TO 15   *(ADJUST THESE VALUES TO
  1527.                                          FIT YOUR MENU SCREEN)
  1528. SET VAR COL  INT; SET VAR COL  TO 35  
  1529. NEWPAGE
  1530. DISPLAY MEMO.TXT
  1531. WRITE "PRESS ANY KEY TO CONTINUE"
  1532. PAUSE
  1533. NEWPAGE
  1534. DISPLAY MEMO.MNU
  1535. FILLIN ANS USING "ENTER YOUR CHOICE  " AT .LINE .COL
  1536. IF ANS = 1 THEN
  1537.          WRITE "                        " AT .LINE .COL
  1538.          FILLIN NAME USING "ENTER NAME  " AT .LINE .COL
  1539.          WRITE "                        " AT .LINE .COL
  1540.          FILLIN MEMO USING "ENTER MEMO NUMBER " AT .LINE .COL
  1541.          LOAD MEMO
  1542.          .NAME .MEMO
  1543.          END
  1544.          SET VAR FILE TO .MEMO + ".MEM"
  1545.          RBEDIT .FILE
  1546. ENDIF
  1547. IF ANS = 2 THEN
  1548.          WRITE "                        " AT .LINE .COL
  1549.          FILLIN NAME USING "ENTER NAME  " AT .LINE .COL
  1550.          SET VAR MEMOFILE TO MEMOFILE IN MEMO WHERE NAME = .NAME
  1551.          SET VAR FILE TO .MEMOFILE + ".MEM"
  1552.          NEWPAGE
  1553.          DISPLAY .FILE
  1554.          WRITE "---------------------------------"
  1555.          WRITE "PRESS ANY KEY TO CONTINUE"
  1556.          PAUSE
  1557. ENDIF
  1558. IF ANS = 3 THEN
  1559.          NEWPAGE
  1560.          SET LINES 20
  1561.          SET MESSAGES ON
  1562.          SET ERROR MESSAGES ON
  1563.          SET BELL ON
  1564.          RETURN
  1565. ENDIF
  1566. CLEAR ALL VAR
  1567. QUIT TO MEMO.CMD
  1568.  
  1569.  
  1570. Contents of the MEMO.MNU file:
  1571. ------------------------------
  1572.                               [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
  1573.                               [[                                      [[
  1574.                               [[   1   CREATE A MEMO                  [[
  1575.                               [[                                      [[
  1576.                               [[   2   PRINT A MEMO                   [[
  1577.                               [[                                      [[
  1578.                               [[   3   QUIT                           [[
  1579.                               [[                                      [[
  1580.                               [[                                      [[
  1581.                               [[                                      [[
  1582.                               [[                                      [[
  1583.                               [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
  1584.  
  1585.  
  1586. Contents of the MEMO.TXT file:
  1587. ------------------------------
  1588.  
  1589.            ████████████████████████████████████████████████████
  1590.            ████                                            ████
  1591.            ███                R : M E M O                   ███
  1592.            ████                                            ████
  1593.            ████████████████████████████████████████████████████
  1594.  
  1595.  
  1596.  
  1597.  
  1598. ***************************************
  1599. R:BASE 5000 VERSION 1.01 - SYSTEM DISKS
  1600. ***************************************
  1601.  
  1602. If you are using a floppy disk system, note that R:base 5000 
  1603. version 1.01 has a different loading procedure than version 
  1604. 1.0.
  1605.  
  1606. 1.01 system disk I contains the EXE file
  1607. 1.01 system disk II contains the OVL file
  1608.  
  1609. THIS IS THE REVERSE OF VERSION 1.0!  Although it will be
  1610. familiar to users of R:base 4000.  
  1611.  
  1612. There is also a different floppy disk loading procedure.  
  1613. When following these instructions (pages 1-8 to 1-10 of the 
  1614. 1.01 manual) you MUST have a disk in drive B or you will get 
  1615. the abort, retry, ignore message.  If you get this message 
  1616. press A to abort and start over with a disk in drive B.
  1617.  
  1618. Floppy disk users can now use the RBASE.DAT file
  1619. by putting it on their database disk and having their database 
  1620. disk in drive B when they start R:base.
  1621.  
  1622.  
  1623.  
  1624.  
  1625. ************************************
  1626. SOLUTION FOR GRAND TOTALS IN REPORTS
  1627. ************************************
  1628.  
  1629. Briefly, the problem was that with both subtotals and grand 
  1630. totals in a report, the grand total added in the last item 
  1631. twice in version 1.0 of R:base 5000 (not a problem in 1.01).
  1632.  
  1633. A user reported that he made his date field a break point, 
  1634. and reset his grand total at this break. He says it works great.
  1635.  
  1636.  
  1637.  
  1638.  
  1639. *******************************
  1640. HOT TIPS FROM TECHNICAL SUPPORT
  1641. *******************************
  1642.  
  1643.  
  1644. PRODUCT:  5K
  1645. VERSION:  1.0
  1646.  
  1647. SOLUTION: When the manual tells you (on page 17-14) to start
  1648.           looking at the sample application disk files by
  1649.           typing INIT.ORD, men0proc.ord, men1proc.ord, etc.
  1650.           note that these are actually blocks in the disk
  1651.           files PROCS2.ASC, MENUS.ASC. etc.  In other words,
  1652.           they do not exist as stand-alone files.  
  1653.  
  1654.           You will find INIT as a block in the PROCS2.ASC
  1655.           file right after a $COMMAND line that indicates
  1656.           that it is a command block.  You will see that the 
  1657.           INIT block passes control passes control to the 
  1658.           main menu processing file, MENUS.ORD which has 6  
  1659.           $MENU blocks named MEN1PROC, MEN2PROC, etc. 
  1660.  
  1661.           Note too that files with extensions of .ASC and 
  1662.           .APP are usually ascii files and can be read.  The 
  1663.           are also known as APPLICATION FILES and are not 
  1664.           compiled files.  On the other hand, files with 
  1665.           .ORD and .APX are generally compiled PROCEDURE 
  1666.           FILES and cannot be read.
  1667.  
  1668. ============================================================
  1669.  
  1670. PRODUCT:  R5K
  1671. VERSION:  1.0
  1672.  
  1673. PROBLEM:  Load command against unopened database produces
  1674.           "table does not exist error".
  1675.  
  1676. SOLUTION: Always open your database before issuing R:base 
  1677.           commands that relate to that database.
  1678. =============================================================
  1679.   
  1680. PRODUCT:  R5K
  1681. VERSION:  1.0
  1682.  
  1683. PROBLEM:  Typo on p. 10-3, syntax example "2from"
  1684.  
  1685. SOLUTION: "2 from".
  1686.  
  1687. =========================================================
  1688.  
  1689. PRODUCT:  5K
  1690. VERSION:  1.0
  1691.  
  1692. PROBLEM:  Edit or enter table form after calling a
  1693.           variable form and get error message "form
  1694.           definition is incomplete."
  1695.  
  1696. SOLUTION: Put the command "new" immediately before calling
  1697.           the table form.
  1698.  
  1699. ============================================================
  1700.  
  1701. PRODUCT:  5K
  1702. VERSION:  1.0
  1703.  
  1704. PROBLEM:  In 4K users could set a variable to a blank (alt
  1705.           255) then they could show this variable to blank
  1706.           out a line on the screen. This does not work in
  1707.           5K only one char. is blanked out.
  1708.  
  1709. SOLUTION: WRITE "                              " +
  1710.           AT row# col# 
  1711.  
  1712. ============================================================
  1713.  
  1714. PRODUCT:  5K
  1715. VERSION:  1.0
  1716.  
  1717. PROBLEM:  SET POINTER and keyed columns
  1718.  
  1719. SOLUTION: Do not use a keyed column in the WHERE clause with 
  1720. the EQ or = operator in a SET POINTER command line. Use contains, 
  1721. GT or LT and all rows will be found or delete the key.  This 
  1722. problem has been fixed in version 1.01
  1723.  
  1724. =============================================================================
  1725.  
  1726. PRODUCT:  EXPRESS
  1727. VERSION:  1.0
  1728.  
  1729. PROBLEM:  ERROR too many menus defined.
  1730.  
  1731. SOLUTION: Express limits are 15 menus total in 3 levels.
  1732.  
  1733. =============================================================================
  1734.  
  1735. PRODUCT:
  1736. VERSION:
  1737.  
  1738. PROBLEM:  User builds an application with EXPRESS and says
  1739.           YES to an RBASE.DAT file.  User then wants to
  1740.           get to R> from his/her application but they
  1741.           always exit to DOS or family driver menu.  The
  1742.           RBASE.DAT file looks like this:  
  1743.  
  1744.           RUN APPL IN APPL.APX 
  1745.           EXIT  
  1746.           
  1747. SOLUTION:    They can hit (ESC) multiple times from the main 
  1748.           application menu to get to the R> or delete/rename
  1749.           the RBBASE.DAT file while at the DOS prompt.  The 
  1750.           EXIT action option in Express takes you to previous 
  1751.           menu or the R>.
  1752.  
  1753.  =============================================================================
  1754.  
  1755. PRODUCT:  EXPRESS
  1756. VERSION:  ALL VERSIONS
  1757.  
  1758. PROBLEM:  Express wrote application files correctly.  When
  1759.           ran got: 
  1760.  
  1761.           -ERROR- pick2 is undefined variable  
  1762.  
  1763. SOLUTION: She was using macro w/CLEAR ALL VARS in it.  Instead,
  1764.           she should clear only specific variables.
  1765.  
  1766. =============================================================================
  1767.  
  1768. PRODUCT:  R5K
  1769. VERSION:  1.0
  1770.  
  1771. PROBLEM:  User wants to select all records for a specific
  1772.           month or day or year.  
  1773.  
  1774. SOLUTION: Set date format so that the desired part of date 
  1775.           is first, (e.g., mm/dd/yy to select month, dd/mm/yy 
  1776.           to select day, and yy/mm/dd to select year).  Then, 
  1777.           to find all the 1985 records, for example, you would 
  1778.           issue the following command: 
  1779.  
  1780.           SEL collist FROM tblname WHE datecol = 85/*/*  
  1781.  
  1782.           You can set date format to mmddyy and use MAY/*/* or 
  1783.           yymmdd and use 1985.
  1784.   
  1785. =============================================================================
  1786.  
  1787. PRODUCT:  R5K
  1788. VERSION:  all versions
  1789.  
  1790. PROBLEM:  Loading a fixed field ascii file using a form,
  1791.           and some of the other fields have "missing
  1792.           values" that are to be loaded as nulls.  The
  1793.           fields in question are type integer.  
  1794.  
  1795. SOLUTION: Wrong Solution:  You cannot put a -0- in the field,
  1796.           you cannot put a '*', for example, and then set
  1797.           null *.  In both instances you get the error
  1798.           message, field is not a valid integer.
  1799.  
  1800.           Right Solution:  Fields that are to contain
  1801.           "missing values" must be left blank.  They are
  1802.           then loaded as null.
  1803.  
  1804. ============================================================================== 
  1805.  
  1806. PRODUCT:  R5K
  1807. VERSION:  all versions
  1808.  
  1809. PROBLEM:  User cannot get SET COLOR command to work from R>
  1810.  
  1811.  
  1812. SOLUTION: Type in MODE CO80 at the DOS prompt before
  1813.           entering rbase.
  1814.  
  1815. ===============================================================================
  1816.  
  1817. PRODUCT:  R5K
  1818. VERSION:  1.0
  1819.  
  1820. PROBLEM:  Enter Print rptname, output to terminal, all
  1821.           that comes back is:
  1822.  
  1823.           more output follows - press [ESC] to quit, any key to continue
  1824.  
  1825.           User presses any key, the screen clears, and the 
  1826.           same message is written on top line.  It keeps going
  1827.           like this forever.
  1828.  
  1829. SOLUTION: User has not MARKED anything on the report or has not 
  1830.           MARKED any detail lines or set up any breaks.  User 
  1831.           needs to go back into reports and MARK.
  1832.  
  1833. =============================================================================
  1834.  
  1835. PRODUCT:  XRW
  1836. VERSION:  1.2
  1837.  
  1838. PROBLEM:  If the error message "Unable to open control
  1839.           directive file" appears when attempting to use
  1840.           XRW, the operator has probably issued the
  1841.           command XRW -R (in an attempt to suppress
  1842.  
  1843. SOLUTION: XRW will accept a valid file name after the XRW
  1844.           command.  E.G., XRW HOT.CMD     Where HOT.CMD
  1845.           contains commands such as: RUN MYREP.REP PRN
  1846.  
  1847. =============================================================================
  1848.  
  1849. PRODUCT:  5K
  1850. VERSION:  1.0
  1851.  
  1852. SOLUTION: Rule Processing - Rules are checked in the order
  1853.           the rules appear in the rules table, not in the
  1854.           order the data is entered.  If there are two
  1855.           mistakes on a table form, and neither passes
  1856.           rules, the first message displayed will be that
  1857.           of the first rule, rather than the first piece
  1858.           of data entered.  Try this with a load with
  1859.           prompts, and you'll see how it works.
  1860.   
  1861. =============================================================================
  1862.  
  1863. PRODUCT:  R5K
  1864. VERSION:  1.0
  1865.  
  1866. PROBLEM:  Edit or enter table form after calling a
  1867.           variable form and get error message "form
  1868.           definition is incomplete."
  1869.  
  1870. SOLUTION: Put the command "new" immediately before calling
  1871.           the table form.
  1872.  
  1873. =============================================================================
  1874.  
  1875. PRODUCT:  R5K
  1876. VERSION:  1.0
  1877.  
  1878. PROBLEM:  In 4K users could set a variable to a blank (alt
  1879.           255) then they could show this variable to blank
  1880.           out a line on the screen.  This does not work in
  1881.           5K - only one character is blanked out.
  1882.  
  1883. SOLUTION: Use the write command to write a blank line to
  1884.           the screen, eg write "              " AT 23,1
  1885.  
  1886. =============================================================================
  1887.  
  1888. PRODUCT:  R5K
  1889. VERSION:  all versions
  1890.  
  1891. PROBLEM:  In reports define V1 = anything and then define 
  1892.  
  1893.           V2 = V1 IN tblname WHERE. . . 
  1894.           V2 = .V1 IN tblname WHERE. . . 
  1895.  
  1896.           neither of these two expressions are allowed in REPORTS.
  1897.  
  1898. =============================================================================
  1899.  
  1900. PRODUCT:  R5K FileGateway
  1901. VERSION:  any version
  1902.  
  1903. PROBLEM:  5K Gateway - Couldn't run it or would get to
  1904.           main menu and couldn't exit.  Still need SET
  1905.           NO87 on AT.  OK with Enhanced Graphics Adapter.
  1906.   
  1907. =============================================================================
  1908.  
  1909. PRODUCT:  5K
  1910. VERSION:  any version
  1911.  
  1912. PROBLEM:  Initializing the #RETURN variable before 
  1913.           using it in a variable form can cause strange 
  1914.           results such as data being scrambled. 
  1915.   
  1916. SOLUTION: 1)  Have them replace #RETURN throughout their
  1917.           command file with another varname (e.g., XXX).
  1918.           2)  Have them put a line immediately after each
  1919.           EDIT VAR or ENTER VAR that says: 
  1920.  
  1921.           SET VAR XXX to #RETURN  
  1922.  
  1923.           If both these steps are done, the problem should 
  1924.           go away.
  1925.   
  1926. =============================================================================
  1927.   
  1928. PRODUCT:  5K
  1929. VERSION:  1.0
  1930.  
  1931. PROBLEM:  Grand total in report is not correct, it looks
  1932.           like the last item is added twice.
  1933.   
  1934. SOLUTION: Check to see if the user is printing a subtotal
  1935.           in a PAGE footing and reseting that variable at
  1936.           end of page.  This causes grand total of that
  1937.           column printed in REPORT footing to be off. (e.g.,
  1938.           SUBTOT = sum of column/printed and reset in page
  1939.           footer.  GTOT = sum of column/printed in report
  1940.           footer).  If subtotal is printed/reset as break
  1941.           footer, it does total correctly.
  1942.  
  1943.   
  1944. =============================================================================
  1945.   
  1946.  
  1947. PRODUCT:  5K
  1948. VERSION:  1.0
  1949.  
  1950. PROBLEM:  Loading a table with dotted variables when one 
  1951.           or more of the variables contain null value can 
  1952.           cause a problem when null is set to blank with:
  1953.  
  1954.           SET NULL " " 
  1955.  
  1956. SOLUTION: Best workaround - 
  1957.  
  1958.           SET NULL -0-  
  1959.           LOAD tablum 
  1960.           .V1 .V2 .V3  
  1961.           END  
  1962.           SET NULL " "   
  1963.          
  1964.           If you surround the LOAD block with the SET NULL 
  1965.           command like this  then when you are drawing your 
  1966.           variable form your user won't see the -0-, and  the 
  1967.           load will work correctly.
  1968.   
  1969. =============================================================================
  1970.   
  1971. PRODUCT:  R5K
  1972. VERSION:  1.0
  1973.  
  1974. PROBLEM:  When converting from 4K to 5K the date fields
  1975.           got turned into a text field.  This was because
  1976.           in 4K the date was set to yy/mm/dd.  
  1977.  
  1978. SOLUTION: If you set the date in 5K to match your 4K format 
  1979.           before doing the convert then everything is AOK.
  1980.  
  1981.   
  1982. =============================================================================
  1983.   
  1984. PRODUCT:  R5K
  1985. VERSION:  1.0
  1986.  
  1987. PROBLEM:  When defining a password for a database, to
  1988.           test the password, user must exit Rbase and 
  1989.           reboot Rbase before the password will work properly.
  1990.  
  1991. =============================================================================
  1992.  
  1993. PRODUCT:  R5K
  1994. VERSION:  1.0
  1995.  
  1996. PROBLEM:  In reports when you have a page total and a
  1997.           report total totalling the same column, the
  1998.           report total will add the last record twice
  1999.           pagetot = pagetot + column(x)   reptot = reptot
  2000.           + column(x).
  2001.  
  2002. SOLUTION: To fix this, change the definition to look like
  2003.           this   Pagetot = pagetot + column(x)  junk =
  2004.           column(x)  reptot = reptot + junk.
  2005.    
  2006. =============================================================================
  2007.   
  2008. PRODUCT:  R5K
  2009. VERSION:  1.0
  2010.  
  2011. PROBLEM:  Rbase takes 237,088 bytes of memory after
  2012.           setting buffers/files/path.  The family driver
  2013.           needs approximately 30,352 bytes memory.  Rbase
  2014.           will also use up to an additional 64K if
  2015.           available.  Therefore the maximum bytes free
  2016.           Rbase 5000 will use is approximately 332,976.
  2017.           This figure is based on Version 1.0 and may change
  2018.           with future versions.
  2019.   
  2020. =============================================================================
  2021.  
  2022. PRODUCT:  R5K
  2023. VERSION:  1.0
  2024.  
  2025. PROBLEM:  User had XT with Orchid Turbo 186
  2026.           card.  When tried to open DB in turbo mode, got
  2027.           "Out of file handles".  OK when ran without
  2028.           turbo.  Apparently the turbo mode uses it's own
  2029.           config.sys file.  He had only set the config.sys
  2030.           for regular mode.
  2031.    
  2032. =============================================================================
  2033.  
  2034.  
  2035. PRODUCT:  R5K
  2036. VERSION:  1.0
  2037.  
  2038. SOLUTION: Delete duplicates uses keys if there are any. 
  2039.   
  2040. =============================================================================
  2041.   
  2042. PRODUCT:  R5K
  2043. VERSION:  1.0
  2044.  
  2045. PROBLEM:  Customer has device driver for external HD.
  2046.           CONFIG.SYS file has 1)device driver for HD.
  2047.           2) set buffers.  3)  files.  Wouldn't work.
  2048.   
  2049. SOLUTION: Moving it so order was: buffers & file settings,
  2050.           device driver for HD.  Then was OK.
  2051.    
  2052. =============================================================================
  2053.   
  2054. PRODUCT:  R5K
  2055. VERSION:  1.0
  2056.  
  2057. PROBLEM:  Foreign versions, Sorts & special characters,
  2058.           Printers.  Special ascii characters 
  2059.           have ascii character values greater than the
  2060.           standard letter values.  Since our sorts are
  2061.           based on ascii values, these special characters
  2062.           do not sort correctly (alphabetically). 
  2063.   
  2064.           Also, American printers handle these different
  2065.           than printers from the countries for whom these
  2066.           characters are normal.  To print a, backspace,
  2067.           print an apostrophe.  This will not work well on
  2068.           all printers.
  2069.    
  2070. =============================================================================
  2071.  
  2072. PRODUCT:  R5K
  2073. VERSION:  1.0
  2074.  
  2075. PROBLEM:  If you set a variable to be used as menu
  2076.           variable in choose command to any type including
  2077.           integer then choose command produces error
  2078.           message "internal error referencing variables".
  2079.  
  2080. SOLUTION: Don't initialize the variable used by the CHOOSE 
  2081.           command. 
  2082.   
  2083. =============================================================================
  2084.  
  2085. PRODUCT:  R5K
  2086. VERSION:  1.0
  2087.  
  2088. PROBLEM:  Customers are unloading reports and
  2089.           then attempting to bring them back in with the
  2090.           input command.  They are getting an error
  2091.           message telling them that excess data values
  2092.           will be ingored.  The problem is that they have
  2093.           put quotes around values in their variable
  2094.           definition section.
  2095.  
  2096. SOLUTION: Set quotes to an unused character like the # key
  2097.           before doing the unload and then after the input
  2098.           set it back to ".
  2099.  
  2100. =============================================================================
  2101.  
  2102. PRODUCT:  R5K
  2103. VERSION:  1.0
  2104.  
  2105. PROBLEM:  When moving variable substrings to a variable
  2106.           which was previously null, if the value being
  2107.           moved is less than four characters in length,
  2108.           then, the result of the move will produce a
  2109.           variable with a length of four.  That is, the
  2110.           value being moved will be padded with trailing
  2111.           blanks.
  2112.  
  2113. SOLUTION: Make sure that the receiving varaible is never
  2114.           null at the time it receives the character
  2115.           string.  That is, make sure that the variable
  2116.           has been initialised to at least a single
  2117.           character value prior to receiving the new
  2118.           character string.  Example:  SET VAR V1 TEXT
  2119.           SET VAR V2 TEXT   SET VAR V1 TO "ZZZZZZZZZZZZZ"
  2120.           SET VAR V2 TO "Y"   MOVE 2 FROM V1 TO V2 AT 1.
  2121.           The example above will produce a V1 variable
  2122.           value with a length of two.  If the variable V2
  2123.           had not been set to an initial value (i.e., was
  2124.           null), then, the resulting value of V2 would
  2125.           have been four characters in length.  That is,
  2126.           it would have been ZZ  where 00 (2 blanks)
  2127.           represents a trailing blank.
  2128.  
  2129. =============================================================================
  2130.  
  2131. PRODUCT:  R5K
  2132. VERSION:  1.0
  2133.  
  2134. PROBLEM:  DBIII wants text nulls as "  ".  
  2135.  
  2136. SOLUTION: To get this do the following:  
  2137.  
  2138.           SET QUOTES=';SET NULL '"  "';SET QUOTES="  
  2139.  
  2140.           Then R5K will unload nulls in a way DBIII can read.
  2141.    
  2142. =============================================================================
  2143.   
  2144. PRODUCT:  R5K and R4K
  2145. VERSION:  1.0 and 1.01
  2146.  
  2147. PROBLEM:  Why different results with same command file
  2148.           under 5K 1.0 & 4K 1.15?  5K appear to round.  
  2149.           4K 1.15 appears to truncate.  
  2150.  
  2151. SOLUTION: Some commands didn't round correctly in R:base 5000 
  2152.           version 1.0 (particularly the ASSIGN command) all 
  2153.           round correctly in 1.01.  All calculations should 
  2154.           round in Ver 1.01 R5K.  In version 1.15 of R:base 400
  2155.           calculations truncated.
  2156.  
  2157. =============================================================================
  2158.  
  2159. PRODUCT:  4K and 5K
  2160. VERSION:  all versions
  2161.  
  2162. PROBLEM:  This is a way to # pages in reports in 4000.
  2163.           Calculate how many rows will be printed on a
  2164.           page, Example:  2 header lines, 5 detail lines,
  2165.           pagesize = 52.  #rows/page =(52 - 2)/5 = 10)  2.
  2166.           Define expressions as follows:  rowct = rowct +
  2167.           1  vp = rowct/10 (this is result of step 1  vp2
  2168.           in page header section.  3.  Locate up2 in page
  2169.           header section.
  2170.  
  2171. SOLUTION: This will also be useful for 5K people who want
  2172.           to number pages in reports by company.  Often 
  2173.           they want to start the numbering sequence over 
  2174.           when company changes, and the #PAGE system variable
  2175.           cannot be reset.
  2176.    
  2177. ==========================================================================
  2178.  
  2179. PRODUCT:  R5K
  2180. VERSION:  1.01
  2181.  
  2182. PROBLEM:  Run command1; endif on a line will not run
  2183.           command1.  Input command2; show var; pause will
  2184.           show var and pause before command2 will be run,
  2185.           but it will run.
  2186.  
  2187. SOLUTION: The RUN and INPUT commands are interpreted by
  2188.           the computer as : set a flag so that the next
  2189.           time input is needed for this command line (the
  2190.           line the input or run statement is on) run or
  2191.           input the command or file.  However, if a
  2192.           semicolon follows the INPUT or RUN, the commands
  2193.           following the semicolon are run because they are
  2194.           on that command line.  If what follows the semicolon
  2195.           does not allow input for the current line (like
  2196.           ENDIF or another RUN command) then the first
  2197.           command will not be executed.  For example:
  2198.  
  2199.           RUN F1;RUN F2;RUN F3       *(will only run F3)
  2200.  
  2201.           INPUT F1.DAT; LOAD tblname *(will load tblname 
  2202.                                        with contents of F1.dat)
  2203.           RUN F1; SHOW VAR; EXI *(will do the SHOW VAR and then 
  2204.                                   EXIT R:base; F1 will never be run)
  2205.           RUN F1; SET VAR V1 INT *(will set V1 to Integer and 
  2206.                                    then will run F1)
  2207.  
  2208. =============================================================================
  2209.  
  2210. PRODUCT:  R5K
  2211. VERSION:  1.0
  2212.  
  2213. SOLUTION: When editing data with variable forms, rather
  2214.           than a series of change commands, it may be
  2215.           faster to:  
  2216.  
  2217.           DEL ROW FRO tblname WHE keycol = .Vkeycol 
  2218.           LOAD tblname
  2219.           .V1 .V2 . . .
  2220.           END
  2221.  
  2222.           For this method to work you must have put 
  2223.           all of the column values for the row into the 
  2224.           variables.
  2225.  
  2226.  
  2227.  
  2228.  
  2229. ***************
  2230. BOOKS ON R:BASE
  2231. ***************
  2232.  
  2233. This is a list of books on R:base that are currently available or
  2234. that will be available by the spring of 1986.
  2235.  
  2236. Contact your local bookstore to order these titles.
  2237.  
  2238. Microrim currently offers "Managing Information with Microcomputers"
  2239. through our telemarketing service.  Call 1-800-547-4000 to order this
  2240. book.
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247. BOOK NAME:  Using R:base 5000
  2248.  
  2249. AUTHOR:     Jonathan Erickson / Nicolas Baron
  2250.  
  2251. PUBLISHER:  Osborne McGraw Hill
  2252.             2600 Tenth St.
  2253.             Berkeley, CA  94710
  2254.  
  2255. CONTENT:    Follow up to OMH Using R:base 4000.  Provides an overview of
  2256.             R:Base 5000. Covers design issues, building forms and reports,
  2257.             a brief section on the programming language and a review of
  2258.             CLOUT and XRW use with R:base.
  2259.  
  2260. DUE DATE:   October 1985
  2261.  
  2262.  
  2263.  
  2264.  
  2265. BOOK NAME:  Understanding R:base 5000
  2266.  
  2267. AUTHOR:     Allan Simpson
  2268.  
  2269. PUBLISHER:  Sybex
  2270.             2344 6th St.
  2271.             Berkeley, CA  94710
  2272.  
  2273. CONTENT:    Written for new users of R:base 5000.  Includes glossary of terms,
  2274.             explanation of commands, how to build your own programs and
  2275.             applications, interface with other software and how to convert
  2276.             R:Base 4000 files to R:base 5000.
  2277.  
  2278. DUE DATE:   Currently available.  September 1985
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285. BOOK NAME:  Database Processing With Microcomputer Applications
  2286.  
  2287. AUTHOR:     David Kroenke / Don Nilson
  2288.  
  2289. PUBLISHER:  SRA
  2290.             College Division  10th Fl.
  2291.             155 N. Wacker Dr.
  2292.             Chicago, IL    60606
  2293.             ATTN:  Michael Carrigg   (312) 984-7098
  2294.  
  2295. CONTENT:    College textbook format.  Several complete examples are illustrated
  2296.             to study development and use of database applications. Detailed
  2297.             sections on Database Design and Database Applications are provided
  2298.             along with sections on programming with R:base 5000.
  2299.  
  2300. DUE DATE:   After January 1, 1986.
  2301.  
  2302. NOTES:      SRA will be provide textbook with 4 disk to universities
  2303.             and corporations for classroom use.  Microrim to sell book
  2304.             only, not book bundled with disks, through our
  2305.             telemarketing services and through retail bookstores.
  2306.  
  2307.  
  2308.  
  2309.  
  2310. BOOK NAME:  R:BASE 5000 FOR THE PROGRAMMER (A How-To-Do-It Book)
  2311.  
  2312. AUTHOR:     Nelson T. Dinerstein
  2313.  
  2314. PUBLISHER:  Scott, Foresman and Company
  2315.             1900 E. Lake Ave.
  2316.             Glenview, IL   60025
  2317.  
  2318. CONTENT:    A programmers guide to building applications with R:base 5000.
  2319.             Explores use of the programming language, programming concepts,
  2320.             advanced design principles and an example of an R:base 5000
  2321.             application.
  2322.  
  2323. DUE DATE:   March 1986
  2324.  
  2325.  
  2326.  
  2327.  
  2328.   R:BASE 4000 BOOKS
  2329.  
  2330.  
  2331.  
  2332. BOOK NAME:  Managing Information with Microcomputers
  2333.  
  2334. AUTHOR:     David Kroenke / Don Nilson
  2335.  
  2336. PUBLISHER:  Microrim, Inc.
  2337.             3380 146th Place
  2338.             Bellevue, WA   98007
  2339.  
  2340. CONTENT:    Good overview of R:base 4000.  Simple examples illustrate database
  2341.             design, menu building, createing forms and reports. Examples of
  2342.             use in marketing, manufacturing, finance and project management
  2343.             are provided. Use of CLOUT natural language query software is
  2344.             discribed.
  2345.  
  2346. DUE DATE:   Currently available. 1984 release.
  2347.  
  2348.  
  2349.  
  2350. BOOK NAME:  Using R:base 4000
  2351.  
  2352. AUTHOR:     Jonathan Erickson / Nicolas Baron
  2353.  
  2354. PUBLISHER:  Osborne McGraw Hill
  2355.             2600 Tenth St.
  2356.             Berkeley, CA  94710
  2357.  
  2358. CONTENT:    General information book about R:base 4000.  Covers design issues,
  2359.             reports, relational commands, and use of CLOUT along with helpful
  2360.             hints section.
  2361.  
  2362. DUE DATE:   Currently available.  1985 release.
  2363.  
  2364.  
  2365.  
  2366.  
  2367. BOOK NAME:  The Book of R:Base
  2368.  
  2369. AUTHOR:     Gilbert M. Roeder
  2370.  
  2371. PUBLISHER:  Retreival Technology Corp.
  2372.             All-Hands-On Press
  2373.             3 Courthouse Lane
  2374.             Chelmsford, MA    01824
  2375.  
  2376. CONTENT:    Good explanation of R:base 4000 functions. Simple straightforward
  2377.             approach. Also covers Microrim's Extended Report Writer and CLOUT.
  2378.  
  2379.  
  2380. DUE DATE:   Currently available.  1984
  2381.  
  2382. tech notes 8
  2383. ******************************************
  2384. TECHNICAL EDTORIAL #8 -- December 25, 1985
  2385. ******************************************
  2386. Copyright (c) 1985 by Microrim, Inc.
  2387.  
  2388.  
  2389.  
  2390. ***************
  2391. APPLICATION TIP 
  2392. ***************
  2393.  
  2394. Many R:base 5000 programmers have requested the ability to execute a 
  2395. complete command line that has been stored in a variable.  This is 
  2396. particularly useful when you want the user to enter an R:base command line 
  2397. in the middle of your application file. It allows your application to be 
  2398. more flexible.
  2399.  
  2400. You can do this by storing the command line in a dummy command file and 
  2401. then running the command file.
  2402.  
  2403. For example, the following segment of code will run whatever command line 
  2404. the user enters at the MY-APP> prompt:
  2405. .
  2406. .
  2407. .
  2408. WRITE "Enter the command +
  2409. line you wish to execute +
  2410. at the MY-APP> prompt"
  2411. FILLIN VLINE USING "MY-APP>"
  2412. OUTPUT DUMMY.CMD
  2413. SHOW VAR VLINE=70
  2414. OUTPUT SCREEN  
  2415. RUN DUMMY.CMD
  2416. .
  2417. .
  2418. .
  2419. Use this macro in your application when you want to pass control to the 
  2420. operator.
  2421.  
  2422.  
  2423.  
  2424. ***************
  2425. MULTI-UP LABELS
  2426. ***************
  2427. Product:  R:base 5000 
  2428.           all versions 
  2429.           R:base 4000
  2430.           1.1 or higher
  2431.  
  2432. Before reading this article you may want to review chapters 11 and 15 of 
  2433. the R:base 5000 Manual.  Also note that some of the methods discussed in 
  2434. this article require some knowledge of programming concepts.
  2435.  
  2436. There are several methods in current use that will print "multiple across" 
  2437. (two-up, three-up, or four-up) labels.  Each of them has its own unique 
  2438. advantages and disadvantages.  This article is about four of these methods.  
  2439. Pick the one that is best for your particular needs.
  2440.  
  2441. Each one of these methods will also help you to learn how to write R:base 
  2442. 5000 programs.  Even if you are not printing labels you may want to examine 
  2443. these methods for the examples of R:base programming that they provide.   
  2444.  
  2445. The four methods (SIMPLE LOOKUP, CONTROL TABLE, LABLES.MAC, and PRINT 
  2446. TABLE) are described below.  All but the last method can only be done with 
  2447. R:base 5000.  The last method works in either R:base 4000 (version 1.1 or 
  2448. higher) or R:base 5000.  
  2449.  
  2450. The first two of the methods (SIMPLE LOOKUP AND CONTROL TABLE) are more 
  2451. completely detailed in other articles in this BBS EDITORIAL.   
  2452.  
  2453. 1.  The SIMPLE LOOKUP Method
  2454. ----------------------------
  2455. This method is detailed with step-by-step instructions in the article, 
  2456. "Multi-Up Labels: Simple Lookup Method" in this BBS EDITORIAL.  Basically, 
  2457. it uses simple programming and the report writer.  This method does not 
  2458. require that you create a temporary table.  Instead it does lookups on its 
  2459. own base table using the report writer. 
  2460.  
  2461. Because no projecting or packing is necessary, it may be faster than the 
  2462. other methods.  However, you will need to test it out with your database.  
  2463. Since it prints a separate report for every line of labels (using different 
  2464. where clauses), it can be time consuming.   It has to constantly load the 
  2465. report writer code into memory and then look for the report. 
  2466.  
  2467. 2.  CONTROL TABLE Method
  2468. ------------------------
  2469. This method is detailed with step-by-step instructions in the article, 
  2470. "Multi-Up Labels: Control Table Method" in this issue of the BBS EDITORIAL.  
  2471. It uses the report writer, a small (single column) projected table (that is 
  2472. used to "control" the process), and simple programming (to number the rows 
  2473. and project the control table).  
  2474.  
  2475. This method requires a small temporary table which will have to be removed 
  2476. at the end of the process.  It can be quite fast and it is simple to use 
  2477. once the report has been set up.
  2478.  
  2479. 3.  LABELS.MAC Method
  2480. ---------------------
  2481. You will find the LABELS.MAC program on your R:base RBEDIT... utility disk.  
  2482. It is well documented with multiple comments and it is a real R:base 5000 
  2483. program.  If you are not a programmer, you may have difficulty 
  2484. understanding it.
  2485.  
  2486. LABELS.MAC uses programming and variables exclusively.  This method does 
  2487. not use the report writer and does not require a temporary table.  It can 
  2488. be slower than the other methods unless you send output to a file, run it 
  2489. overnight, and then print the labels in the morning using the DOS PRINT 
  2490. command on the file.  
  2491.  
  2492. Its advantages include the ability to go wider than 131 characters (you can 
  2493. go as wide as 256).  See the article, "Programming Tips" in this BBS 
  2494. EDITORIAL for information on a program named NOBLANKS.LAB (a modified 
  2495. version of LABELS.MAC) that removes blank lines when there is no company or 
  2496. second address line.
  2497.  
  2498. LABELS.MAC provides examples of all of the following programming methods:
  2499.  
  2500. o  Passing parameters to an R:base program
  2501. o  Using IF blocks to do error trapping 
  2502. o  Using the SET POINTER command, its error variable (named FOUNDROW),  a 
  2503.    WHILE loop, and the NEXT command to go row by row through your data in 
  2504.    your R:base table and load the values of the columns into variables
  2505. o  Working with variables in combination with the SET and SHOW commands
  2506. o  Using the MOVE command
  2507.  
  2508. LABELS.MAC will also give you experience in modifying existing R:base code 
  2509. so that it will work with your database and your particular column names.
  2510.  
  2511. 4.  PRINT TABLE Method 
  2512. ----------------------
  2513. This method uses a long command file (PRINTTBL.LAB) that can be downloaded 
  2514. from the FILES section. 
  2515.  
  2516. The PRINT TABLE method uses the program PRINTTBL.LAB, the report writer, 
  2517. and a temporary "print" table to print the labels.  The temporary table 
  2518. used by this method is large; in fact it will take up as much room as the 
  2519. original table.  After the table is built (which can be done overnight) 
  2520. this method is very fast. After printing the labels you will need to REMOVE 
  2521. the print table and then PACK or RELOAD your database (which can take a 
  2522. while if your database is large).  
  2523.  
  2524. Essentially, this method builds another table with extra columns for each 
  2525. of the labels across.  In other words, the PRINT table for three-up labels 
  2526. there would have the following columns in it:
  2527.  
  2528. NAME1
  2529. NAME2
  2530. NAME3
  2531. COMPANY1
  2532. COMPANY2
  2533. COMPANY3
  2534.  
  2535. and so on.  After loading the print table the report prints very fast 
  2536. because no lookups are required at all.  You simply locate each of the 
  2537. print table columns in your report and your labels are printed with 
  2538. lightning speed.  Another advantage to the PRINT TABLE method is that it 
  2539. can be used with either R:base 4000 (version 1.1 or higher) or R:base 5000 
  2540. (any version).  
  2541.  
  2542.  
  2543.  
  2544. *********************
  2545. MULTI-UP LABELS:  
  2546. SIMPLE LOOKUP METHOD
  2547. *********************
  2548.  
  2549. Read the article, "Multi-Up Labels" (in this EDITORIAL) before continuing.  
  2550. "Multi-Up Labels" will introduce you to four different methods for printing 
  2551. multiple across labels.  The SIMPLE LOOKUP method, presented here, is but 
  2552. one of them.
  2553.  
  2554. The SIMPLE LOOKUP method requires only simple command files and the report 
  2555. writer.
  2556.  
  2557. First, you need a column (ROWNUM) to hold the row number for every row in 
  2558. the table that holds your mailing label information (names, addresses, 
  2559. etc.).  
  2560.  
  2561. STEP 1.  Use the EXPAND command to create a column named ROWNUM with an 
  2562. INTEGER datatype.  
  2563.  
  2564. STEP 2.  Use the RENUMBER.CMD command file (listed below) to number the 
  2565. rows in the sort order you want.   Notice the ...SORTED BY ZIP clause in 
  2566. the SET POINTER... command.  By simply changing this ...SORTED BY clause 
  2567. you can number the rows in any sort order that you choose.  For example, 
  2568. you might want to change the SORTED BY... clause on the SET POINTER... 
  2569. command to ...SORTED BY DEPT ZIP if you wanted your labels to print in zip 
  2570. order by department.
  2571.  
  2572. This command file assumes that your table name is LABELS.  If your name and 
  2573. address data is in a table with a different name, you need to change the 
  2574. word LABELS in the SET POINTER... command line to the actual name of your 
  2575. table.
  2576.  
  2577. RENUMBER.CMD
  2578. ------------
  2579. SET VARIABLE CNT = 1
  2580. *(initializes the variable 
  2581.   "cnt" as the counter)
  2582. SET POINTER #3 E3 FOR +
  2583. LABELS SORTED BY ZIP
  2584. *(sets up a route through 
  2585.   the table in sorted order)
  2586. WHILE E3 = 0 THEN
  2587. *(sets up while loop. "While 
  2588.   there are rows to process")
  2589. CHANGE ROWNUM TO .CNT IN #3
  2590. *(changes the column "rownum" 
  2591.   to current value of the 
  2592.   variable "cnt")
  2593. SET VARIABLE CNT TO .CNT + 1
  2594. *(adds 1 to the counter)
  2595. NEXT #3 E3
  2596. *(Points at next record in 
  2597.   the sort order)
  2598. ENDWHILE
  2599.  
  2600. STEP 3.  Now you need to set up the report (named LABELS in this example) 
  2601. that will print a set of three across labels.  
  2602.  
  2603. To do this, you need to set up report variables which look up the second 
  2604. and third rows in the base table by using the ROWNUM column.  You are 
  2605. looking up the second and third label in the same table.  
  2606.  
  2607. Setting up the report is a simple three-step process.  First you need to 
  2608. understand how the report variables are used to look up the second and 
  2609. third across labels.  Study figure 1 and the associated comments.
  2610.  
  2611. ---------------------------------------------------------------------------
  2612. FIGURE 1 - SAMPLE REPORT VARIABLES TO "LOOK UP" THE 2ND AND 3RD LABELS
  2613. ---------------------------------------------------------------------------
  2614. rn = rownum                *(gets current rownum)
  2615. rn2 = rn + 1               *(adds 1 to current row number counter)
  2616. name2 = name in table where rownum = rn2
  2617. *(this is actually looking forward one row to the next name)
  2618. rn3 = rn + 2               *(adds 2 to current row number counter)
  2619. name3 = name in table where rownum = rn3
  2620. *(this is actually looking forward two rows in the sorted order)
  2621. ---------------------------------------------------------------------------
  2622.  
  2623. Still in (d)efine mode, you need to also look up the COMPANY, ADDR1, ADDR2, 
  2624. and CTSTZIP columns in a similar fashion.  When you are finished, the 
  2625. definition section of your report will be similar to what is listed in 
  2626. FIGURE 2 assuming your table is named LABELS, and the columns in the table 
  2627. are: NAME, COMPANY, ADDR1, ADDR2, CTSTZIP:
  2628.  
  2629. ---------------------------------------------------------------------------
  2630. FIGURE 2.  THE COMPLETE SET OF REPORT LOOKUP VARIABLES
  2631. ---------------------------------------------------------------------------
  2632. rn = rownum
  2633. rn2 = rn + 1
  2634. name2 = name in labels where rownum = rn2
  2635. company2 = company2 in labels where rownum = rn2
  2636. addr12 = addr1 in labels where rownum = rn2
  2637. addr22 = addr2 in labels where rownum = rn2
  2638. ctstzip2 = ctstzip in labels where rownum = rn2
  2639. rn3 = rn + 2
  2640. name3 = name in labels where rownum = rn3
  2641. company3 = company3 in labels where rownum = rn3
  2642. addr13 = addr1 in labels where rownum = rn3
  2643. addr23 = addr2 in labels where rownum = rn3
  2644. ctstzip3 = ctstzip in labels where rownum = rn3
  2645. ---------------------------------------------------------------------------
  2646.  
  2647. We recommend that you clear all your global variables before running this 
  2648. report in order to free up as much memory as possible.  These lookups are 
  2649. different than those done in the Control Table method.  Here, the lookups 
  2650. are done based on the value of a row number column.  In the Control Table 
  2651. method, the lookups are done based on a COUNT that the Report Writer does 
  2652. during processing.  In other words, the Report Writer counts the number of 
  2653. rows in the Control Table.
  2654.  
  2655. After defining all the variables in (d)efine mode, locate the columns (for 
  2656. the first-across label) and the variables (for the second-across and third-
  2657. across labels) in the (l)ocate mode.  When you finish, the located items 
  2658. will look like one set of three-across labels.  
  2659.  
  2660. As the last report set-up step, (m)ark 6 lines of detail in the (m)ark 
  2661. mode.
  2662.  
  2663. STEP 4.  Finally, you need a short command file to control the whole thing 
  2664. and print the report for every group of three rows in the table.  The 
  2665. command file in figure 3 will accomplish this for you.
  2666.  
  2667. ---------------------------------------------------------------------------
  2668. FIGURE 3.  
  2669. ---------------------------------------------------------------------------
  2670. SET POINTER #3 E3 FOR LABELS SORTED BY ROWNUM
  2671.  *(sets the path through the table in order of the row numbers.)
  2672. WHILE E3 = 0 THEN
  2673. SET VAR REPNUM TO ROWNUM IN #3
  2674.  *(gets the row number needed for the report)
  2675. PRINT LABELS WHERE ROWNUM = .REPNUM
  2676.  *(prints the LABELS report for each 3rd row as sorted)
  2677. NEXT #3 E3           *(increments the row pointer)
  2678. NEXT #3 E3           *(increments the row pointer)
  2679. NEXT #3 E3           *(increments the row pointer)
  2680.  *(now the row pointer is pointing at row #4 which will become 
  2681.    the first label in the next group of three for the next report)
  2682. ENDWHILE
  2683. ---------------------------------------------------------------------------
  2684.  
  2685.  
  2686.  
  2687. ********************
  2688. MULTI-UP LABELS: 
  2689. CONTROL TABLE METHOD 
  2690. ********************
  2691.  
  2692. Read the article, "Multi-Up Labels" (in this EDITORIAL) before continuing.  
  2693. "Multi-Up Labels" will introduce you to four different methods for printing 
  2694. multiple across labels.  The CONTROL TABLE method, presented here, is but 
  2695. one of them.
  2696.  
  2697. STEP 1.  Make sure that the table containing the names and addresses has a 
  2698. ROWNUM column with consecutive integer row numbers. If you do not already 
  2699. have this, see the article, "Multi-Up Labels: Simple Lookup Method" in this 
  2700. EDITORIAL for a short explanation.  If you need a more detailed 
  2701. explanation, see the article, "Auto Numbering" in the November 85 EXCHANGE.  
  2702. For fastest speed the ROWNUM column should be the first column in the table 
  2703. and it should be keyed. 
  2704.  
  2705. Be certain that the row numbers are consecutive.  The rows DO NOT have to  
  2706. be in a physically sorted order, but there must not be any gaps in the 
  2707. numbers.  In the example below, the column on the left is fine but the 
  2708. column on the right will not work because the number 2 is missing. 
  2709.  
  2710. ROWNUM     ROWNUM
  2711. ------     -------
  2712.      1           1
  2713.      3           4
  2714.      4           5
  2715.      2           3
  2716.  
  2717. If you have deleted rows since the last time you numbered your rows, you 
  2718. will want to renumber them.
  2719.  
  2720. STEP 2.  Project any single column of the address table to a new table.  It 
  2721. does not matter what column you use because it is the number of rows in the 
  2722. projected table (named CONTROL in this example) that controls the 
  2723. processing, not the value of its column.  It would be best to avoid DOLLAR 
  2724. columns and TEXT columns (longer than four  characters), because of the 
  2725. need to conserve space.  The projected table becomes a "control" table 
  2726. against which the mailing label report will be run.  It controls the number 
  2727. lines (or groups) of multi-up labels that will be printed.  
  2728.  
  2729. Compute the correct number of rows to project by using the following 
  2730. formula:
  2731.  
  2732. Divide the total number of rows in the name and address table (named LABELS 
  2733. in this example) by the number of labels you will be printing across the 
  2734. page (three in this example) and discard the remainder.  Finally add one to 
  2735. the result.  If there are 2,354 rows in LABELS, and you want to print 
  2736. three-up labels, the answer to the calculation is (2,354 / 3) + 1 or 785.
  2737.  
  2738. The project command to use in this case would be:
  2739.  
  2740. PROJECT CONTROL FROM LABELS +
  2741. USING ROWNUM WHERE LIMIT = 785  
  2742.  
  2743. You had to add one in order to make sure the last line (or group) of multi-
  2744. across labels will be printed.  It may have been truncated away by the 
  2745. division if there was a remainder after doing the division.  The number of 
  2746. rows in the CONTROL table controls the number of lines (or groups) of 
  2747. multi-up labels that will be printed.  
  2748.  
  2749. For another example, if your name and address data is in a table named 
  2750. LABELS, and the row number column is ROWNUM, the following segment of code 
  2751. will create a CONTROL table with the correct number of rows:
  2752. .
  2753. .
  2754. .
  2755. SET V UP INTEGER
  2756. SET V TOT INTEGER
  2757. WRITE "How many labels +
  2758. across?"
  2759. FILLIN UP USING +
  2760. "ENTER 3 FOR 3-UP, +
  2761. 4 FOR 4-UP, ETC."
  2762. COMPUTE NUM AS MAX +
  2763. ROWNUM FROM LABELS 
  2764. SET V TOT TO .NUM / .UP
  2765. SET V TOT TO .TOT + 1
  2766. PROJECT CONTROL FROM LABELS +
  2767. USING ROWNUM +
  2768. WHERE LIMIT = .TOT
  2769. .
  2770. .
  2771. .
  2772. The projected table CONTROL will be the base table for the MULTI-UP label 
  2773. report and the LABELS table will be the lookup table.
  2774.    
  2775. STEP 3. Using REPORTS, create a report that uses CONTROL as its base table 
  2776. and does "lookups" against the LABELS table.  The report should pull in the 
  2777. name, address, and all other information to be printed, and house that 
  2778. information in report variables.  The report will do the lookups based on a 
  2779. report variable (named RCOUNT in this example) which is incremented by one 
  2780. for each row in the CONTROL table.  The report will perform the lookup 
  2781. based on the RCOUNT variable.  RCOUNT will be used to lookup the 
  2782. appropriate ROWNUM in the LABELS table.  
  2783.  
  2784. The report creation step has 6 mini-steps:
  2785.  
  2786. o  Name the report (MULTI-UP in this example)
  2787. o  Name the table (CONTROL in this example)
  2788. o  (S)et pagesize to 0 (zero)
  2789. o  (D)efine all the lookup variables (example below)
  2790. o  (L)ocate all the lookup variables
  2791. o  (M)ark all lines as (d)etail
  2792.  
  2793. Figure 1 below is an example of what the defined block of report variables 
  2794. in the report might look like for three-up labels:
  2795.  
  2796. ---------------------------------------------------------------------------
  2797. FIGURE 1.  DEFINING THE LOOKUP VARIABLES
  2798. ---------------------------------------------------------------------------
  2799. R1COUNT      = R1COUNT + 1
  2800. V1NAME       = NAME IN LABELS WHERE ROWNUM = R1COUNT
  2801. V1ADDR1      = ADDR1 IN LABELS WHERE ROWNUM = R1COUNT                      
  2802. V1ADDR2      = ADDR2 IN LABELS WHERE ROWNUM = R1COUNT                      
  2803. V1CTSTZP     = CTSTZP IN LABELS WHERE ROWNUM = R1COUNT                     
  2804. R2COUNT      = R1COUNT + 1
  2805. V2NAME       = NAME IN LABELS WHERE ROWNUM = R2COUNT
  2806. V2ADDR1      = ADDR1 IN LABELS WHERE ROWNUM = R2COUNT                      
  2807. V2ADDR2      = ADDR2 IN LABELS WHERE ROWNUM = R2COUNT                      
  2808. V2CTSTZP     = CTSTZP IN LABELS WHERE ROWNUM = R2COUNT                     
  2809. R3COUNT      = R2COUNT + 1
  2810. V3NAME       = NAME IN LABELS WHERE ROWNUM = R3COUNT
  2811. V3ADDR1      = ADDR1 IN LABELS WHERE ROWNUM = R3COUNT                      
  2812. V3ADDR2      = ADDR2 IN LABELS WHERE ROWNUM = R3COUNT                      
  2813. V3CTSTZP     = CTSTZP IN LABELS WHERE ROWNUM = R3COUNT                     
  2814. R1COUNT      = R3COUNT
  2815. ---------------------------------------------------------------------------
  2816.  
  2817. (L)ocate the lookup variables (V1NAME, V1ADDR1, V1ADDR2, etc.) across the 
  2818. page in the appropriate groups (one group for each label).  
  2819.  
  2820. Because you are using the R:base 5000 report writer you are limited to 
  2821. label stock that is 131 character positions wide (or less).  
  2822.  
  2823. Make sure that the ROWNUM column in the LABELS table is the first column 
  2824. defined, and that it is keyed (use the BUILD KEY command to key it). 
  2825.  
  2826.  
  2827.  
  2828. ****************
  2829. PROGRAMMING TIPS
  2830. ****************
  2831. Product: R:base 5000 version 1.01 or higher
  2832.  
  2833. This article is based on 
  2834. two R:base 5000 programs 
  2835. by Mark Rasmussen
  2836. Washington, D.C.
  2837.  
  2838. Many programmers have come across the need for something analogous to
  2839. subscripted variables.  A subscripted variable, as used here, means a 
  2840. variable (such as LNCOUNT) that contains another variable name with a 
  2841. number tacked on to the end of it (such as LINE3).  
  2842.  
  2843. Creating the subscripted variables is simply a matter of concatenating a 
  2844. number onto the end of any variable name that you choose.  For example, if 
  2845. you concatenate the value of an INTEGER variable named SUBSCRPT onto the 
  2846. end of the literal word "LINE", put the result into a variable LNCOUNT, and 
  2847. then increment SUBSCRPT each time through a WHILE loop, the variable 
  2848. LNCOUNT will end up containing the following subscripted variable names:
  2849.  
  2850. LINE1, LINE2, LINE3, LINE4, etc.
  2851.  
  2852. at different times.  In other words, the first time through the WHILE loop, 
  2853. LNCOUNT equals LINE1, the second time through, LNCOUNT equals LINE2, and so 
  2854. on.  
  2855.  
  2856. All this may seem confusing until you actually study the two R:base 5000 
  2857. programs (NOBLANKS.LAB and TBL-MENU.MAC) that take advantage of this logic.  
  2858. Both of these files can be downloaded from the application area of the 
  2859. FILES section of the BBS.
  2860.  
  2861. NOBLANKS.LAB 
  2862. ------------
  2863. NOBLANKS.LAB uses subscripted variables to insure that blank lines don't 
  2864. show up in labels when, for example, ADDR2 is blank (in other words, 
  2865. contains a NULL value) or the COMPANY is blank.  The subscripted variable 
  2866. (LNCOUNT) is used to store variable names (LINE1, LINE2, ... LINE6) which 
  2867. in turn contain the lines for the labels.  
  2868.  
  2869. NOBLANKS.LAB works for one-up or multiple-up (such as three across, four 
  2870. across, etc.) labels.  It is a modified version of the LABELS.MAC program 
  2871. (which prints all the blank lines) located on your R:base 5000 RBEDIT... 
  2872. utility disk. 
  2873.  
  2874. TBL-MENU.MAC 
  2875. ------------
  2876. TBL-MENU.MAC is an example of a macro that uses subscripted variables to 
  2877. make and use a "table generated menu".  The "picks" in a table generated 
  2878. menu come from actual values in an R:base table.  In other words the values 
  2879. in the table create the menu.
  2880.  
  2881. In TBL-MENU.MAC, a subscripted variable (WHVAL) contains variable names 
  2882. (WHVAL0, WHVAL1, WHVAL2, ... WHVAL9) which in turn contain the values that 
  2883. were "picked" by the operator and are to be used in a WHERE clause (PRINT 
  2884. rptname WHERE... for example) as follows: 
  2885.  
  2886. ...WHERE DESCRPT CON .WHVAL1 OR +
  2887.          DESCRPT CON .WHVAL2 OR +
  2888.          DESCRPT CON .WHVAL3 
  2889.   
  2890. The  values in WHVAL1, WHVAL2, etc. are picked by the operator from a list 
  2891. supplied by an R:base table and are then loaded into subscripted variables 
  2892. to be used by the WHERE clause.  This makes it possible to use a constantly 
  2893. changing set of picks.  
  2894.  
  2895. You need to initialize all the WHVALn variables (where n is the subscript) 
  2896. to a value that you know is not in the table that the WHERE clause will be 
  2897. acting upon.  For example, TBL-MENU.MAC uses ZZZ as the initial value.  
  2898. Otherwise, if the operator picks less than 10 items, you will get an error.  
  2899. Or if the value does exist, rows of data will be included that the operator 
  2900. did not pick.
  2901.  
  2902. In the TBL-MENU.MAC program, the menu of choices is generated by the 
  2903. following command: 
  2904.  
  2905. EDIT KEYWORD FLAG FROM KEYLIST
  2906.  
  2907. where KEYLIST is the table that holds the menu picks.
  2908.  
  2909. To "pick" from this menu, the operator puts an X in the FLAG column next to 
  2910. the KEYWORDs desired.  The Xed KEYWORDs are then loaded into the WHVALn 
  2911. variables and used in a WHERE clause.
  2912.  
  2913. Table generated menu picks are useful in almost all types of applications 
  2914. but particularly for: 
  2915.  
  2916. o  Library, Employment Matching, Project Management, and other applications 
  2917.    that make extensive use of KEYWORD searches where you want to list the 
  2918.    keywords and have the operator choose which ones to use.  You want the 
  2919.    menu to be "table generated" because the keywords are constantly 
  2920.    changing and the operator can more easily change the values in a 
  2921.    KEYWORDS table than change an application menu.
  2922.  
  2923. o  Accounting and Financial applications where the set of accounts and
  2924.    customer numbers (that you may be picking from) change over time.
  2925.  
  2926. o  Applications where you want the operator to review a list of items that 
  2927.    are a close match and then pick the one that "wins".  For example you 
  2928.    might want to list all the names starting with JO because you are not  
  2929.    sure whether it was input as JOE, JOSEPH, JO, JOIE, JOSIE, or JOSEPHINE; 
  2930.    then when you see the list you will be able (based on other info in the 
  2931.    list) to pick the winner or winners which will then be used in the WHERE 
  2932.    clause for the actual report.
  2933.  
  2934.  
  2935.  
  2936. ***********************
  2937. MAKING R:BASE GO FASTER
  2938. ***********************
  2939.  
  2940. by Jim Browne 
  2941. Systems/Communications Manager
  2942. Diocese of Colorado Springs
  2943. Colorado Springs, CO
  2944.  
  2945. Some of you who are running R:base 5000 on the IBM PC-AT may have been 
  2946. reading about changing the speed of your PC-AT by replacing the original 
  2947. 6.0 mhz CPU crystal with a "faster" one.  This past summer, I replaced the 
  2948. original crystal in my PC-AT with one that is faster.  
  2949.  
  2950. The crystal I used is rated at about 16 mhz which, I am told, nets a new 
  2951. CPU clock speed of about 8.0 mhz.  The results were very rewarding while 
  2952. running R:base 5000.  If you check the back of just about any PC 
  2953. publication these days, you will find a variety of third party vendors now 
  2954. offering these faster crystals.  For about $130.00, one vendor now sells a 
  2955. a kind of "dial-a-speed" five speed crystal that allows the user to 
  2956. literally dial up to five different speeds from the back of the PC-AT.  The 
  2957. idea is that you push up the speed of the 80286 chip in the PC-AT until 
  2958. your software will not run.
  2959.  
  2960. The major improvement for my R:base application (a large mailing list/fund 
  2961. raising system) was noticed in execution time of WHILE loops.  Just about 
  2962. all my command files that had WHILE loops ran about 20 percent faster.  The 
  2963. total print time of reports was cut by about 15 to 20 percent.  I saw very 
  2964. little improvement, however, in command files that involved LOAD commands.  
  2965. Screen I/Os improved somewhere in the range of 10 to 15 percent.
  2966.  
  2967. As it turns out, the process of changing an PC-AT crystal is quite simple.  
  2968. The crystal I installed was obtained from Emerald Systems Corp. 4901 Morena 
  2969. Blvd., San Diego, CA 92117 - (619) 270-1994 and came complete with 
  2970. installation instructions that were very easy to follow.  The entire 
  2971. process took about 35 minutes from start to finish.
  2972.  
  2973. CAUTIONS:
  2974. --------
  2975. There are some cautions to consider.  IBM and their authorized dealers will 
  2976. tell you that the crystal swap may void your warranty.  IBM has recently 
  2977. come under some criticism for designing into the PC-AT a "socketed" crystal 
  2978. and then not allowing owners to change crystals.  They say you change the 
  2979. crystals at your own risk.  Also you cannot swap crystals on the new PC-AT 
  2980. with the 30 megabyte hard disk.
  2981.  
  2982. Like many IBM users of PC products, I am more interested in increasing the 
  2983. speed of my computer without destroying my application software than in 
  2984. warranty concerns.  As of this date, I am successfully running: 
  2985.  
  2986. o  Microrim's R:base 5000 
  2987. o  Lotus Development Corporation's Symphony 
  2988. o  Microsoft Word and
  2989. o  RoseSoft's Prokey 
  2990.  
  2991. on my PC-AT with a 60 megabyte high speed (28 ms access time) disk drive 
  2992. supplied by Emerald Systems Corporation.  I use an AST Advantage! memory 
  2993. board with Hercules Computer Technology's color graphics card and the IBM 
  2994. color monitor.  I have used Okidata 2410 Pacemark, Epson LQ1500, and FX185 
  2995. printers with the system and have experienced no problems.  
  2996.  
  2997. Most articles on this subject now say the 8.0 mhz crystal has no effect on 
  2998. software.  Crystals that run at higher speeds (20 mhz, for example) do have 
  2999. problems.  Since the crystals only cost about $10.00 to $15.00 each, you 
  3000. simply buy a few at different speeds and test them out.  If you go faster 
  3001. than 8 mhz, I strongly recommend you build a test database before you try 
  3002. it out.  An extra backup of your hard disk would also be smart before you 
  3003. "blast off".
  3004.  
  3005. OTHER CONSIDERATIONS:
  3006. --------------------
  3007. The actual improvements you will see while using a faster crystal in your 
  3008. PC-AT will depend on several factors.  We routinely print 15,000 mailing 
  3009. labels twice each month using R:base.  In an effort to improve the speed of 
  3010. this process, we were careful to invest in other specialized equipment that 
  3011. complements the faster crystal speed that the PC-AT can utilize.
  3012.  
  3013. First, consider the speed of your disk drive.  The standard PC-AT disk 
  3014. drive is rated at about 40 ms average seek time (the time needed to "lock 
  3015. on" to a record in the database)  The drives we use are about 30% faster 
  3016. than IBM's in average seek time.  The data transfer rate of our drives are 
  3017. also about 1.5 to two times faster than the standard IBM PC-AT's.  The data 
  3018. transfer rate helps improve the speed in which we can transfer files from 
  3019. memory to the hard drive.  
  3020.  
  3021. Hard drives that exceed the performance of the IBM PC-AT standard 20 
  3022. megabyte drives are available from several vendors.  We purchase our high 
  3023. speed disk drives from Emerald Systems.  Emerald, a supplier of high 
  3024. capacity (up to 240 meg) hard drives used in LANs, PCs and PC-ATs, often 
  3025. suggests the crystal swap to PC-AT users.  For you "power" users of R:base 
  3026. 5000, you might notice that all hard drives sold by Emerald also have the 
  3027. ability to exceed the 32 megabyte maximum file size that DOS is limited to.  
  3028. Try projecting a new table in R:base that causes your *2.rbs file to exceed 
  3029. 32 meg.  It will not run unless your drives can handle files larger than 32 
  3030. meg.
  3031.  
  3032. We also have improved R:base efficiency by printing our large reports (like 
  3033. the mailing label report) to a disk file.  We never print these long 
  3034. reports to the printer.  Our 15,000 cheshire mailing labels (printed four 
  3035. across) take about four hours even with our equipment. We print these to a 
  3036. disk file at night and use the DOS PRINT command to run the labels the next 
  3037. day.  The DOS PRINT command allows us to print the labels in background 
  3038. mode while we access R5K simultaneously from the same PC-AT.
  3039.  
  3040. Finally, be sure you have set up the correct CONFIG.SYS file for your PC.  
  3041. If you have forgotten to include the Buffers=20 command in the CONFIG.SYS 
  3042. file (like I did!), do so immediately.  The improved speed is dramatic.
  3043. Try altering the number of buffers until you achieve the best performance.
  3044.  
  3045.  
  3046.  
  3047. ***********************
  3048. REAL NUMBERS IN REPORTS
  3049. ***********************
  3050. Product: R:base 5000 version 1.01
  3051.  
  3052. Page 11-55 of the R:base 5000 version 1.01 manual explains how to align the 
  3053. decimal points of real numbers in REPORTS by specifying the position of the 
  3054. decimal point in (E)dit mode.  The bottom of page 11-55 explains that 
  3055. R:base will attempt to format your REALs the way you want them, but if the 
  3056. number is too large (scientific notation format) or if the accuracy of the 
  3057. number is compromised, it reverts to the original real number format.
  3058.  
  3059. Review page 11-55 and then take a look at the table in figure 1 which shows 
  3060. you exactly what all this means in terms of your numbers and how they are 
  3061. going to look.
  3062.  
  3063. ----------------------------------------------------------------
  3064. Figure 1. Aligned Real Numbers
  3065. ----------------------------------------------------------------
  3066.     A.         B.        C.         D.         E.         F.    
  3067.     UNALIGNED  R:BASE'S  ALIGNED    ALIGNED    ALIGNED    ALIGNED
  3068.     ACTUAL     ORIGINAL  W/DECIMAL  W/DECIMAL  W/DECIMAL  W/DECIMAL    
  3069.     REAL NUM   REAL NUM  IN SECOND  IN THIRD   IN FOURTH  IN FIFTH   
  3070.     DESIRED    FORMAT    POSITION   POSITION   POSITION   POSITION   
  3071.     ---------- --------- ---------- ---------- ---------- ---------- 
  3072.  1) 0.123467     0.12347        0.1       0.12      0.123     0.1235
  3073.  2) 1.234567     1.23457        1.2       1.23      1.235     1.2346
  3074.  3) 12.34567     12.3457       12.3      12.35     12.346    12.3457 
  3075.  4) 123.4567     123.457      123.5     123.46    123.457    123.457 
  3076.  5) 1234.567     1234.57     1234.6    1234.57    1234.57    1234.57 
  3077.  6) 12345.67     12345.7    12345.7    12345.7    12345.7    12345.7 
  3078.  7) 123456.7     123457.    123457.    123457.    123457.    123457. 
  3079.  8) 1234567    .123457E7  .123457E7  .123457E7  .123457E7  .123457E7
  3080.  9) -.1234567   -0.12346       -0.1      -0.12     -0.123    -0.1235
  3081. 10) -1234567  -.123457E7 -.123457E7 -.123457E7 -.123457E7 -.123457E7
  3082. 11) -123.4567   -123.457     -123.5    -123.46   -123.457   -123.457 
  3083. 12) 123.000      123.000      123.0     123.00    123.000    123.000 
  3084. 13) 000.123      0.12300        0.1       0.12      0.123     0.1230
  3085. ----------------------------------------------------------------
  3086. First, look at lines 8 and 10.  These two numbers have over six digits to 
  3087. the left of the decimal point and so they are converted to scientific 
  3088. notation when put into R:base real number format.  Attempts to align them 
  3089. in columns C, D, E, and F fail because they are in scientific notation.
  3090.  
  3091. Next, look at column F in the table. Although lines 4, 5, 6, 7, 11, and 12 
  3092. have decimal points that appear to be in the wrong place, this is not a 
  3093. bug.  It was necessary in these cases to revert to the original format in 
  3094. order to show the true value of the number.  You can see that column F 
  3095. matches column B (the original format) in each of these cases.  The same 
  3096. thing has happened in all the other cases where the decimal point appears 
  3097. to be in the wrong place.
  3098.  
  3099. You can predict when this will happen by applying the following general 
  3100. guidelines:
  3101.  
  3102. 1. The largest location size in REPORTS for REAL numbers is ten positions.
  3103. 2. Of the ten, six of the positions are for the real number significant 
  3104.    digits and one is for the decimal point.
  3105. 3. The other three positions are only used by scientific notation and/or 
  3106.    the minus sign.
  3107. 4. If there are more than six significant digits to the left of the decimal 
  3108.    point, then the real number is converted to scientific notation.
  3109. 5. Finally, if there are less than six digits to the left of the decimal 
  3110.    point, compute the total number of significant digits.  In other words,  
  3111.    add the number of significant digits that are on the left of the decimal 
  3112.    point to the number of significant digits on the right.  If the result 
  3113.    is six or higher, all the significant digits to the left will be 
  3114.    printed, followed by the decimal point, and then the digits to the right 
  3115.    are rounded to fit in the remaining space.  This rule overrides any 
  3116.    decimal point alignment you  have defined in REPORTS.  This is why it 
  3117.    appears that the decimal points are not aligning the way you want them.  
  3118.  
  3119. For examples of this last guideline in action, look at the following REAL 
  3120. numbers in figure 1:
  3121.  
  3122. COLUMN C - LINE 7
  3123. COLUMN D - LINES 6 AND 7 
  3124. COLUMN E - LINES 5, 6, AND 7
  3125. COLUMN F - LINES 4, 5, 6, 7, 11, AND 12
  3126.  
  3127. If you are having trouble aligning your decimal points because of this last 
  3128. guideline, but you ARE able to print without converting to scientific 
  3129. notation, then you may want to read, "Aligning Decimal Points in a Report", 
  3130. in the September 1985 EXCHANGE.  The concepts in the September article 
  3131. should work even if you are on the "outer limits" because it converts the 
  3132. REAL number to a TEXT datatype before printing it.
  3133.  
  3134.  
  3135.  
  3136. ********
  3137. HOT TIPS
  3138. ********
  3139.  
  3140. Here are solutions and explanations for some common problems.
  3141.  
  3142.  
  3143.  
  3144. ===========================================================================
  3145. R:BASE COMPATIBILITY
  3146. ===========================================================================
  3147. Product: R:base 5000
  3148.          all versions
  3149.  
  3150.  
  3151. DESCRIPTION:  How can I tell whether R:base 5000 will run on my IBM 
  3152. compatible computer.  It is not 100%, but close to it.  What are some 
  3153. tests?
  3154.  
  3155.  
  3156. SOLUTION:  We are not able to guarantee that if your compatible passes 
  3157. these tests, you will never have problems; however, the chances are good.  
  3158. Tests include:
  3159.  
  3160. o  You are able to bring R:base 5000 up on your computer and everything 
  3161.    looks normal
  3162. o  Color works
  3163. o  The F1 key adds a line and the F2 key deletes a line in RBEDIT
  3164. o  The F3 and F10 keys work as expected in EXPRESS
  3165. o  The R:base 5000 tutorial works on your computer
  3166. o  For R:base 5000 Multi-User, the evaluation copy works on your computer 
  3167.    and LAN system
  3168.  
  3169.  
  3170.  
  3171. ===========================================================================
  3172. FORMS AND REPORTS
  3173. ===========================================================================
  3174. Product: R:base 5000
  3175.          all versions
  3176.  
  3177.  
  3178. DESCRIPTION:  I removed a column from a table and now I cannot get into my 
  3179. data entry forms for this table.  I realize that the LAYOUT is incorrect, 
  3180. but FORMS refuses to bring up my form so that I can correct it.  What do I 
  3181. do?
  3182.  
  3183.  
  3184. EXPLANATION:  Although the column no longer exists, it is still located in 
  3185. the form.  You need to remove the location of the column from your form by 
  3186. using the EDIT command.
  3187.  
  3188.  
  3189. SOLUTION:  Replacing "formname" with the actual name of your form, enter 
  3190. the following command at an R> prompt: 
  3191.  
  3192. EDIT ALL FROM FORMS +
  3193. WHERE FNAME = formname  
  3194.  
  3195. Press the down arrow key until you find the word LAYOUT in the second 
  3196. column (FDATA) on your screen.  
  3197.  
  3198. Next, continue to slowly tap the down arrow key until you see the name of 
  3199. the deleted column in the second column (under the word LAYOUT).  When your 
  3200. cursor is on that row (highlighting one of the columns), press the F2 key 
  3201. followed by the [ENTER] key to delete the row.  Finally, escape from the 
  3202. EDIT and your form will now work because the location of the column that no 
  3203. longer exists has been removed.  In other words, the LAYOUT has been 
  3204. corrected.
  3205.  
  3206. This same general method will also correct your REPORTS that have this same 
  3207. deleted column located in them.  In the case of REPORTS, the command to use 
  3208. is:
  3209.  
  3210. EDIT ALL FROM REPORTS +
  3211. WHERE RNAME = rptname
  3212.  
  3213. If you have renamed a column and that column is located in FORMS or in 
  3214. REPORTS you can correct the LAYOUT section in your forms and reports by 
  3215. using the EDIT ALL FROM... command.  In this case, however, you will NOT 
  3216. want to delete the applicable row.  Instead, type over the "old" name with 
  3217. the "new" name and then press [Esc].
  3218.  
  3219.  
  3220.  
  3221. ===========================================================================
  3222. RINGING THE BELL
  3223. ===========================================================================
  3224. Product: R:base 5000 
  3225.          all versions
  3226.  
  3227.  
  3228. DESCRIPTION:  I want to ring the bell and print my own error message on the 
  3229. screen based on my own error trapping routines.
  3230.  
  3231.  
  3232. SOLUTION:  Put the following block of code in your program when you want 
  3233. the bell to ring:
  3234. .
  3235. .
  3236. .
  3237. SET BELL ON
  3238. SET ERROR MESSAGE ON
  3239. OUTPUT TEMP.DAT2
  3240. RING MY CHIMES!
  3241. SET ERROR MESSAGE OFF
  3242. OUTPUT SCREEN 
  3243. WRITE "This is my error msg"
  3244. PAUSE
  3245. .
  3246. .
  3247. .
  3248. Since RING is not an R:base command, the bell will sound and the error 
  3249. message will go into the file where the operator will not see it.  The 
  3250. WRITE command will now print your error message on the screen.
  3251.  
  3252.  
  3253.  
  3254. ===========================================================================
  3255. ADDING LEADING ZEROS
  3256. ===========================================================================
  3257. Product: R:base 5000 all versions
  3258.  
  3259.  
  3260. DESCRIPTION:  I have a part number column that is defined as INTEGER, I 
  3261. changed it to TEXT using the CHANGE COLUMN... command and now all the 
  3262. numbers do not sort properly.
  3263.  
  3264.  
  3265. EXPLANATION:  TEXT type columns are sorted from left to right.  This is not 
  3266. a bug; it is the way computers work with TEXT values.  TEXT values are 
  3267. sorted as indicated below.  Notice that both the numbers and the letters 
  3268. sort left to right. 
  3269.  
  3270. 2        B
  3271. 200      BEE
  3272. 3        C
  3273. 37       CI
  3274. 374      CID
  3275. 38       CH
  3276.  
  3277. Therefore, to solve your problem, all you need to do is put in leading 
  3278. zeros.  With leading zeros the above numbers will sort as follows:
  3279.  
  3280. 002
  3281. 003
  3282. 037
  3283. 038
  3284. 200
  3285. 374
  3286.  
  3287.  
  3288. SOLUTION:  To get your text values to sort the way you want them to, you 
  3289. need to put in leading zeros so that the "ones", "tens", "hundreds", etc. 
  3290. columns all line up. 
  3291.  
  3292. In this example:
  3293.  
  3294. o  The table is named PARTS.
  3295. o  The original INTEGER column (that you changed to TEXT) is named PNUM.  
  3296. o  The new TEXT column (which will hold the new part number with the 
  3297.    leading zeros) is named PART# 
  3298. o  The largest integer part number in the table is four characters long 
  3299.    which means no more than three leading zeros are required.
  3300.  
  3301. Use the following code to change PNUM back to INTEGER and to create the new 
  3302. PART# column:
  3303.  
  3304. *(first change PNUM back
  3305.   to integer)
  3306. CHANGE COL PNUM IN PARTS +
  3307.   TO INTEGER
  3308.  
  3309. *(next EXPAND the table  
  3310.   to include a new TEXT 
  3311.   column that will hold
  3312.   the TEXT part number
  3313.   with leading zeros) 
  3314. EXPAND PARTS WITH PART# +
  3315.   TEXT 4
  3316.  
  3317. Now, use the following macro to put leading zeros into the PART# column:
  3318.  
  3319. *(now set up the WHILE loop)
  3320. SET V RESULT TEXT
  3321. SET POINTER #3 E3 FOR PARTS
  3322. WHILE E3 = 0 THEN
  3323. SET V VPNUM TO PNUM IN #3
  3324.  
  3325. *(add 3 leading zeros)
  3326. IF VPNUM GE 0 AND +
  3327. VPNUM LE 9 THEN
  3328. SET V RESULT TO 000 + .VPNUM 
  3329. ENDIF
  3330.  
  3331. *(add 2 leading zeros)
  3332. IF VPNUM GE 10 AND +
  3333. VPNUM LE 99 THEN
  3334. SET V RESULT TO 00 + .VPNUM 
  3335. ENDIF
  3336.  
  3337. *(add 1 leading zeros)
  3338. IF VPNUM GE 100 AND +
  3339. VPNUM LE 999 THEN
  3340. SET V RESULT TO 0 + .VPNUM 
  3341. ENDIF
  3342.  
  3343. *(load RESULT into PART#)
  3344. CHANGE PART# TO .RESULT IN #3
  3345.  
  3346. NEXT #3 E3
  3347. ENDWHILE
  3348.  
  3349.  
  3350.  
  3351. ===========================================================================
  3352. RULES
  3353. ===========================================================================
  3354. Product: R:base 4000, 5000, 6000
  3355.          all versions
  3356.  
  3357.  
  3358. DESCRIPTION:  My rules do not check the column values in the same order as 
  3359. they are entered.  What is wrong?
  3360.  
  3361.  
  3362. EXPLANATION: Rules are checked in the order the rules appear in the rules 
  3363. table, not in the order the column values are entered.  If there are two or 
  3364. more mistakes in the data on a table form (which violate rules) the first 
  3365. message displayed will be that of the first rule, rather than the first 
  3366. piece of data entered.
  3367.  
  3368.  
  3369. SOLUTION:  Using the EDIT ALL... command, change the numbers of the rules 
  3370. into the order you want the rules to be checked.  For R:base 4000 and 6000 
  3371. the command to use is EDIT ALL FROM RBSRULES.  For R:base 5000, use EDIT 
  3372. ALL FROM RULES.
  3373.  
  3374. Next, unload the rules data into a file (replace "ruletbl" with RULES if 
  3375. using R:base 5000, otherwise use RBSRULES):
  3376.  
  3377. OUTPUT TEMP.DAT
  3378. UNLOAD ALL FOR ruletbl +
  3379. SORTED BY NUMRULE
  3380. OUTPUT TERMINAL
  3381.  
  3382. Finally, delete the old rules table (RBSRULES or RULES) and create the new 
  3383. one: 
  3384.  
  3385. REMOVE ruletbl
  3386. INPUT TEMP.DAT
  3387.  
  3388.  
  3389.  
  3390. ===========================================================================
  3391. BLANKING OUT A SCREEN LINE
  3392. ===========================================================================
  3393. Product: R:base 5000 
  3394.          all versions
  3395.  
  3396.  
  3397. DESCRIPTION:  In R:base 4000 I could set a variable to a blank (alt 255) 
  3398. and then SHOW this variable to blank out an entire line on the screen.  
  3399. This does not work in R:base 5000; only one character is blanked out.
  3400.  
  3401. SOLUTION: Use the WRITE command to write a blank line to the screen, for 
  3402. example, 
  3403.  
  3404. WRITE "              " AT 23 1
  3405.  
  3406. If you were going to blank out an entire line you would include 80 blanks 
  3407. between the quotes by using the plus sign to continue the blanks on the 
  3408. next line.  R:base is smart enough not to include the plus sign as a 
  3409. literal character in the line.  For example, the following would cause line 
  3410. 15 to be completely blanked out:
  3411.  
  3412. *(20 blanks per line on four
  3413.   lines = 80 blanks total)
  3414. WRITE "                    +
  3415.                     +
  3416.                     + 
  3417.                     " AT 15 1
  3418.  
  3419. Additionally, there is a macro available that will blank out an entire 
  3420. segment (or block) of the screen.  You can download the BLANK.OUT file from 
  3421. the FILES section, application area.  Download the file named MESS to 
  3422. see BLANK.OUT in action.  MESS is a file with all the positions filled with 
  3423. letters.  To see a blank section appear in the file, issue the following 
  3424. series of commands:
  3425.  
  3426. NEWPAGE
  3427. TYPE MESS
  3428. RUN BLANK.OUT 5 20 4 30
  3429.  
  3430.  
  3431.  
  3432. ****************
  3433. ACKNOWLEDGEMENTS
  3434. ****************
  3435.  
  3436. The following Microrim employees contributed programs, concepts, and/or 
  3437. articles for this EDITORIAL:
  3438.  
  3439. MariEsther Burnham
  3440. Kelly Cline
  3441. Kay Dayss
  3442. Marianne Jaeger
  3443. Mike Johnson
  3444. Paul Scheiner
  3445. Liz Shattuck
  3446. Richard Traband
  3447. Mario Valverde
  3448.  
  3449.  
  3450. TECHNICAL SUPPORT
  3451. We provide a wide variety of technical support alternatives:
  3452.  
  3453. o  Direct line to technical support: (206) 641-7386.  
  3454. o  Toll-free hotline available to all continental U.S. Software Maintenance 
  3455.    Plan (SMP) subscribers outside Washington state.  The toll-free hotline 
  3456.    is a direct line to our senior technical support staff. 
  3457. o  Electronic Bulletin Board (BBS): (206) 643-8545.
  3458. o  R:base EXCHANGE technical newsletter.  Free to SMP subscribers and 
  3459.    available by subscription to others (see coupon at the back of this 
  3460.    issue).
  3461. o  We also have special support programs for Consultants, Application 
  3462.    Developers, Value Added Resellers (VARs) and Dealers.  To get 
  3463.    information on how you can be a part of these programs, call (206) 641-
  3464.    6619 and ask for the INFO center.  We will send you an entire package of 
  3465.    information. 
  3466.  
  3467.  
  3468. TRADEMARK
  3469. R:BASE SERIES is a trademark of Microrim, Inc.
  3470. Application EXPRESS is a trademark of Microrim, Inc.
  3471. FileGateway is a trademark of Microrim, Inc.
  3472. CLOUT is a trademark of Microrim, Inc.
  3473. XRW is a trademark of Microrim, Inc.
  3474. IBM is a registered trademark of International Business Machines Corp.
  3475. XT and AT are trademarks of International Business Machines Corp.
  3476. EPSON is a registered trademark of Epson America, Inc.
  3477. LQ1500 is a trademark of Epson America, Inc.
  3478. FX185 is a trademark of Epson America, Inc.
  3479. Microsoft is a registered trademark of Microsoft Corporation
  3480. Microsoft Word is a trademark of Microsoft Corporation
  3481. Symphony is a trademark of Lotus Development Corporation
  3482. Advantage! is a trademark of AST Research, Inc.
  3483. Okidata is a trademark of Okidata Corporation
  3484. EMERALD is a trademark of Emerald Systems Corporation
  3485. Prokey is a trademark of RoseSoft, Inc.
  3486. Hercules Computer Technology is a trademark of Hercules Computer Technology
  3487.  
  3488.  
  3489. DISCLAIMER
  3490. Microrim, Inc., makes no representation or warranties with respect to the 
  3491. contents hereof, and specifically disclaims any implied warranties of 
  3492. merchantability or fitness for any particular purpose.  Further, Microrim, 
  3493. Inc., reserves the right to revise this publication and to make changes in 
  3494. the content hereof without obligation to notify any person of such revision 
  3495. or change and shall not be liable for errors contained herein or for 
  3496. incidental or consequential damages in connection with the furnishing, 
  3497. performance, or use of this material.
  3498.  
  3499.  
  3500. tech notes 9
  3501. ********************
  3502. *  VARIABLE FORMS  *
  3503. ********************
  3504.  
  3505. In response to your requests for further information on variable forms, we 
  3506. are including the following five articles in this section:
  3507.  
  3508. o  Why or When to Use Varforms
  3509. o  Varform Basics & Two-Page Forms
  3510. o  Putting "Display Only" Info on a Varform
  3511. o  Using Rules With Varforms
  3512. o  Loading Several Rows From One Varform
  3513.  
  3514.  
  3515.  
  3516. ***************************
  3517. WHY OR WHEN TO USE VARFORMS
  3518. ***************************
  3519. Product: R:base 5000 all ver
  3520.  
  3521. There are a number of reasons to use variable forms instead of tableforms 
  3522. including: 
  3523.  
  3524. o  For multi-page forms.
  3525. o  To load data, entered on one form, into more than one table.
  3526. o  To load data, entered on one form, into more than one row of a table. 
  3527. o  When you want to display some data on a data entry screen (form) that 
  3528.    cannot be edited.
  3529. o  When lookups are desired.  In other words, you want the operator to 
  3530.    enter the Customer's number and have R:base lookup and display the 
  3531.    Customer's name.
  3532. o  When calculations are needed on what the operator has entered before 
  3533.    the data is loaded into the table.
  3534. o  Anytime you want to load information directly into variables and you do 
  3535.    not want to use a whole series of FILLIN command lines.
  3536.  
  3537.  
  3538.  
  3539.  
  3540. *******************************
  3541. VARFORM BASICS & TWO-PAGE FORMS
  3542. *******************************
  3543. Product: R:base R:base 5000 all ver
  3544.          
  3545.  
  3546. BASIC DATA ENTRY WITH A VARFORM:
  3547. -------------------------------
  3548. The code for a basic variable form (with three variables VAR1, VAR2, and 
  3549. VAR3) being loaded to a three column (COL1, COL2, and COL3) table is listed 
  3550. below.  Note that it is assumed you have defined the variable form (VFORM 
  3551. in this example) using the FORMS command prior to running this code.
  3552.  
  3553. LABEL ENTFORM
  3554.   SET NULL " "
  3555.   NEWPAGE
  3556.   WRITE "Press [ESC] to add this +
  3557.   row or [PGDN] to quit" AT 1 1
  3558.   DRAW VFORM 
  3559.   EDIT VAR RETURN ESC PGDN
  3560.   IF #RETURN = ESC THEN 
  3561.     GOTO LOADBLK 
  3562.   ENDIF
  3563.   IF #RETURN = PGDN THEN  
  3564.     QUIT
  3565.   ENDIF
  3566.  
  3567. LABEL LOADBLK 
  3568.   SET NULL -0-
  3569.   LOAD tblname
  3570.     .VAR1  .VAR2  .VAR3
  3571.   END
  3572.  
  3573. CLEAR VAR1 
  3574. CLEAR VAR2
  3575. CLEAR VAR3 
  3576. GOTO ENTFORM
  3577.  
  3578. Notice that there are threee basic blocks of code.
  3579.  
  3580. o  The first block accomplishes data entry (with the DRAW and EDIT VAR 
  3581.    commands and then passes control based on the RETURN key (ESC or PGDN) 
  3582.    that the operator chooses.  NULL is set to a blank so the operator will 
  3583.    not see the -0- on the screen for the NULL variables.
  3584. o  The load block is the block that actually loads the values stored in the 
  3585.    variables into the form.  Until this block is executed, no data that the 
  3586.    operator entered is saved.  NULL must be set to -0- for the LOAD to work 
  3587.    correctly.  If it is set to a blank, you may get a kind of blank (ALT 
  3588.    255) entered into your table when you wanted a NULL.  
  3589. o  The final block clears the variables and goes back to the top for the 
  3590.    next form.
  3591.  
  3592.  
  3593. BASIC EDITING OF EXISTING DATA:
  3594. ------------------------------
  3595. It is also possible to edit existing data using a variable form.  First, 
  3596. use the SET POINTER command to point at the row you want to edit.  Next, 
  3597. use the SET VAR command to pull the data (from the columns in the row you 
  3598. are pointing at) into variables.  Next, edit the variables with the DRAW 
  3599. and EDIT VAR commands. Finally, write the new values back to the table with 
  3600. the CHANGE command.  For example:
  3601.  
  3602. LABEL TOP
  3603. FILLIN VID USING "Enter the ID +
  3604. number for the record you want +
  3605. to edit or Q to quit: " at 1 1
  3606. IF VID NE Q THEN
  3607.   SET POINTER #3 E3 FOR tblname +
  3608.   WHERE ID EQ .VID
  3609.   SET VAR VAR1 TO COL1 IN #3
  3610.   SET VAR VAR2 TO COL2 IN #3
  3611.   SET VAR VAR3 TO COL3 IN #3
  3612.  
  3613.   NEWPAGE
  3614.   WRITE "Press [ESC] to make +
  3615.   changes or press [PGDN] to +
  3616.   bail out" AT 1 1
  3617.  
  3618.   DRAW VFORM WITH ALL
  3619.   EDIT VAR RETURN ESC PGDN
  3620.     IF #RETURN = ESC THEN 
  3621.       GOTO LOADBLK 
  3622.     ENDIF
  3623.     IF #RETURN = PGDN THEN      
  3624.       QUIT  
  3625.     ENDIF
  3626.  
  3627.   LABEL LOADBLK 
  3628.     SET NULL -0-
  3629.     CHANGE COL1 TO .VAR1 IN #3
  3630.     CHANGE COL2 TO .VAR2 IN #3
  3631.     CHANGE COL3 TO .VAR3 IN #3
  3632.  
  3633.   CLEAR VAR1 
  3634.   CLEAR VAR2
  3635.   CLEAR VAR3 
  3636. ENDIF
  3637.  
  3638. IF VID = Q THEN
  3639.   QUIT
  3640. ELSE
  3641.   GOTO TOP
  3642. ENDIF
  3643.   
  3644.  
  3645. ENTERING TWO-PAGE VARFORMS:
  3646. --------------------------
  3647. Variable forms are also easily demonstrated using multiple page form 
  3648. emulation as an example.  There is a command file in the R:base 5000 manual 
  3649. on pages 15-44 and 15-45 giving one example of how to do multiple page form 
  3650. emulation with variable forms.
  3651.  
  3652. The macro presented here (see Figure 1 is a more basic method that does not 
  3653. require keeping track of page numbers.  Before running the macro you need 
  3654. to use the FORMS command to create the two variable forms FORM1 and FORM2.  
  3655. Note that in this example, no data is loaded into the table, until form2 
  3656. has been entered.  If the operator presses [Esc] after entering information 
  3657. into form1, the form1 information will not be loaded.  This prevents a 
  3658. partial record from being loaded.
  3659.  
  3660. ===========================================================================
  3661. Figure 1. BASIC TWO-PAGE DATA ENTRY WITH VARIABLE FORMS
  3662. ===========================================================================
  3663.  
  3664. LABEL FORM1
  3665.   SET NULL " "
  3666.   NEWPAGE
  3667.   WRITE "Press [PGDN] to go on to page two -- [ESC] to quit" AT 1 1
  3668.   DRAW FORM1 
  3669.   EDIT VAR RETURN ESC PGDN
  3670.     IF #RETURN = PGDN THEN ; GOTO FORM2 ; ENDIF
  3671.     IF #RETURN = ESC THEN; QUIT; ENDIF
  3672.  
  3673. LABEL FORM2
  3674.   NEWPAGE
  3675.   WRITE "Press [Esc] to add this two-page record +
  3676.   -- [PGUP] to go back to page one" AT 1 1
  3677.   DRAW FORM2 
  3678.   EDIT VAR RETURN ESC PGUP
  3679.     IF #RETURN = ESC THEN ; GOTO LOADVARS ; ENDIF
  3680.     IF #RETURN = PGUP THEN ; GOTO FORM1 ; ENDIF
  3681.   
  3682. LABEL LOADVARS
  3683.   SET NULL -0-
  3684.   *( The following three lines of code are known as the "LOAD block".  
  3685.      If you need more than one line to list the variables, you can 
  3686.      use the plus sign to continue on the next line)
  3687.   LOAD tblname
  3688.     .varname1 .varname2 .varname3 ...
  3689.   END
  3690.  
  3691. CLEAR varname1 ; CLEAR varname2 ; CLEAR varname3 ; ...
  3692. GOTO FORM1
  3693.  
  3694. ===========================================================================
  3695.  
  3696. THE LOAD BLOCK:
  3697. --------------
  3698. The LOAD block is required to load data to the table.
  3699.  
  3700. Remember that the dotted variables listed in the LOAD block are the 
  3701. variables that you located in the variable forms FORM1 and FORM2.  The 
  3702. variables must be listed (side by side on the line following the LOAD... 
  3703. command line) in the same order that their corresponding columns appear in 
  3704. the table being loaded.  Data is not actually added to your table until the 
  3705. LOAD block is executed.  
  3706.  
  3707. Therefore, the operator can go back and forth between FORM1 and FORM2 as 
  3708. many times as desired and no data will be added to the table until [ESC] is 
  3709. pressed while the second form is being displayed.
  3710.  
  3711. If you have more columns in your table than variables in your LOAD block 
  3712. you will need to use NULL place keepers.  For example, if the table had 
  3713. these columns:
  3714.  
  3715. NAME  ADDRESS  CITY STATE
  3716.  
  3717. and your variable forms were using only the following variables:
  3718.  
  3719. VNAME  VCITY
  3720.  
  3721. Your load block would look like one of the three examples presented below:
  3722.  
  3723. *(LOAD BLOCK EXAMPLE ONE)
  3724.   LOAD tblname
  3725.     .VNAME  -0-  .VCITY  -0-
  3726.   END
  3727.  
  3728. Or it could look like this:
  3729.  
  3730. *(LOAD BLOCK EXAMPLE TWO)
  3731.   LOAD tblname ; FILL
  3732.     .VNAME  -0-  .VCITY
  3733.   END
  3734.  
  3735. Example two works because the FILL command, when included on the LOAD ... 
  3736. line with the semicolon, will fill all remaining columns (that is all the 
  3737. columns after the first three) with NULLs.
  3738.  
  3739. A third type of LOAD block has a USING clause.  For example,
  3740.  
  3741. *(LOAD BLOCK EXAMPLE THREE)
  3742.   LOAD tblname USING NAME CITY
  3743.     .VNAME .VCITY
  3744.   END
  3745.  
  3746. The USING clause does not actually load the data; you must still list the 
  3747. variables to be loaded on the line below the LOAD... command line.  
  3748. However, the USING clause does allow you to specify which columns are to be 
  3749. loaded and the order to be followed in loading them.
  3750.  
  3751. Remember:
  3752.  
  3753. o  Make sure that NULL is set to -0- before executing a LOAD block
  3754. o  Specify column names in the USING clause of the LOAD... command line 
  3755. o  Specify variable names (with dots in front of each one) on the line 
  3756.    below the LOAD... command line.  Each separate line, between the LOAD... 
  3757.    line and the END line, will be loaded to a separate row in the table.  
  3758.    Usually only one row is added at one time so the LOAD block is usually 
  3759.    three lines long (LOAD..., dotted vars, and END).  For an example of a 
  3760.    LOAD block that loads more than one row, see the article, "Loading Many 
  3761.    Rows From One Form" in this Technical Edtorial.
  3762. o  Make sure that the order (left to right) in which the column names are 
  3763.    listed in the USING clause (on the top line) corresponds exactly with 
  3764.    the order (left to right) in which the dotted variables are listed on 
  3765.    the middle line. 
  3766. o  End the LOAD block with END.
  3767.  
  3768.  
  3769. THE RETURN CLAUSE:
  3770. -----------------
  3771. Using the RETURN clause in the EDIT VAR ... command line and excluding 
  3772. ENTER as an option allows the operator to use the [ENTER] key to bounce 
  3773. from place to place in the form during data entry.  If ENTER were to be 
  3774. used in the RETURN clause of the EDIT VAR..., the operator would have to 
  3775. use the arrow keys to bounce around in the form.
  3776.  
  3777. You may want to add error trapping code to the basic code in Figure 1., but 
  3778. the basic concepts will hopefully help you to better understand variable 
  3779. forms.  
  3780.  
  3781. To use variable forms for data entry in an EXPRESS application, you would 
  3782. build a macro similar to that in Figure 1. and then pull it into your 
  3783. EXPRESS application by using the MACRO action pick.
  3784.  
  3785. SUMMARY:
  3786. -------
  3787. The basic macro presented in Figure 1. demonstrates the following basics of 
  3788. variable forms:
  3789.  
  3790. o  Use NEWPAGE to clear the screen before a DRAW.  
  3791. o  Use WRITE to write a message on the first line telling the operator  
  3792.    what to do when finished with the form. 
  3793. o  Use DRAW to draw the variable form on the screen.
  3794. o  Use EDIT VAR to enter data into the form.
  3795. o  Use a RETURN clause on the EDIT VAR command to limit the possible   
  3796.    values for the #RETURN system variable.
  3797. o  Use an IF block for every #RETURN possibility.
  3798. o  Use a LOAD block to load the variable values into the table.  Be sure to 
  3799.    set NULL to -0- right before the LOAD block and list the variables in 
  3800.    the same order as the corresponding columns in the table.
  3801. o  After loading the variables clear each one individually with CLEAR 
  3802.    varname command.
  3803. o  Use the FILLIN, SET POINTER, SET VAR, DRAW, EDIT VAR, and CHANGE 
  3804.    commands to edit using a variable form.
  3805.  
  3806.  
  3807.  
  3808.  
  3809. ***************************
  3810. DISPLAY ONLY INFO ON A FORM
  3811. ***************************
  3812. Product: R:base 5000 all ver 
  3813.  
  3814.  
  3815. Before attempting this article, review the "Varform Basics & Two-Page 
  3816. Forms" article in this Technical Edtorial. 
  3817.  
  3818. By using variable forms, it is easy to display "information only" data on 
  3819. the screen in the same form being used for data entry.   For example, when 
  3820. entering invoices for CUST# 234 you may want to enter 234 and have the 
  3821. computer display the CUSTNAME, CUSTADDR, etc. to make sure 234 is the 
  3822. correct number before entering the invoices for that customer.  The 
  3823. computer can lookup the customer information to display it on the screen.  
  3824.  
  3825. PROCEDURE:
  3826. ---------
  3827. o  Get the CUST# from the operator with a variable form or with the FILLIN 
  3828.    command.
  3829. o  Using the SET VAR command lookup the values you need to display.  
  3830. o  DRAW the form WITH ALL to show the values of all the variables.  The 
  3831.    ones you just looked up will be displayed.  The ones to be entered will 
  3832.    be blank.
  3833. o  Now use the EDIT VAR command and list the names of the variables in the 
  3834.    form that are to be entered.
  3835.  
  3836.  
  3837. EXAMPLE:
  3838. -------
  3839. The following example code assumes that you have previously set up a 
  3840. variable form FORM1 with the variables VLOOK1, VLOOK2, VINV#, VINVAMT, and 
  3841. VCUST# located in it.  It is also assumed that you have two tables, CUST 
  3842. (with columns CUST#, CUSTNAME, and CUSTADDR) and INVOICE (with columns 
  3843. CUST#, INV#, and INVAMT).  
  3844.  
  3845. .
  3846. .
  3847. .
  3848. LABEL LOOKUPS 
  3849.   CLEAR VAR VCUST#
  3850.   NEWPAGE
  3851.   FILLIN VCUST# USING +
  3852.   "Customer Number: " AT 1 1
  3853.   SET VAR VLOOK1 TO CUSTNAME +
  3854.   IN CUST WHERE CUST# = .VCUST# 
  3855.   SET VAR VLOOK2 TO CUSTADDR IN +
  3856.   CUST WHERE CUST# = .VCUST#
  3857.   WRITE "Press [Esc] to add this +
  3858.   invoice, [PgDn] for new +
  3859.   customer number, or [PgUp] to +
  3860.   quit" AT 2 1
  3861.  
  3862. LABEL INVOICES
  3863.   NEWPAGE
  3864.   DRAW FORM1 WITH ALL AT 3
  3865.   EDIT VAR VINV# VINVAMT +
  3866.   RETURN ESC PGUP PGDN
  3867.   IF #RETURN = ESC THEN
  3868.     SET NULL -0-
  3869.     LOAD INVOICE
  3870.     .VCUST#  .VINV#  .VINVAMT
  3871.     END
  3872.     SET NULL " "
  3873.     CLEAR VINV# ; CLEAR VINVAMT
  3874.     GOTO INVOICES
  3875.   ENDIF
  3876.   IF #RETURN = PGDN THEN
  3877.     GOTO LOOKUPS
  3878.   ENDIF
  3879.   IF #RETURN = PGUP THEN
  3880.     NEWPAGE
  3881.     QUIT
  3882.   ENDIF
  3883. .
  3884. .
  3885. .
  3886.  
  3887.  
  3888.  
  3889.  
  3890. *************************
  3891. USING RULES WITH VARFORMS
  3892. *************************
  3893. Product: R:base 5000 all ver
  3894.  
  3895. Before attempting this article, review the "Varform Basics & Two-Page 
  3896. Forms" article in this Technical Edtorial. 
  3897.  
  3898. It is possible to use rules with variable forms.  Basically, this method 
  3899. uses the following trick shots to make rules work with variable forms:
  3900.  
  3901. o  Draw the variable form at line three (or further down) on the screen to 
  3902.    enable the error message from the rule to be displayed at the top of the 
  3903.    screen and the instructions to the operator to be written on line two 
  3904.    with the WRITE command.
  3905. o  Use the command CHECK (with a semicolon in front of it) on the "LOAD 
  3906.    tblname" line in the LOAD block to turn rules on.
  3907.  
  3908. The complete method is outlined in Figure 2.  The method presented will 
  3909. work with single-page forms.  If you are using multiple-page forms you will 
  3910. need to revise the method.  The easiest way would be to load each page to a 
  3911. different temporary data entry table (TEMP1 and TEMP2) and repeat the 
  3912. unique identifying variable/column (such as ID). TEMP1 and TEMP2 will each 
  3913. have their own unique rules.  When the data entry session is over, have 
  3914. your macro INTERSECT TEMP1 WITH TEMP2 FORMING TEMP3 and APPEND TEMP3 TO 
  3915. MASTER where MASTER is the name of the main table.  Finally delete all the 
  3916. rows in TEMP1 and TEMP2 and remove TEMP3 so that you are ready for the next 
  3917. data entry session.  You will also want to PACK or RELOAD to clean up your 
  3918. database, because you deleted rows and removed a table. 
  3919.  
  3920.  
  3921. ===========================================================================
  3922. Figure 2.  Using Rules With Variable Forms
  3923. ===========================================================================
  3924. *(initialize)
  3925. NEW;SET MESS OFF;SET ERR MESS ON;SET BELL ON;SET NULL " "
  3926. COMPUTE NEWTOT AS ROWS FROM tblname 
  3927.  
  3928. *(start here if last form entered did not violate rules)
  3929. LABEL ADDREC 
  3930.     NEW
  3931.     SET VAR OLD TO .NEWTOT
  3932.     CLEAR var1 ; CLEAR var2 ; CLEAR var3  
  3933.     WRITE "Press [Esc] to add; [PgDn] to quit" at 2,1
  3934.  
  3935. *(redo this section if rule was violated - this code allows 4 retrys only
  3936.   because of the limit of 5 DRAWs before a NEWPAGE)
  3937. LABEL TRYAGAIN 
  3938.     DRAW varform AT 5
  3939.       EDIT VAR RETURN ESC PGDN
  3940.  
  3941. *( next block of code will end the data entry session if operator chooses)
  3942.       IF #RETURN = PGDN THEN 
  3943.         QUIT
  3944.       ENDIF
  3945.  
  3946. *( next block of code attempts to add a row if no rules are violated )
  3947.       IF #RETURN = ESC THEN
  3948.         SET NULL -0-
  3949.           LOAD tblname ; CHECK
  3950.            .var1 .var2 .var3  
  3951.           END
  3952.         SET NULL " "
  3953.  
  3954. *( next block determines if rule was violated.  If OLD = .NEWROWS then rule 
  3955.    was violated, else a row was added and ready to add another row)
  3956.         COMPUTE NEWTOT AS ROWS FROM tblname 
  3957.         IF OLD EQ .NEWTOT THEN
  3958.           GOTO TRYAGAIN 
  3959.         ELSE
  3960.           GOTO ADDREC
  3961.         ENDIF
  3962.       ENDIF 
  3963. ===========================================================================
  3964.  
  3965. You can also use your rules when editing using a variable form.  You would 
  3966. need to make the following modifications to the code in Figure 2.
  3967.  
  3968. o  Add the FILLIN, SET POINTER, and SET VAR commands (see the "Basics... 
  3969.    article) and other modifications necessary when editing existing data 
  3970.    using a variable form. 
  3971. o  Use the CHANGE command to load the data rather than a LOAD block.
  3972.    It is while the CHANGEs are being executed that the error messages will 
  3973.    be printed on the screen.  Issue a NEWPAGE right before the CHANGE 
  3974.    command and DRAW the variable form enough lines down the screen to 
  3975.    accomodate all the possible error messages. 
  3976.  
  3977.  
  3978.  
  3979.  
  3980. *******************************
  3981. LOADING MANY ROWS FROM ONE FORM
  3982. *******************************
  3983. Product: R:base 5000 all ver
  3984.  
  3985.  
  3986. Before attempting this article, review the "Varform Basics & Two-Page 
  3987. Forms" and the "Using Rules With Varforms" articles in this Technical 
  3988. Edtorial. 
  3989.  
  3990. Several customers have asked for the ability to load several rows at once 
  3991. from one form.  For example, you may want to enter all the invoices for 
  3992. customer number 234 onto one form.  You know that no more than three 
  3993. invoices would be entered at once, but sometimes you have only one or two 
  3994. to enter for a customer and you do not want NULL rows going into the table 
  3995. for the lines on the form that have no data. 
  3996.  
  3997. The method presented here is also very useful in applications like order 
  3998. entry where there may be several items ordered on one physical order form 
  3999. and you need each line to go into a separate row in the table.
  4000.  
  4001. Using this method will save time.  You do not need to wait for each invoice 
  4002. to be loaded into the table before entering the next one for the same 
  4003. customer.  
  4004.  
  4005. STEP ONE:
  4006. --------
  4007. First determine the maximum number of lines to be entered at one time and 
  4008. create a variable form with a different variable for each "cell" (line / 
  4009. column combination) in your form.  If you have a large number of variables, 
  4010. you may run out of memory and get an "Out of Dynamic Space" error message 
  4011. when trying to run your application.  If this happens, and you already have 
  4012. 384K of memory available (the maximum R:base 5000 currently uses) you will 
  4013. need to abandon this method and go back to the "one line at a time method".  
  4014.  
  4015. If, however, you have 384K bytes of memory, you will not have any problem 
  4016. with an average number of variables.  For example, the following scenario 
  4017. would be fine:
  4018.  
  4019. o  Basic Order Entry Application where each order can have a maximum of 
  4020.    five parts ordered at once, but sometimes fewer parts are ordered.
  4021. o  If only two parts are ordered, for example, only two rows are to be 
  4022.    added to the ORDERS table.  We need to prevent NULL rows from being 
  4023.    entered.
  4024. o  Variable form that has one master header line (to enter VCUST# and 
  4025.    VORDDATE) and five transaction lines with three integer and dollar 
  4026.    variables on each line.  Each of the transaction lines will be loaded to 
  4027.    a different row in the ORDERS table.
  4028. o  ORDERS table has five columns:  CUST#, ORDDATE, PART#, QUANT, and  COST.  
  4029.  
  4030. The variable form for this example would need to have the following 17 
  4031. variables located in it:
  4032.  
  4033. VCUST#  VORDDATE
  4034. VPART#1  VQUANT1  VCOST1
  4035. VPART#2  VQUANT2  VCOST2
  4036. VPART#3  VQUANT3  VCOST3
  4037. VPART#4  VQUANT4  VCOST4
  4038. VPART#5  VQUANT5  VCOST5
  4039.  
  4040. STEP TWO:
  4041. --------
  4042. Create a rule that requires an entry in the PART# column of ORDERS.  This 
  4043. rule will be used to prevent NULL rows from being added to the table if 
  4044. less than the maximum number of transaction records are included on a 
  4045. particular data entry form.
  4046.  
  4047.  
  4048. STEP THREE:
  4049. ----------
  4050. Put all the variables into the load block (the 1s on line one, the 2s on 
  4051. line two etc.) and include the VCUST# and VORDDATE on each of the lines.  
  4052. Each line will be loaded into a different row of the database.  The 
  4053. complete code is listed in Figure 3.  Do all of this with rule checking on 
  4054. and at the top of the load block enter the command:
  4055.  
  4056. OUTPUT TRASHCAN
  4057.  
  4058. this command will print all the error messages from the rules being broken 
  4059. into a file named TRASHCAN.  At the bottom of the load block command file 
  4060. enter the following two commands to clear everything. 
  4061.  
  4062. OUTPUT TERMINAL
  4063. ERASE TRASHCAN
  4064.  
  4065. Now, if a rule is broken (meaning that nothing was entered on that line of 
  4066. the form) that particular row will NOT be added to the table.  You will 
  4067. also want to have SET BELL OFF at the top of the command file.
  4068.  
  4069. ===========================================================================
  4070. Figure 3.  Loading Many Rows From One Variable Form
  4071. ===========================================================================
  4072. NEW;SET MESS OFF;SET ERR MESS ON;SET BELL OFF;SET NULL " "
  4073.  
  4074. LABEL TOP
  4075. NEWPAGE
  4076. WRITE "Press [Esc] to add; [PgDn] to quit" at 1 1 
  4077. DRAW varform AT 2
  4078. EDIT VAR RETURN ESC PGDN
  4079.  
  4080. IF #RETURN = PGDN THEN 
  4081.   QUIT
  4082. ENDIF
  4083.  
  4084. IF #RETURN = ESC THEN
  4085.   SET NULL -0-
  4086.     OUTPUT TRASHCAN
  4087.       LOAD tblname ; CHECK
  4088.         .VCUST#  .VORDDATE  .VPART#1  .VQUANT1  .VCOST1
  4089.         .VCUST#  .VORDDATE  .VPART#2  .VQUANT2  .VCOST2
  4090.         .VCUST#  .VORDDATE  .VPART#3  .VQUANT3  .VCOST3
  4091.         .VCUST#  .VORDDATE  .VPART#4  .VQUANT4  .VCOST4
  4092.         .VCUST#  .VORDDATE  .VPART#5  .VQUANT5  .VCOST5
  4093.       END
  4094.     OUTPUT TERMINAL
  4095.     ERASE TRASHCAN
  4096.   SET NULL " "
  4097. ENDIF
  4098.  
  4099. GOTO TOP
  4100. ===========================================================================
  4101.