Compile dBASE III Plus prg files on Harbour

1,647 views
Skip to first unread message

Sudhir Mittal

unread,
Mar 21, 2017, 3:28:46 AM3/21/17
to Harbour Users
Hi

I am not a software writer and am not familiar with the terminology used by you guys.
I run a small company making special wires and cables near Delhi, India.

When the PC came in 1985, I wrote some simple code in dBASE III Plus to manage my accounts, production and payroll,

And I have been successfully using the same for more than 30 years, so much so that it is now a functional ERP system.
The younger generation Professionals do laugh at me.
.
The limitation now I face is that we no longer get PC's which will support DOS.  I am now trying to change my code so that it can run on newer PCs.

That is how landed at Harbour and am trying to compile my prg files into an exe file.

While trying it on Harbour, I am getting an error E0020 incomplete statement or unbalanced delimiters at the last line of dBASE III Plus prg file.

Can anybody help ?

Rajko

unread,
Mar 21, 2017, 4:13:25 AM3/21/17
to Harbour Users
Yes, but you have to show some code or email me.Regrads

Can anybody help ?

Jayadev Urath

unread,
Mar 21, 2017, 7:09:46 AM3/21/17
to Harbour Users
Hello Sudhir,

Welcome to the group.

Please show us the problematic code and your compile script.  Only then can we help.

Warm regards,

Jayadev


--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-users+unsubscribe@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sudhir Mittal

unread,
Mar 22, 2017, 2:32:30 AM3/22/17
to harbou...@googlegroups.com
Here is the compiler error and the code I compiled

* SENTER17.prg for entering new student in ENROLMNT.DBF and SESION17.DBF
* Written by S M MITTAL Mar 14, 2017
SET STAT OFF
CLEA ALL
SELE 2
USE SESION17
SELE 1
USE ENROLMNT
GO BOTT
STOR ENROLMENT TO MEN
MEN=MEN+1
A=' '
MCH=' '
@ 1,4 SAY " LAST ENTRY :"
@ 1,15 SAY STR(ENROLMENT,6)+' '+TRIM(NAME)+'  ..D/S OF '+TRIM(FNAME)
@ 3,4 SAY " NEW ENROLMENT " GET MEN PICTURE "######"
READ
LOCA FOR ENROLMENT=MEN
IF  EOF()
 MSEX='  '
 STOR SPAC(25) TO MSNAME,MFNAME,MMNAME,MSCHOOL
 STOR SPAC(25) TO MADDR1
 STORE "       " TO MCATEGORY,MRELIGION,MCASTE,MPIN
 STORE DATE() TO MDOJ, MDOB
 STORE '          ' TO MPHONE
 STOR '  ' TO MCLASS
*DO WHILE .NOT. A='C'

@ 6,4 SAY 'NAME .......' GET MSNAME
@ 7,4 SAY 'FATHER NAME ' GET MFNAME
@ 8,4 SAY 'MOTHER NAME ' GET MMNAME
@ 10,4 SAY 'ADDRESS.....'
@ 11,8 GET MADDR1
@ 13,4 SAY 'PHONE ' GET MPHONE
@ 7,48 SAY 'RELIGION ' GET MRELIGION 
@ 9,48 SAY 'CASTE ' GET MCASTE
@ 11,30 SAY ' SEX 'GET MSEX
@ 11,40 SAY 'DATE OF BIRTH ' GET MDOB
@ 11,63 SAY '(dd/mm/yy)'
@ 13,40 SAY 'ADMITTED ON.  ' GET MDOJ
@ 13,66 SAY 'Class..' GET MCLASS
@ 15,34 SAY 'Prev. School ' GET MSCHOOL 
READ

@ 20,4 SAY " Enter C to continue, any other key to redo" GET A
READ

IF A='C'
 APPEND BLANK
 REPL ENROLMENT WITH MEN,NAME WITH MSNAME
 REPL FNAME WITH MFNAME, MNAME WITH MMNAME, ADDR1 WITH MADDR1
 REPL RELIGION WITH MRELIGION, SEX WITH MSEX, CASTE WITH MCASTE
 REPL DOB WITH MDOB, DOJ WITH MDOJ, CLASS WITH MCLASS
 REPL PREVSCHOOL WITH MSCHOOL,PHONE WITH MPHONE

