Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!think!bloom-beacon!usc!hacgate!ashtate!dbase!awd From: awd@dbase.UUCP (Alastair Dallas) Newsgroups: comp.databases Subject: Re: dBaseIV: Report Forms and Calculated Variables Summary: An easy fix Message-ID: <82@dbase.UUCP> Date: 24 May 89 16:41:45 GMT References: <4088@silver.bacs.indiana.edu> Organization: Ashton Tate Devlopment Center Glendale, Calif. Lines: 49 In article <4088@silver.bacs.indiana.edu>, regoli@silver.bacs.indiana.edu (michael regoli) writes: > > ... report form designer details omitted ... > > 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. > > ... details omitted ... > > 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!! > > | michael regoli I am happy to report a simple solution to this problem. (I'm so tired of gnarly questions in areas of dBASE IV I'm not familiar with.) This one is easy--TOTAL is a dBASE IV command, so the line: .TOTAL = looks like the start of the TOTAL command, for which is probably a Syntax Error. It would be hard (but not impossible) for the report form code generator to detect this when you add the calculated field, but, hard or not, it doesn't. We were talking just the other day about slowing down the compiler slightly in order to avoid this problem in the next release, but I'm not sure what was decided. There are two easy solutions. Don't use a dBASE IV command name for your calculated fields--use TOT or TTAL, for example. Or, you can modify the code which the report form generates and convert: .TOTAL = to .STORE TO TOTAL Sorry the REPORT command didn't detect the problem for you, but I'm glad there is an easy fix. /alastair/