[comp.sys.ibm.pc] dBaseIV: Help on Report Forms and Calculated Variables

regoli@silver.bacs.indiana.edu (michael regoli) (05/23/89)

][

i have a question with the report form designer and calculated
variables.

i have a database that has numeric fields: price1, price2, price3,
and freight.

i have gone into the menu "Fields" and then "add".  i then select
<create> under calculated.  then i name the variable "TOTAL" (sans
quotes) and for the expression i enter: (price1+price2+price3).
no problem or errors reported when doing this or saving and
compiling the form.

however, when i go to print, i get:

error on line nn: unrecognized phrase/keyword in command
TOTAL=(price1+price2+price3)

question: does the variable "TOTAL" as named above have to exist as a
field in the database file??  i also have a calculated variable called
GRAND that takes the value of the *field* (not a var) FREIGHT and adds
it to the calculated variable TOTAL.

here are the variable initializations per invoices.frg:

*-- Initialize calculated variables.
TOTAL=""
GRAND=""

*-- Assign initial values to calculated variables.
TOTAL=(price1+price2+price3)
GRAND=str(val(total)+freight)

another question:  why does dbIV let me define these calculated
variables without complaining and why doesn't it report this error 
when compiling the form?!

any clues on how to get this to work will be appreciated!!

thanks.

--
                        |
                        |  michael regoli
                        |  ...rutgers!iuvax!silver!regoli
                        |  regoli@silver.bacs.indiana.edu
			|  regoli@iubacs.bitnet
                        |