SELE 2
 APPE BLAN
 REPL ENROLMENT WITH MEN, NAME WITH MSNAME, FNAME WITH MFNAME
 REPL CLASS WITH MCLASS
 @ 22,4 SAY 'Data has been stored, '
ELSE
 @ 22,4 SAY 'Data has NOT been stored ..'
ENDIF
WAIT ' '
ELSE
 @ 3,40 SAY 'This Enrolment No is of '+NAME
 @ 4,4 SAY 'Do you wish to EDIT the data ? (Y/n) ' GET MCH
 READ
 IF UPPE(MCH)='Y'
  DO STUDENT2
 ENDIF
WAIT 'Press any key to return to Menu'
RETURN

The error message is ' SENTER17.prg (75) Error E0020 Incomplete statement or unbalanced delimiters '

Inline image 1



On Tue, Mar 21, 2017 at 1:43 PM, Rajko <rajko.d...@gmail.com> wrote:
Yes, but you have to show some code or email me.Regrads

Can anybody help ?

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-users+unsubscribe@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/mjKORiZei1A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-users+unsubscribe@googlegroups.com.

Francesco Perillo

unread,
Mar 22, 2017, 2:42:23 AM3/22/17
to harbou...@googlegroups.com
I think that the fields in this line makes the program higly illegal in several countries:

REPL RELIGION WITH MRELIGION, SEX WITH MSEX, CASTE WITH MCASTE

Anyway, there  is a missing ENDIF

ELSE
 @ 3,40 SAY 'This Enrolment No is of '+NAME
 @ 4,4 SAY 'Do you wish to EDIT the data ? (Y/n) ' GET MCH
 READ
 IF UPPE(MCH)='Y'
  DO STUDENT2
 ENDIF
ENDIF  <-------------------- MISSING, should be here by indentation

WAIT 'Press any key to return to Menu'
RETURN
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-users+unsubscribe@googlegroups.com.

Paul Smith

unread,
Mar 22, 2017, 7:00:47 AM3/22/17
to Harbour Users
Hi Sudhir

The code you post has a few problems, i assume you've been trying to edit and compile it and it's not the code you usually use, as it won't run an dDASEIII  either.
Eg the * comments out line 25
I use an old DOS based bit of software called Snap  Version 3.12e to check and format the code. This will only run on 32 bit machines but there are plenty of other tools 
Once you've got code that is running fine in dDASEIII, try running it in hbrun.exe, which is a sort of harbour equivalent of the dDASEIII  dot prompt found in the same directory as hbmk2.exe.
That may be all you need or if you want once the code is OK you can compile it with hbmk2.exe 

Cheers
Paul

Sergy

unread,
Mar 22, 2017, 4:01:43 PM3/22/17
to Harbour Users
Hi

Can anybody help ?

Harbour has a powerful mechanism for code exchange. It's work as set of rules which tells to compilator - how it should to do.
You can see it in \harbour\include\std.ch file.

It structure is very simply and mighty at same time. As example, following rules:

#command DELETE [FOR <for>] [WHILE <while>] [NEXT <next>] ;
                [RECORD <rec>] [<rest:REST>] [ALL] => ;
         dbEval( {|| dbDelete() }, <{for}>, <{while}>, <next>, <rec>, <.rest.> )


easily replaces almost all variants of "dBase" command DELETE - to only one function call.

You can see other examples in your \harbour\include\*.ch files.

I suggest - the best way is to write some "wrapper" to translate unsupported dBase commands into "Harbour style".

WBR,
Sergy.

Emmer

unread,
Mar 23, 2017, 9:45:02 AM3/23/17
to harbou...@googlegroups.com
Not really a good harbour-project solution, but for the mean time you could look at https://www.vdos.info/ a good working 16bit emulator especially for office database apps (not games)

I use it at a customer for old BBX programs.

regards,
Emmer


Op 21-3-2017 om 8:28 schreef Sudhir Mittal:
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

DaNiEl MaXiMiLiAnO

