Filename Chars

97 views
Skip to first unread message

Tremaine Parsons

unread,
Sep 14, 2021, 1:22:31 AMSep 14
to Harbour Users
I recently discoverd Harbour and was writing a batch file processor to convert legacy  .dbf's to a new file format that a ported program uses. A few of the early distributed sample.dbf files had a $ in the file name and Harbour does not like that and chokes. App went from Clipper + Flipper to DBFast + Flipper to Javascript + AMCharts running in a browser.

C9O$.DBF

Any other characters I should watch out for? Or is there a switch?

I'm using Harbour 3.0.0 Windows Unified Release.

Wish I had found Harbour several years ago. I'm very impressed. Well done by all!


Klas Engwall

unread,
Sep 14, 2021, 3:29:41 AMSep 14
to harbou...@googlegroups.com
Hi Tremaine,
It is not actually the file name that is the problem. Harbour can handle
any file name that the OS allows. But the difference between DBF files
and other files is that an automatic alias for the DBF file is created
when it is opened. And aliases follow the rules for variable names
(letters, digits, underscore). But there is no need to rename those
files, an easy way around the problem for files like the one you
mentioned is to supply a "legal" alias when you open the file:

use C90$ alias C90

BTW, Harbour 3.0 is very old and hardly used by anyone anymore. The 3.2
nightly version is what most of us use nowadays. It is not specifically
labeled as "stable" but it is in fact much more stable and much more
advanced than 3.0

Regards,
Klas

Tremaine Parsons

unread,
Sep 14, 2021, 12:42:04 PMSep 14
to Harbour Users
Thank you Klas,

I was using a for next loop do step through an array of dbf filenames
with:
mfilename = filelist[i]
use &mfilename

changed it to use &mfilname alias tempfile

worked like a charm.

I can find Harbour 3.2 on github but it has been a while and I don't know how to deal with binaries.

Thanks again,

Tremaine

Klas Engwall

unread,
Sep 14, 2021, 1:43:57 PMSep 14
to harbou...@googlegroups.com
Hi Tremaine,

> Thank you Klas,
>
> I was using a for next loop do step through an array of dbf filenames
> with:
> mfilename = filelist[i]
> use &mfilename
>
> changed it to use &mfilname alias tempfile
>
> worked like a charm.

Great :-)

> I can find Harbour 3.2 on github but it has been a while and I don't
> know how to deal with binaries.

If "deal with binaries" means compile the Harbour sources to binaries,
then download the ready-to-use binaries from:

https://sourceforge.net/projects/harbour-project/files/binaries-windows/nightly/

There is one .exe version complete with installer and one .7z version
that you extract into a directory of your choice (a clean directory, not
the one where you have 3.0). Then make sure to change your PATH to
include MinGW's bin directory and Harbour's bin\win\mingw directory in
your path. You probably have that already for 3.0 so just change it to
the 3.2 location. I suppose you use MinGW ... that is what the nightly
is compiled with.

And check so 3.0 and 3.2 are not mixed in the path or you will run into
strange problems.

Additionally, the sources from GitHub are a good learning tool to have
on your local system.

Regards,
Klas

Tremaine Parsons

unread,
Sep 14, 2021, 2:14:17 PMSep 14
to Harbour Users
Thank you so much! That all makes sense and I downloaded both the win.exe and the 7z

Getting ahead of myself but do you happen to know if you can make a 64 bit executable if working on a 32bit box?

Tremaine

Klas Engwall

unread,
Sep 14, 2021, 6:58:28 PMSep 14
to harbou...@googlegroups.com
Hi Tremaine,

> Thank you so much! That all makes sense and I downloaded both the
> win.exe and the 7z
>
> Getting ahead of myself but do you happen to know if you can make a 64
> bit executable if working on a 32bit box?

The general answer is yes, but it is not something I have tried. As far
as I know the precompiled downloads do not include MinGW64, so you would
probably have to download that and then build 64-bit Harbour yourself.
You can study README.md in the root directory of the download for
instructions. Or maybe someone else will jump in with the details.

Regards,
Klas
Reply all
Reply to author
Forward
0 new messages