Error BASE/1003 Variable does not exist: TOTSALE

1,647 views
Skip to first unread message

mtmigs

unread,
May 10, 2017, 10:27:15 PM5/10/17
to Harbour Users
I almost have the conversion from Clipper to harbour complete but I seem to have found a difference between Clipper and harbour. I am getting an error. "Error BASE/1003  Variable does not exist: TOTSALE" when I run the harbour compiled program which runs without an error for the Clipper compiled version. The section of code where the error occurs is:

USE products
INDEX ON 100 - HOTPRODNO TO TEMP
SET SAFETY ON
USE products INDEX temp
SALESLFT   = TOTSALE
PRODCNT    = 0000
PRODREAD   = 0000
TEMPUNITS  = 000000.0
PRODTOT    = RECCOUNT()

In the main prg file there is a line at the beginning listing the TOTSALE field:

PUBLIC PRODAVG, LISTAVG, TOTSALE, HOTTOT, SALESLFT, MCYEAR, MCYEARSW

Then later in the main file there is a "DO rlmod04" that executes the routine where the error occurs.

Clipper does not seem to mind but harbour version gives the option of Retry or Quit. Retry just gives the same error and quit exits the program listing where the error occurred.

What can be done to correct this difference between the two languages?

Moshe Mordkovych

unread,
May 11, 2017, 10:32:40 AM5/11/17
to Harbour Users
Hi

Try using memvar TOTSALE

mtmigs

unread,
May 11, 2017, 9:12:35 PM5/11/17
to Harbour Users

Try using memvar TOTSALE


 
I looked up the usage of MEMVAR and then PUBLIC. I do not know why the program should require PUBLIC variable to be declared again. In fact I do not know why the program is giving the error since TOTSALE should be available to the rlmod04 module from the initial PUBLIC declaration.

Sergy

unread,
May 12, 2017, 3:06:03 AM5/12/17
to Harbour Users
Hi

Which compiler (or hbmk2) command line options are you using ?



пятница, 12 мая 2017 г., 4:12:35 UTC+3 пользователь mtmigs написал:

mtmigs

unread,
May 12, 2017, 9:37:15 AM5/12/17
to Harbour Users

Which compiler (or hbmk2) command line options are you using ?


I am using make (not hbmk2) to make my program, "jrm.prg". For harbour there are no options:

harbour jrm.prg
Harbour 3.2.0dev (r1612161005)
Copyright (c) 1999-2016, http://harbour-project.org/

The c compiler has these options:

gcc -m32 -Wall -I /usr/include/harbour -o jrm.o -c jrm.c

The linking of all the modules together has these options:

gcc -Wall  jrm.o basfun01.o basfun02.o basfun03.o basfun04.o basfun05.o basfun06.o basfun07.o basfun08.o basfun09.o basfun10.o basfun11.o basfun12.o funcs.o -o jrm -m32 -L /usr/lib/harbour \
            -Wl,--start-group -lhbvm -lhbrtl -lhblang -lhbrdd \
            -lhbmacro -lhbpp -lhbcommon -lrddntx -lrddcdx -lrddfpt -lhbsix \
            -lhbct -lgttrm -lhbcpage -Wl,--end-group -lgpm -lm


mtmigs

unread,
May 12, 2017, 10:34:00 AM5/12/17
to Harbour Users
SOLVED!

Looking at the documentation I found a note about the PUBLIC command stating it is executable. The original Clipper source code did not have a MAIN() as required by harbour. When I added the main() I though the PUBLIC commands were information to the compiler as in some other computer languages I know. So I placed the start of MAIN() after the PUBLIC statements. Moving them inside the MAIN() fixed the problem.

Przemyslaw Czerpak

unread,
May 12, 2017, 11:44:12 AM5/12/17
to harbou...@googlegroups.com
Exactly.
But if you use HBMK2 instead of calling raw harbour compiler then
it automatically detects first function in your first compiled
module and sets it asstartup entry point just like Cl*pper so
Main() function is not necessary.

best regards,
Przemek

mtmigs

unread,
May 12, 2017, 8:17:06 PM5/12/17
to Harbour Users

Exactly.
But if you use HBMK2 instead of calling raw harbour compiler then
it automatically detects first function in your first compiled
module and sets it asstartup entry point just like Cl*pper so
Main() function is not necessary.


My primary language these days is C and C++. So I understood how to setup make and could not figure out hbmk2.
 
Reply all
Reply to author
Forward
0 new messages