unread,
Mar 23, 2017, 2:44:34 PM3/23/17
to harbou...@googlegroups.com

Hacker attack : non https URL🚷

El jue., mar. 23, 2017 a 10:45, Emmer
<emm...@gmail.com> escribió:

Tom Carpenter

unread,
Mar 24, 2017, 9:36:30 AM3/24/17
to Harbour Users
Sudhir,

I was able to compile and produce an "exe" file using the following code which I cleaned up a little bit with indentations so it's easier to see that you were missing a final ENDIF at the bottom.  Also see notes at lines 73, 76, and 79.  But this code will produce an exe with old 16-bit Clipper 87, and will also produce a 32-bit exe with Harbour HBMK2.

Hope this helps.

Tom.
    * DO STUDENT2    Won't link for me without STUDENT2 procedure

   ENDIF
   WAIT 'Press any key to return to Menu'
ENDIF    &&  Missing EndIf.  dBase is very "forgiving".  Compilers are NOT. 
QUIT
* RETURN  Replace "RETURN" with "QUIT" in the main controlling prg file. 
* The error message is ' SENTER17.prg (75) Error E0020 Incomplete statement or
* unbalanced delimiters '

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/mjKORiZei1A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.

Sudhir Mittal

unread,
Mar 25, 2017, 12:10:35 AM3/25/17
to harbou...@googlegroups.com
Thanks very much Tom
The RETURN command was used as the program was returning to the main menu which calls different prg files for different actions.

Now I got the idea what is going wrong.

I am already facing problem to continue with 16 bit machines, as the mother boards are getting rarer.

Any idea if there will be difficulty in sending output of exe files through LPT1 port to a dot matrix printer ?

Thanks again


Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/mjKORiZei1A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-users+unsubscribe@googlegroups.com.

Tom Carpenter

unread,
Mar 25, 2017, 10:53:57 AM3/25/17
to Harbour Users

Tom Carpenter

unread,
Mar 25, 2017, 10:57:19 AM3/25/17
to Harbour Users

Tom Carpenter

unread,
Mar 25, 2017, 11:35:52 AM3/25/17
to Harbour Users
Sudhir,
 
I haven't done any printing with Harbour but I would not expect any problems with LPT1.  I was in a similar position to you a few years ago.  The biggest difference is that I have used the old Clipper 87 compiler for years and was not really running any significant programs in dBase III Plus - although to this day I STILL use dBase III Plus as a "manual" tool to look at dbf files, mem files, dbt files, etc.
 
Machines were becoming 64-bit machines in my environment and 16-bit programs "blow up" on those machines.  That's when I discovered Harbour.  I realized that - in THEORY - if Harbour were as good as I hoped - my dBase "source code" which compiles and links with Clipper 87 SHOULD also produce a 32-bit executable from that same source code.  Fortunately Harbour really IS as good as I hoped.  With very few exceptions my dBase/Clipper source code compiled under Harbour with no changes!!  I was really impressed.
 
But as I and others have pointed out, compilers will catch "errors" in programs which actually RUN under dBase III Plus.  But, unlike you, I had already compiled my programs that really matter with Clipper so I wasn't dealing with any "sloppy" (sorry) code which might work in dBase, but would NEVER get past a compiler.
 
Harbour is a GREAT choice for moving your old programs into a 64-bit world.  It still amazes me that after all these years (and I STARTED with dBase III Plus when it was the great, new "whiz bang" technology in the 80s) the dBase scheme of language and dbf files (and more) continues to be valuable and useful.  We just needed a compiler to produce much faster executables and Clipper (Nantucket) was the first to do that.
 
Just a heads-up on a couple of things you'll see at some point when you get your first Harbour executable working.  SAVE copies of your important dbf files before running the executable.  That's because after you run that executable against your dbf files and make changes to those files - you WON'T BE ABLE TO OPEN THEM IN dBase III Plus which will tell you the file is "Not a dBase file" when you try to "USE" it.  There is a way around that.  I've wrtten a little program which will "fix" the dbf file so that it CAN be opened again by dBase III Plus.  So don't panic when you see that.  The OTHER thing which may affect you are INDEXES.  dBase uses NDX files while Harbour uses the Clipper NTX format for indexes.  I don't know if you have any indexes in your system, so maybe this won't be an issue for you.  But any indexes you have will HAVE to be converted to NTX files.
 
