home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
rbnotes2.zip
/
EDTORIAL.14
< prev
next >
Wrap
Text File
|
1986-07-03
|
28KB
|
739 lines
MICRORIM TECHNICAL NOTE
________________________________________________________
HOW TO DISPLAY TIME DATA TYPE IN DIFFERENT FORMATS
DATE : 05/86 NUMBER : EX-5-1
PRODUCT : R:BASE 5000 VERSIONS : 1.01
CATEGORY : FORMATS SUBCATEGORY : TIME DATA TYPE
________________________________________________________
DESCRIPTION: How can I display or enter data into a TIME type column or
variable in military format or without the seconds?
EXPLANATION: Time type variables and columns can be displayed or entered in
any of the following four formats:
o am/pm format with seconds by using a location/display width of 9
o am/pm format without seconds by using a location/display width of 6
o military format with seconds by using a location/display width of 8
o military format without seconds by using a location/display width of 5 or
7.
For example, 6:35pm can be entered as 6:35p or 18:35:00 and displayed as:
o 6:35:00p
o 6:35p
o 18:35:00
o 18:35
If you are entering 6:35p, remember to include the p (for pm) or the value
entered will be assumed to be 6:35 am.
SOLUTION: When entering data, use any of the four formats. To display data
in a certain format, set the width of the output by using the location width
(including the S and the E) in your report or form. Or you can use the =w
option available in the SHOW VARIABLE and SELECT commands.
For example, if you want to select the time columns START and STOP and display
them in am/pm format without seconds, use the following command:
SELECT START=6 STOP=6 FROM tblname
If START and STOP are variables, use the following commands to display their
values in military format without seconds:
SHOW VAR START=5
SHOW VAR STOP=5
It does not matter how the data was originally entered because these are
display formats. The data is not actually changed in any way.
Use the following table as a general guide:
WIDTH TWO SAMPLE DISPLAYS
---- --------------------
5 12:16 18:35
6 12:16p 6:35p
7 12:16 18:35
8 12:16:10 18:35:45
9 12:16:10p 6:35:45p
Note that the displays for widths of five or seven are the same.
MICRORIM TECHNICAL NOTE
________________________________________________________
USING VARIABLE FORMS AS HELP SCREENS IN APPLICATIONS
DATE : 05/86 NUMBER : EX-5-2
PRODUCT : R:BASE 5000 VERSIONS : 1.01
CATEGORY : VARFORMS SUBCATEGORY : HELP SCREENS
________________________________________________________
DESCRIPTION: I have discovered that I can draw as many variable forms as I
want to, without having to issue a NEWPAGE, if I do not locate any variables
in them as long as I check for an error code of 616 and redraw the form if it
is found. In other words, if I meet these two conditions, I do not have to do
a NEWPAGE after five DRAW commands. How can I make use of this undocumented
feature?
EXPLANATION: Tim Smith, a registered R:BASE consultant, explains his use for
this feature below.
One of the subtle areas of power most R:BASE users may not know about is the
ability to use informational text-only variable forms as a help box to remind
casual users of an application of the choices they have.
There are three basic methods that can be used to make and use text-only help
boxes (screens):
o Use physical DOS text files that you TYPE or DISPLAY.
o Use help screens created by Application EXPRESS.
o Use WRITE statements to write the help on the screen.
o Use text-only variable forms.
We have found that the use of physical DOS text files to store help screens is
slow, limited, and can clutter your disk with a number of small files.
Additionally, it is difficult to EDIT the help screens created by Application
EXPRESS because the application has been compiled. If you use WRITE
statements then you also must go into your application itself and change the
code whenever you want to revise your help information. This makes updates to
an application difficult.
Text-only variable forms can be drawn anywhere, up and down the screen, as
many times as you like, as long as you draw the screen twice when encountering
a 616 error code. If the need arises to change the help screen, all you need
to do is update the forms table and send a disk to the customer with an
RBASE.DAT file that automatically updates their FORMS table.
An application using several FILLIN commands will run fastest by using
consecutive WRITE commands to draw your help screens. However it may be
difficult and time consuming to modify. Text-only variable forms are the next
fastest method because by using variable forms you never have to find and open
a DOS file. Because text-only variable forms are the easiest to modify, we
use them extensively in our applications.
SOLUTION: Here, Tim describes the text-only variable forms method and gives
an example.
Making the Variable Form Help Box
Create a variable form with the text information you want. It is best to keep
help boxes short and simple. Six lines or less is best. Make sure to put a
border around it. The border is necessary if you want to create a blank box
to blank out your help box. The blankout form will not work unless there are
characters on the righthand border of the form.
When you QUIT and SAVE the form you have just created, you may get an error
message warning you that no variables are located; just ignore it. Save the
form with a context sensitive name such as TRANCODE if the transaction codes
for a general ledger are what is stored in the form.
Using the Variable Form Help Box
To use the variable form, DRAW it onto the top or the bottom of the screen.
This way the user has a continual reminder of appropriate reactions to the
FILLIN prompts and the application developer can control the location,
content, and timing.
Also, the help boxes can be drawn over each other or a blanking box can be
drawn on top of them to make them go away. Your application will run faster,
be more manageable (because of fewer files), be easier to modify, and will
take up less storage (because of DOS minimum file size). The example below
relates a common usage.
Exercise
Create a variable form TRANCODE that looks like the sample help box below
Sample help box:
_______________________
| NCR Trancodes |
| ------------- |
| 1. Cash |
| 2. Charge |
| 3. Layaway |
| 4. Paidout |
|______________________|
Now, make a second variable form that has blank lines in it by issuing the
following commands:
PROJECT TEMP FROM FORMS USING ALL WHERE FNAME EQ TRANCODE
CHANGE FNAME TO BLANKBOX IN TEMP WHERE FNAME EQ TRANCODE
APPEND TEMP TO FORMS
REMOVE TEMP
FORMS BLANKBOX
At this point, press E to edit the form and the BLANKBOX form will come up on
the screen ready for you to edit it. Leave the box outline marks and space
over the letters inside the box to create a blank box. Save the form and you
have your blank box.
TEST.CMD, the command file listed below, is an example of how to implement
this concept. This particular example is set up to run through the WHILE loop
eight times. The eight was simply chosen to demonstrate the concepts
involved. You will want to modify the code to better reflect your actual
situation.
*( TEST.CMD shows the value of being able to DRAW a text-only variable
form in an R:BASE 5000 command File.)
SET MESS OFF
SET ERR MESS OFF
SET ERR VAR CHECKIT
SET V vwhile TO 8
WHILE vwhile GT 0 THEN
*(Draw the HELP BOX and if it fails then DRAW it again)
DRAW TRANCODE AT 1
IF CHECKIT = 616 THEN
DRAW TRANCODE AT 1
ENDIF
FILLIN vaction USING " " AT 19,25
*(Now blank out the HELP BOX area)
DRAW BLANKBOX AT 1
IF CHECKIT = 616 THEN
DRAW BLANKBOX AT 1
ENDIF
SET v vwhile TO .vwhile - 1
ENDWHILE
The IF blocks are necessary because if this is the sixth DRAW the DRAW will
fail and the error variable CHECKIT will have a value of 616. But because the
buffer is cleared when the error is encountered all you need to do is redraw
the form to start counting over again.
These help boxes can be used in a variety of applications. Anyone who uses
the FILLIN command to have the user pick from a number of valid choices can
make use of this feature.
MICRORIM TECHNICAL NOTE
________________________________________________________
OUTPUTTING TO VARIOUS OUTPUT DEVICES
DATE : 05/86 NUMBER : EX-5-3
PRODUCT : R:BASE 5000 VERSIONS : 1.01
CATEGORY : REPORTS SUBCATEGORY : OUTPUT/DEVICES
________________________________________________________
DESCRIPTION: How can I output reports and other types of output to different
printers or other output devices such as modems?
SOLUTION: Use the OUTPUT command to specify the correct device name. For
example, the following code will send the report NAMES to the printer attached
to the LPT1 port and send the DOLLARS report to the printer attached to the
COM1 port:
OUTPUT LPT1 *( Notice no colon )
PRINT NAMES
OUTPUT COM1
PRINT DOLLARS
OUTPUT SCREEN
This works because of a feature of DOS. R:BASE creates a file with the same
name as the output device and whenever DOS finds a filename that is the same
as the name of the device, DOS sends the contents of the file to the device.
To DOS the filename and device are the same thing.
MICRORIM TECHNICAL NOTE
________________________________________________________
R:BASE 5000 WITH THE HP LASERJET
DATE : 05/86 NUMBER : EX-5-4
PRODUCT : R:BASE 5000 VERSIONS : 1.01
CATEGORY : PRINTERS SUBCATEGORY : HP LASERJET
________________________________________________________
DESCRIPTION: R:BASE 5000 interfaces with the HP Laserjet printer just as it
does with any other printer that works with DOS. However, there are a few
differences in terms of set-up and operation of the printer.
EXPLANATION: The Laserjet interfaces with the serial port on the computer.
Most dot matrix printers use the parallel port. Therefore, the following two
commands must be executed at the DOS level, usually in an AUTOEXEC.BAT file:
MODE COM1:9600,N,8,1,P
MODE LPT1:=COM1
These commands redirect the output to the serial port instead of the parallel
port. Without these mode settings, if you try to output to the printer, it
will go to the parallel port. If you don't have a printer hooked into your
parallel port, the computer will hang.
Escape sequences function much the same as with other printers. The Laserjet
stores some fonts in memory, but others are stored in replaceable cartridges.
Only the fonts in the currently installed cartridge or in memory are
supported.
The Laserjet often does not appear to print the last page of a report. This
is due to the fact that it stores each page of data in its memory before it
prints it. Whenever the "form feed" light is on, it indicates that there is
data in the printer's memory. If the memory contains less than a page of
data, it will not print that data until the page fills up or it is sent a page
eject. There are several ways to force the last page of a report to print as
indicated in the solution section.
SOLUTION: Try the following suggestions to get the contents of the printer
memory buffer to print:
o Turn the printer offline by pressing the "online" key so that the light
on that key is off, and then press the "form feed" key. When there is no
longer any data in the printer's memory buffer, the light above the "form
feed" key will go off. Make sure to press the "online" key to put the
printer back online in order to do more printing.
o At the R>, if the output is still directed to the printer, type
"newpage". This sends a page eject to the printer and causes it to print
the data in the buffer.
o Specify a page eject after the report footer. If you don't have a report
footer in your report, simply mark a blank line as report footer - it won't
affect the appearance of the report.
o Define a report variable as a page eject and locate it in the report
footing.
A common misconception is that Laserjet escape codes are too long for R:BASE
report variables, which have a maximum length of 30 characters. The only time
that this should be a problem is if the escape codes are concatenated. The
Laserjet will allow several escape codes to be concatenated together into one
long escape code. Instead of concatenating, define each escape code as a
separate report variable. Make sure that the report variables are located in
the correct order because the Laserjet will perform the escape sequences in
the order in which they are specified.
Finally, study the Laserjet Owner's Manual, Chapters 3 and 4 in particular.
Chapter 3 discusses the operation of the printer, and Chapter 4 discusses the
use of escape sequences. These two chapters cover a great deal of information
that warrants careful study.
MICRORIM TECHNICAL NOTE
________________________________________________________
ERRORS WITH ENTER FORMNAME FROM FILENAME
DATE : 05/86 NUMBER : EX-5-5
PRODUCT : R:BASE 5000 VERSIONS : 1.01
CATEGORY : ERRORS SUBCATEGORY : ENTER form FROM file
________________________________________________________
DESCRIPTION: I am getting the error message:
- ERROR - No WHILE or IF blocks are open on the current input source
I know that I do not have any extra ENDWHILE or ENDIF commands. Why am I
getting this erroneous message?
EXPLANATION: You will get the above error message, If you have the following
command inside an IF block or WHILE block:
ENTER formname FROM filename
This version of the ENTER command is used to load a formatted file using a
form.
In addition to the error message problem, this particular ENTER command can
also cause parts of your command file to repeat itself if any commands follow
it, even if it is not inside an IF or WHILE block. Therefore, we suggest
using the solution below to solve both problems.
SOLUTION: Put the ENTER command line in a separate one-line file and then
run the one-line file when you want to enter data through a form. For
example:
IF X1 = 0 THEN
RUN INFORM
ENDIF
where the file INFORM contains the following command:
ENTER formname FROM filename
MICRORIM TECHNICAL NOTE
________________________________________________________
FDATA NOT DEFINED WHEN RUNNING REORD.FM
DATE : 06/86 NUMBER : EX-6-1
PRODUCT : R:BASE 5000 VERSIONS : 1.01
CATEGORY : PROGRAM SUBCATEGORY : ERROR MESSAGE
________________________________________________________
DESCRIPTION: In attempting to use the program REORD.FM on a particular
database, I get the following error message:
- ERROR - Variable FDATA is not defined
EXPLANATION: The database is probably an R:BASE 4000 database that has not
been converted to R:BASE 5000. To be sure, list the FORMS table with the
following command:
LIST TABLE FORMS
In R:BASE 4000, the two columns in the FORMS table are FNAME and DATA. In
R:BASE 5000, they are FNAME and FDATA. R:BASE 4000 FORMS tables work just
fine with R:BASE 5000 applications as long as you are not literally referring
to the FDATA column. The REORD.FM program does refer to the FDATA column,
hence the problem with R:BASE 4000 FORMS tables.
SOLUTION: First, remove the temporary table that REORD.FM creates by issuing
the following command:
REMOVE TT1
Next, use the following command to rename the affected column in the FORMS
table and you are all set to reorder the prompting order in your forms with
the REORD.FM program.
RENAME COLUMN DATA TO FDATA IN FORMS
MICRORIM TECHNICAL NOTE
________________________________________________________
BUILDING CHOOSE MENUS BASED ON COLUMN VALUES
DATE : 06/86 NUMBER : EX-6-2
PRODUCT : R:BASE 5000 VERSIONS : 1.01
CATEGORY : MENUS SUBCATEGORY : TABLE BASED
________________________________________________________
DESCRIPTION: A traditional menu with fixed choices is fine in some
applications but sometimes I need to build menus based on the values stored in
a column. An example would be a General Ledger for a Multi-Department Company
or office. The traditional method of building a menu quickly becomes obsolete
as the possible choices change. If a user wishes to add, delete, or change a
costing center the menu must be updated. I need to to be able to create a
menu based on choices that are stored in a table. The command file listed
below will create a CHOOSE MENU by using the CHOOSE command itself, a simple
command file, and a one line report.
EXPLANATION: CHOOSE menus are menus used with the CHOOSE command. They are
created automatically by EXPRESS or you can create your own. The solution
presented here automates the process of changing the choices presented in a
CHOOSE menu during processing of the application. As the choices change, the
application automatically changes the menu choices.
CHOOSE menus can be blocks in procedure files or can be actual DOS files.
They must follow a specific format and may have the choices listed verically
(a column menu) or horizontally (a row menu). The first line must be the word
MENU. The second line's first word is ROW or COLUMN, depending on the type of
menu, followed by the title to be printed at the top of the menu. The
remaining lines are the choices to be listed in the menu.
You can have up to a maximum of 382 characters per menu. Vertical (column)
menus have have up to 9 choices and horizontal (row) menus may have up to 40
items as long as you stay within the maximum of 382 characters..
If the menu is a DOS file, name it with the name you will use to call it. For
example, if the file is named FUND, you would use the following R:BASE command
line to execute it:
CHOOSE OPTION FROM FUND
In this example, the variable OPTION will hold the choice that the operator
picks from the menu FUND.
For more information on menus and the CHOOSE command, see your R:BASE 5000
manuals.
SOLUTION: This solution was contributed by Tim Smith an R:BASE 5000
registered Value Added Reseller (VAR).
The following describes the database used in this example:
Table: PROGRAMS (Contains general ledger entries. It is used to track
23 community service programs).
Columns: PRGRM# Integer - The Number of the Costing Center or Department
PRGRMNM Text 40 - The Name of the Program
Report: FUNDMENU
CREATING THE REPORT
Create the FUNDMENU report and locate the column containing the menu choices
(PRGRMNM in this example). Next, mark the line containing the PRGRMNM
location with a D for detail. The entire layout will consist of the following
single line:
D S E
Do not mark a REPORT HEADING, but do select it in order to TURN OFF INITIAL
CARRIAGE RETURN. If you omit this step, you will end up with a blank line as
a choice in your menu.
Print the FUNDMENU report sorted by PRGRM#.
THE COMMAND FILE
RUN the following simple command file to create the menu named FUND and prompt
the operator for his choice. The FUND menu lists the choices which are, in
this example, names of costing centers and programs. This method creates
descriptive prompts and allows a menu to build itself as the menu options
change over time.
*(FUNDMENU.CMD creates a menu named FUND which is then used in the R:BASE
application with the CHOOSE command )
OUTPUT FUND *(DIRECT OUTPUT TO fILE)
WRITE "MENU" *(BEGIN BUILDING A MENU FILE)
WRITE "ROW CHOOSE FUND TO WORK WITH" *(CHOOSE ROW OR COLUMN MENU TYPE)
PRINT FUNDMENU SORTED BY PRGRM# *(PRINT CURRENT LIST OF MENU CHOICES)
OUTPUT SCREEN *(CLOSE THE FILE)
CHOOSE FUNDNM FROM FUND *(GET THE OPERATOR'S CHOICE)
That's all there is to it! When the operator adds, changes, or deletes a
program or costing center, the new menu is automatically created when you RUN
FUNDMENU.CMD. Your application automatically grows and changes as needs grow
and change.
If you prefer you can put the word MENU on the first line of the report (in
the heading) and the ROW... line as the second line in the heading. This
would eliminate the need for the two WRITE commands in the command file. Also
keep the limits of a MENU in mind. You can have a maximum of 40 menu items or
382 characters whichever comes first.
For example, the above process may result in the following menu file being
generated:
MENU
ROW CHOOSE FUND TO WORK WITH
CCFP
Family Day Care Homes
CSBG
Chore / Homemaker
Insurance
III-B Transportation
CEOP
RCS Audit
Non-Federal
This horizontal (row) menu has nine options and a total of 107 characters (a
total of 99 characters plus the eight spaces between each of the choices). In
this example all the menu options fit within the CHOOSE menu limits.
MICRORIM TECHNICAL NOTE
________________________________________________________
PRINTING AN AGED ACCOUNTS RECEIVABLE REPORT
DATE : 06/86 NUMBER : EX-6-3
PRODUCT : R:BASE 5000 VERSIONS : 1.01
CATEGORY : REPORTS SUBCATEGORY : AGED A/R REPORT
________________________________________________________
DESCRIPTION: What is a good way to go about printing an aged accounts
receivable report? In other words, I want to print a report where a balance
is printed in one of three columns (30 days, 60 days, and 90 days) based on
the age of the balance. How can I do this type of columnar report in R:BASE?
EXPLANATION: In R:BASE 5000 any value divided by a NULL value returns a NULL
result. Using this feature we developed the solution presented here.
SOLUTION: Set your report up using the principles and ideas presented in
this example solution.
Table ACCT
This example uses a table named ACCT:
ACT# AMT TDATE
---- ----------------- --------
101 $100.00 05/20/86
102 $200.00 04/19/86
103 $300.00 03/19/86
104 $400.00 04/20/86
Aged Accounts Receivable Report
The report calculates the number of days an account is overdue, and displays
it in a 30 days overdue column, 60 days overdue column, or 90 days overdue
column, as appropriate. Totals for each group are also given. Assuming a
system date of 6/19/86, the sample report looks like this:
ACT# 0-30 DAYS 31-60 DAYS 61-90 DAYS # DAYS
---- ---------- ---------- ---------- ----------
101 $100.00 30
102 $200.00 61
103 $300.00 92
104 $400.00 60
-----------------------------------------------------------------
TOTALS: 30 DAY 60 DAY 90 DAY
---------- ---------- ----------
$100.00 $400.00 $500.00
Special Table DAYTAB Used By Report Variables
The DAYTAB table is a special three-row look up table used by the report
variables to look up the values needed to make the report format you want.
The columns DAYS, C1, C2, and C3 in the table DAYTAB are all integers. The
DAYTAB table has the following contents:
DAYS C1 C2 C3
----------- -------- -------- ----------
61 1 -0- -0-
31 -0- 1 -0-
0 -0- -0- 1
You can modify the number in the DAYS column to fit the conditions you want.
For example, if you wanted a 60, 90, 120 day aged accounts receivable report,
you would modify the contents of the DAYTAB table to match the following:
DAYS C1 C2 C3
----------- -------- -------- ----------
91 1 -0- -0-
61 -0- 1 -0-
0 -0- -0- 1
The positioning of the ones and nulls in the DAYTAB table is critical.
Report Variables
Define the following report variables in the define mode of the report writer.
Be certain that the order of the variables is exactly as shown here.
Expression: [F3] to list, [ESC]
1:DATE : DT1 = .#DATE
2:INTEGER : DT2 = DT1 - TDATE
3:INTEGER : F1 = C3 IN DAYTAB WHERE DAYS LE DT2
4:INTEGER : F2 = C2 IN DAYTAB WHERE DAYS LE DT2
5:INTEGER : F3 = C1 IN DAYTAB WHERE DAYS LE DT2
6:DOLLAR : 30DAY = AMT / F1
7:DOLLAR : 60DAY = AMT / F2
8:DOLLAR : 90DAY = AMT / F3
9:DOLLAR : 30TOT = 30DAY + 30TOT
10:DOLLAR : 60TOT = 60DAY + 60TOT
11:DOLLAR : 90TOT = 90DAY + 90TOT
The first two report variables are used to calculate the number of days an
account is overdue by comparing the date column to the current system date.
F1, F2, and F3 are the lookup factors to be used as denominators. Only one of
these three variables will be 1, the other two will be null, since that is
what is stored in the DAYTAB table.
In the sixth, seventh, and eighth report variable expressions, AMT is divided
by each of the factors (F1, F2, and F3) to calculate each of the variables
30DAY, 60DAY, 90DAY. The variables 30DAY, 60DAY, and 90DAY are located on the
report. Because two of the factors are NULL, and division by NULL returns a
NULL, two of these located variables will be NULL. Therefore, before printing
the report, set NULL to a blank. For example:
SET NULL " "
PRINT reptname
SET NULL -0-
With null set to display as a blank, only one of the located variables will
show up on the report because only one of the variables will have a non-null
value.
The last 3 report variable expressions calculate the report totals for each of
the three (30 day, 60 day, and 90 day) report column.
Report LAYOUT
This final chart shows the layout section of the report:
HP <1,1> [F3] to list, [ESC] to exit
HP ACT# 0-30 DAYS 31-60 DAYS 61-90 DAYS # DAYS
HP ---- ---------- ---------- ---------- ---------
HP
D S E S E S E S E S E
FR
FR---------------------------------------------------------------------
FR TOTALS: 30 DAY 60 DAY 90 DAY
FR ---------- ---------- -----------
FR S E S E S E
FR