So there's a quick "tutorial" on what you can expect to see very shortly once you get a Harbour executable working.
 
Tom.

Sudhir Mittal

unread,
Mar 25, 2017, 1:07:50 PM3/25/17
to harbou...@googlegroups.com
Tom

Thanks very much for your detailed guidance and tutorial. 

From yours and others' feedback I have realized that the compilers are indeed unforgiving to sloppy code writers like me. But I will now improve and will make my code acceptable to the compiler. 

My code does use indexes and 'set relation to' command often. In fact the relational capabilities of dBase III is what made me hook into it. 

This inability to open dbf file in dBase III once opened by another program (like EXCEL) does cause a problem. I will be happy to use your fix program to make files readable by dBase III again. 

I wonder how to convert an Index file to NTX ?

I hope you don't mind my bugging you as I try get over the hump to compile my codes. 

But now I am quite excited about Harbour. 

Thanks again

Sudhir 

Tom Carpenter

unread,
Mar 26, 2017, 12:27:08 PM3/26/17
to Harbour Users
On the Indexes, the simplest way is to write a little program like the following:
 
USE MyDBF
 
INDEX ON MyNDXKey  TO MyIndexFile
 
CLOSE DATABASE
QUIT
 
Compile this program with Harbour and run it.  It will produce the NTX file since that's the ONLY index Harbour will create or use.  Once created, any commands in your program such as REINDEX will work the way you expect from dBase.  NTX is just a different Index format created by Clipper, but logically it works like an NDX file.  If you have any commands such as ERASE (DELETE FILE) MyIndex.NDX, that command will have to change to ERASE MyIndex.NTX.
 
On my program to fix the update date in the header of a DBF file, I don't think I can send an exe through this medium.  I think I'll need your e-mail address in order to send an exe file attachment.  You can give me your address if you want, or wait until you begin to see the problem.  You still need to compile your program and create your indexes.  (And you're right.  Excel does exactly the same thing.  It's really a flaw in the design of dBase III Plus.  Ashton-Tate could never IMAGINE that their little program would still be running in the year 2000 - and beyond.  If I remember correctly, it handled the year 2000 correctly, but beginning with 2001 and beyond, this problem appeared.  Oddly enough the DIR command in dBase correctly shows the dates left by Excel, but the USE command does not recognize the modified file as a dBase dbf file.)
 
Tom.

Klas Engwall

unread,
Mar 26, 2017, 3:00:04 PM3/26/17
to harbou...@googlegroups.com
Hi Tom / Sudhir,
And Excel will change all kinds of things anyway so NEVER use it on a
dbf file!!!

Regards,
Klas

G3...@aol.com

unread,
Mar 26, 2017, 4:27:33 PM3/26/17
to harbou...@googlegroups.com
Hi All
 
I recompiled the DBU source files using Harbour and it runs with no problems under Windows XP and Windows 7 64bit to produce Clipper indexes. Very minor changes required to add a Main() function so that it compiles correctly.
 
Regards

Bob

Bob F Burns G3OOU, G-QRP 6907, @BobFBurns
Crystal Palace Radio & Electronics Club: www.g3oou.co.uk
Technical web site: www.qsl.net/g3oou

Sudhir Mittal

unread,
Mar 27, 2017, 1:08:40 AM3/27/17
to harbou...@googlegroups.com
Tom

Thanks for the code for creation of NTX file. 

Actually dBase III, always takes the year in a date input as 19XX.  So when we reached Y2K, I got over the problem by just adding a line of code wherever I was taking a date input

IF YEAR(DATE)<1920
   REPL DATE WITH DATE+36525
 ENDIF

This changes the year from 1917 to 2017 in the date field of dbf file.

best
Sudhir  


Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/mjKORiZei1A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-users+unsubscribe@googlegroups.com.

Tom Carpenter

unread,
Mar 27, 2017, 10:30:54 AM3/27/17
to Harbour Users
Sudhir,

Your fix for dates in your program running in dBase is not bad since you may be dealing with date fields which only have 2 digits for the year.  However, dBase is fully capable of dealing with other centuries, just so you know.  Try the following at the Dot prompt:

. SET CENTURY OFF
. ? DATE()
03/27/17
.
.
. SET CENTURY ON
. ? DATE()
03/27/2017

Long ago I put the following in my Config.db file:

CENTURY = ON

And Klas is right.  I suspect he's ALWAYS right.  Excel thinks it's smarter than you are.  It will wreck the structure of a dbf file.  I got burned by that many years ago.  Just say NO to Excel.

However, the "Not a dBase file" problem has to do with a date stored in the header of a dbf file.  It's not directly accessible via dBase.  It takes a program which can access the bytes in the dbf header to fix that problem.  That's what my program does.

Bob,  Can you send me the text you changed or added in the DBU code?  I tried compiling it and it blew up.  I'd LOVE to get that compiled with Harbour.  (Not to mention the Clipper DOT program.)

Thanks.

Tom.

Klas Engwall

unread,
Mar 27, 2017, 2:10:42 PM3/27/17
to harbou...@googlegroups.com
Hi Tom,

> Bob, Can you send me the text you changed or added in the DBU code? I
> tried compiling it and it blew up. I'd LOVE to get that compiled with
> Harbour. (Not to mention the Clipper DOT program.)

Not Bob here, but ... :-)

Check out the extras\dbu directory in the Harbour tree

Ragards,
Klas

G3...@aol.com

unread,
Mar 27, 2017, 2:59:01 PM3/27/17
to harbou...@googlegroups.com
Hi Klas
 
I sent Tom the revised DBU.PRG file and had to embed the batch files as text in the email as his email provider refused to accept my email with batch files as attachments.
 
I have found DBF Viewer 2000 to be very useful as it is a GUI equivalent to DBU.
 
Regards

Bob

Bob F Burns G3OOU, G-QRP 6907, @BobFBurns
Crystal Palace Radio & Electronics Club: www.g3oou.co.uk
Technical web site: www.qsl.net/g3oou
 
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

Koshal Agarwal

unread,
Apr 7, 2017, 11:21:08 AM4/7/17
to Harbour Users
hello sudhir , 
I am near you . you can write me or call after 20th april I may help you converting it to harbour.  Kosh...@yahoo.com

avdesh singh

unread,
May 31, 2017, 8:51:14 AM5/31/17
to Harbour Users
USE CLIPPER FOR COMPILATION AND VDOS IN PLACE OF CMD OR COMMAND.COM  . YOUR LIFETIME SOLUTION VDOS IS MAKE VIRTUAL SCREEN FOR OUR DOS PRG. FOR ANY BIT ( 32 / 64  ) AND ALT+ENTER WILL MAKE FULL SIZE SCREEN. YOU SHOULD TAKE TRAINING OF CLIPPER NEARBY.


On Tuesday, March 21, 2017 at 12:58:46 PM UTC+5:30, Sudhir Mittal wrote:

avdesh singh

unread,
May 31, 2017, 9:32:57 AM5/31/17
to Harbour Users
MITTAL JEE 

YOU GOT SUCCESS IN COMPILATION OF PRGRAMM  ( EXE. ) PL. SIR GIVE ME STEP TO START COMPILATION , I READ YOUR STORY AND YOU SUCCESS . I AM 25 YEARS SR. PROG. HAVING HOME RESPONSIBILITY AND WANTS TO STAND IN MARKET FOR HOUSE HOLD EXP. 

PL. HELP ME., THANKS

SANJEEV

unread,
Jan 20, 2019, 7:46:34 AM1/20/19
to Harbour Users
Sudhir,

Hi,

I also built some programs in dbase 3+ and want to compile in harbour.
If you have done so, can you guide me too to use it.

My dbase programs are running and are mainly used for inventory purpose of my company which is electronics instrument manufacturing firm.

Koshal Agarwal

unread,
Jan 21, 2019, 4:52:26 AM1/21/19
to Harbour Users
pls mail me at koshal_ag at yahoo.com for all ur problem solutions 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages