PDA

View Full Version : Harbour



danbaron
04-03-2011, 08:28
I downloaded and installed Harbour - over 50 MB. http://www.harbour-project.org/ I previously read that there is an IDE, but, if there is, I can't find it. I read somewhere, that on Linux, it should run, "out of the box". I think it was developed on Linux. Maybe, the IDE is there. I don't know how you are supposed to learn the language. I can find documentation showing examples, and descriptions of library functions, but, not much about the language itself. If you read the Wikipedia article, you get the impression that Harbour, is a Clipper clone. I guess you are supposed to read about Clipper, and then you will understand Harbour. I looked up Clipper. It is old. Where could someone learn it? Actually, the Wikipedia article contains more information about Harbour (the core language), than I have been able to find anywhere else. http://en.wikipedia.org/wiki/Harbour_%28software%29 (Note:, for me, the Forum editing is again malfunctioning. I cannot change the font. Formatting commands appear in the text. I insert line breaks, and they disappear when I save the post, etc. You can see, this entire post is one long paragraph, and, I didn't format it that way.)

kryton9
07-03-2011, 01:14
Thanks Dan for the link and find. I always wanted to play with clipper. But at the time I went with Paradox from Borland with their PAL language. Which I was very happy with and so never real tried clipper.

One of these weeks when I feel like experimenting, I definitely will try this out.

matthew
08-03-2011, 15:42
I downloaded the nightly version of Harbour yesterday, inside the bin folder there is a file called hbide.exe which is the IDE. However I couldn't get it to run because I don't think it comes with the necessary Qt libraries so I downloaded another version from here (http://hbide.vouch.info/).

danbaron
09-03-2011, 07:57
I don't know why, but my version did not have hbide.exe in the bin directory.

But, now I am downloading it from the link that you found.

I am still doubtful about being able to find documentation for the core Harbour language. As I said above, the most documentation I have been able to find about the core language, is on the Wikipedia page, and, that isn't much. The documentation on the Harbour home page only contains a reference guide, not a user's guide. The doc directory that comes with the implementation does not contain much useful for learning Harbour's syntax and constructs, as far as I can determine. So, how does a person learn the language? I have found this to be a significant problem with some languages that might be very good. For many potential users, if there is no tutorial that teaches about the language itself, then, frustration quickly sets in. Aren't languages generally difficult to learn from only a reference guide and example code?

:o

zlatkoAB
09-03-2011, 09:24
Dan
I agree with you,Harbour documentation is very poor especialy
about GUI windows programming.
By the way on GGroups mailing list one guy ask question about
simple GUI example with win32 api and anothere answer this:

I've developed a basic application (for tests only) using the native
features of Windows. It's hard, but you can ... In real life, is more
easy use the resources of an GUI library like hwGUI or MiniGUI.
What kind of answer is that?

danbaron
09-03-2011, 10:31
I got the IDE to run. So, I loaded a file from the Harbour examples directory, the misc sub-directory, called, "guess.prg". I tried to compile it. Here is the output from the attempted compilation.

----------------------------------------------------------------------------------------------------
Project [ C:/hb20/examples/misc/guess.prg ] Launch [ No ] Rebuild [ Yes ] Started [ 23:50:21 ]
----------------------------------------------------------------------------------------------------
Batch File Exists => C:\Users\root\AppData\Local\Temp\zavu8u.bat
Batch File Contents =>
hbmk2 -q -trace -info -lang=en -width=0 -rebuild -s C:\hb20\examples\misc\guess.prg
Command => C:\Windows\system32\cmd.exe
Arguments => /C C:\Users\root\AppData\Local\Temp\zavu8u.bat
----------------------------------------------------------------------------------------------------
CurDir() => hbIDE Starting in => C:\hb20\examples\misc\
C:\hb20\examples\misc>hbmk2 -q -trace -info -lang=en -width=0 -rebuild -s C:\hb20\examples\misc\guess.prg
'hbmk2' is not recognized as an internal or external command,
operable program or batch file.
----------------------------------------------------------------------------------------------------
Exit Code [ 1 ] Exit Status [ 0 ] Finished at [ 23:50:22 ] Done in [ 0.90 Secs ]
----------------------------------------------------------------------------------------------------

To me, this result is not very encouraging.

------------------------------------------------------

About the GUI, Aurel, I'm not exactly sure what you mean. First of all, I know little about GUIs, I really have never had much interest in them. I have seen books about the Windows API, and, in my opinion, they are confusing. Over the years, many times I have read that programming the Windows API is difficult. I'm guessing that for you, programming it is not very hard.

But, apparently, for other people it is hard. For PowerBASIC, they have PowerBASIC Forms. Also, EZGUI, made by Chris Boss. I remember that Chris Boss wrote that it took him years to fully understand the Windows API. Also, Firefly. All three are built on top of the Windows API.

Microsoft apparently, also doesn't like the Windows API. They have made, .NET Windows Forms. How long before the Windows API will no longer be included as part of Windows? How long before you will have to download it separately?

And, how many other GUI libraries are there? Like wx, Tk, Qt, etc.

On Linux, there is no Windows API. I think there is either KDE or GNOME. And guess what?, the sun still rises every morning!

Actually, I much prefer Linux over Windows, for a variety of reasons.

Even with Windows 7, I still think Linux is more stable.

Also, of course, Linux is open source, not proprietary.

Who wants to use a proprietary operating system?

It seems to me that with Linux, you can always find an answer. But, with Windows, you may never find an answer, because, the source code is guarded like an ocean filled with crude oil. Additionally, Microsoft is in business to maximize their profit. They don't care one bit about programmers. They care about addicting the masses to using their operating system. That is why Windows is now built almost entirely for multimedia. Additionally, with Linux, a programmer knows that it will remain fundamentally the same into the distant future. On the other hand, Microsoft will instantly change Windows depending only upon which way the profit wind is blowing, without one thought for all of the programmers who are devastated by their decisions. Apple functions in exactly the same way - guess what?, in order to be able to use the new operating system, you'll have to buy a new computer - too bad! Always, you have to buy a faster system with more RAM, or, you're left behind. Actually, it's the same with every technological product. Make it to either quickly break, or to quickly become obsolete, so that the people must continually buy things again and again at ever decreasing intervals, in order to continue to be able to do what they need and want to do.

I would be happier if everyone moved over to Linux, then, we would remember Windows, only in our nightmares.

:p

zlatkoAB
09-03-2011, 11:23
Dan
I dont espect from you this type of answer....?
This topic is about Harbour and not about which OS is better or not.
I dont agree with you in many things which you say now.
Personaly WinAPI is great way for programming and i like how work.
Linux dont have native GUI subsystem and becose of this i dont like
linux to much.
For me programming on linux looks like a nightmare-belive or not.

matthew
09-03-2011, 11:52
Hi Dan I don't know if you've solved the new problem you're having with hbmk2.exe but if you haven't I believe all you need to do is add the location of your Harbour bin directory to your PATH environment variable.

In the case of my computer that would be... C:\hb21\bin

There's a forum here (http://hmgforum.com/) which I recently joined which provides a lot of help with the Harbour language. They don't tend to use HBIDE however but prefer MiniGUI (http://sites.google.com/site/hmgweb/) instead.

zlatkoAB
09-03-2011, 12:45
That is what i dont like with all this languages ,it force you to use some
third party GUI-s.
I want on windows use native win32 api...
Which present native look & feel of windows app.

danbaron
09-03-2011, 22:50
I always go off topic, Aurel. That's part of my personality. I can't change myself. I didn't intend to offend you.

My experience is that sooner or later many people learn the hard way, that the institutions to which they have allegiance, have no allegiance to them. In my opinion, this especially includes governments and corporations.

I'm wasn't saying there is anything bad about the win32 api, I was just saying that a lot of people must think it is difficult, or else there would not be so many products which overlay it, and attempt to simplify its use. Even thinBasic does that, doesn't it?

I hope that the win32 api continues on far into the future. I have no interest in .NET. But, I think that Microsoft does. And, it seems to me that even disregarding .NET, most likely before long, instead of the win32 api, there will at least be the win64 api, which will probably be significantly different in functionality. Remember, that originally, Windows was 16 bit, now it is 32, and is in the process of transitioning to 64. 16 bits is long gone. At some point, so will be 32 bits.

(But, Linux will never betray you. It has no motive to do so.)

---------------------------

That's good then, Matthew. I will set the path, and look at the forum. And, maybe get MINIGUI. It seems that you are removing Harbour from my junk pile.

Now I have to hurry to catch the train.

Dan

danbaron
10-03-2011, 08:52
I put c:\hb20\bin on my path.

(Maybe I need hb21, like you have.)

But anyway, I still get an error message when I try to compile the file. Here is the new one.

----------------------------------------------------------------------------------------------------
Project [ C:/hb20/examples/misc/guess.prg ] Launch [ No ] Rebuild [ Yes ] Started [ 22:35:47 ]
----------------------------------------------------------------------------------------------------
Batch File Exists => C:\Users\root\AppData\Local\Temp\nltaxp.bat
Batch File Contents =>
hbmk2 -q -trace -info -lang=en -width=0 -rebuild -s C:\hb20\examples\misc\guess.prg
Command => C:\Windows\system32\cmd.exe
Arguments => /C C:\Users\root\AppData\Local\Temp\nltaxp.bat
----------------------------------------------------------------------------------------------------
CurDir() => Users\root\Desktop Starting in => C:\hb20\examples\misc\
C:\hb20\examples\misc>hbmk2 -q -trace -info -lang=en -width=0 -rebuild -s C:\hb20\examples\misc\guess.prg
hbmk2: Autodetected platform: win
hbmk2: Autodetected C compiler: mingw
hbmk2: Using Harbour: C:\hb20\bin C:\hb20\include C:\hb20\lib\win\mingw
C:\hb20\lib\win\mingw
hbmk2: Using C compiler: C:\strawberry\c\bin\gcc.exe
hbmk2: Processing configuration: C:\hb20\bin\hbmk.cfg
hbmk2: Compiling Harbour sources...
hbmk2: Harbour compiler command (embedded):
(C:\hb20\bin\harbour.exe) -n2 C:/hb20/examples/misc/guess.prg -q -width=0 -s -o.hbmk\win\mingw\ -iC:/hb20/include
Error F0034 Bad command line option 'width=0'
hbmk2: Error: Running Harbour compiler (embedded). 1
(C:\hb20\bin\harbour.exe) -n2 C:/hb20/examples/misc/guess.prg -q -width=0 -s -o.hbmk\win\mingw\ -iC:/hb20/include
----------------------------------------------------------------------------------------------------
Exit Code [ 6 ] Exit Status [ 0 ] Finished at [ 22:35:48 ] Done in [ 1.47 Secs ]
----------------------------------------------------------------------------------------------------

The error seems strange to me. A bad option to harbour.exe, "-width=0". But, who put that option there? It wasn't me. I guess it probably came from the IDE (hbide.exe), so, I can't blame Harbour itself.

------------------------------------

Matthew, I think your link for MINIGUI, is actually for HMG.

http://sites.google.com/site/hmgweb/

HMG comes with an IDE. I guess it can compile Harbour.

From HMG, here is a guide to Clipper, which is apparently compatible with Harbour.

http://sites.google.com/site/hmgweb/documentation

I think that MINIGUI is here.

http://www.minigui.org/whatis.shtml

------------------------------------

Almost everything about "Seed7", which Aurel found, looks interesting and good to me.

http://seed7.sourceforge.net/

The only thing lacking that I see, is an IDE.

The documentation looks very good.

It appears to be both an interpreter, and a compiler.

If you download the source, then, you will have to compile it, but, the download is only 1.5 MB.

If you download the binary for Windows, the download is 22.5 MB.

The choice is yours.

:p

matthew
10-03-2011, 13:40
Yeah Dan I think the link is incorrect, to be honest I think a lot more people would be using Harbour if the learning resources regarding the language & the various IDEs were better labelled on the Internet, otherwise it can be quite difficult knowing where to start.

As for the error you're having, according to this (http://lists.harbour-project.org/pipermail/harbour/2010-April/035408.html) I believe it's caused by using a newer version of HBIde with an older version of Harbour.

danbaron
10-03-2011, 14:24
Pretty good, Matthew, pretty good.

I'll have to download the absolute latest version of Harbour.

:p
Dan

zlatkoAB
10-03-2011, 17:33
Dan
Don't worry there is no problem at all...
I understand your point about Linux but from hoby programmer point
i see linux very tuff to use.Windows is far is far simplier and easier
to understand how work.
Linux have to to ...many options and this couse confusion.
For example if you made program that require wX library i must have
wx installed on my computer,if you have Qt based program i must use
KDE etc...etc...and complexity just rise and rise...
And becose of this linux never be popular like windows especialy for
games.

danbaron
11-03-2011, 02:25
I do think that the power of all of the programmers working together can make a better operating system than Microsoft or Apple can. I think that sooner or later, good triumphs over evil, Open Source free software triumphs over proprietary, "pay to play", software. Most people are good, and good people hate monopolies.

I think that Linux needs and will get some type of unification, standardization, a federation to choose one GUI, for instance.

I absolutely agree that as of today, many programs must be compiled specifically for the particular Linux distribution. And, of course you are exactly correct about all of the different GUI libraries that are currently in use.

But, even today, every time I look at distrowatch ( http://distrowatch.com/ ), I get excited, and want to get another machine just for Linux.

(And, previously, I think it was Mike Clease who posted links to articles about a new Amiga computer, that would use the latest version of the Amiga OS. I like ideas like that. People who like to program computers could make an Open Source OS, just for the things they want to do. It doesn't need to be so big that it requires 500 GB to load. I think all it needs is a standard GUI, and the ability to connect to the internet. An extra benefit would be, that you probably wouldn't have to worry about viruses or identity theft.)

:bom:

zlatkoAB
11-03-2011, 12:50
I think all it needs is a standard GUI, and the ability to connect to the internet.
That is the main point in whole story.
And this is the main problem with linux but unfortunatly many hard-core
users and linux programers think that is current state better option.
I dont know is this people blind or stupid or something else.
And becose of this i doubt that this will hepend soon.

zak
11-03-2011, 18:10
i have noticed that many (and not all) of the Linux users look to windows users as if they are naive , and they disrespect them, this resembles how apple Mac users was looking to the poor pc users in the old times when the mac computer are very expensive, the web are full with such behaviour, as an example : when a perl user ask a linuxer to suggest how to use his example which runs okay on linux but not on windows he said:
[ since Microsoft expects me to pay for their inferior software, i would expect to be paid to write software for it..... so it appears that you tallulah have been chosen to solve the problem on win32.. good luck...

....i wish tallulah would get a decent OS, like Ubuntu linux.. :-) ]
look http://www.perlmonks.com/?node_id=808434

also i remember in a forum a user said that he is using mainly windows 7 and linux in another partition as a secondary one, a linuxer said with angry why not use only linux and forget windows forever... .

i agree that linux sure have surpass over windows in specific pro area like servers, but it is not usefull as a general purpose OS.
you can install any windows software with just clicking on the setup while you are in linux as Aurel said you need to read too much how to install other related and necessary libs, so rather than focusing on just driving the car you are first must study its engine and how it works , not practical at all.

the most friendly linux is linux mint which is a flavor of Ubuntu which can be installed from within windows 7 by clicking on mint4win.exe in the DVD as explaind here:
http://community.linuxmint.com/tutorial/view/52
you do not need item 2 in that page, just burn the iso on DVD
then the mint4win.exe will install linux inside a folder in C:\ , and when you reboot there are two choices either to load windows 7 or Linux mint. i have uninstalled this linux before 2 days. to reserve the disk space.

zlatkoAB
11-03-2011, 19:41
Good point Zak...
Yes Mint is good step forward but still cannot replace Windows.
Oh my yes Ubuntu -> i really dont understand what so called big
linuxers see in this distro-> big,slow,ugly properthy of Canonical etc.
Infact i see Ubuntu what linux not can be.
I prefer small distros like Slitaz-> 30mb ISO.
This small distro represent what linux must be -> small & fast lightwight
OS.
Maby one day linux authors figured why linux is not popular like windows.

danbaron
11-03-2011, 22:40
It's absolutely true.

Today, Windows is 10 times easier to use than Linux.

Like zak said, today, the difference between Windows and Linux can be compared to owning a car. For Windows, you just get in and turn the key. For Linux, you need to be an auto mechanic, you need to own an auto mechanic's shop, you need to have a lift to raise the car, you need to own every manual written for your particular car. You need to be able and willing to use a great amount of time and energy working on your car, etc. And, if you don't have all of that, and can't do all of that, then, those who have and can, will insult you.

Isn't the situation still the same for Apple? You still have to pay much more for its proprietary hardware? A long time ago, Steve Jobs left Apple, and formed Next. During that period, Apple allowed other companies to make computers which ran the Apple OS. And, the prices for computers that ran the Apple OS, began to decrease. Then, Next began to sink, I think, Apple bought Next, and Steve Jobs came back to Apple. (I think that Next's OS was basically Unix, and now, underneath, so is Apple's.) The first thing he did when he came back was to stop permitting other companies to make Apple OS compatible computers. Then, I think, the price of Apple computers, went up again. Apple always did, and still probably does encourage the snobbish attitude which many of its users have. It's a psychological trick to make the people who pay more for Apple's products, believe that since they can and do pay more, they must be better than everyone else.

:x

Actually, you see that attitude everywhere in this capitalistic world. Those who have more money, are convinced that having more money is objective evidence that they are intrinsically better than anyone who has less, and so, they deserve more than anyone who has less. The extreme version of that attitude is evident in billionaires who live out their lives in obscene luxury, and haven't the slightest care that over one billion people live on less than one dollar per day. Many of them don't even care that they may leave this planet destroyed for their own descendants. To me, no other species is near capable of treating its own members so awfully. It is amazing to me - terribly amazing. Think about how often the absolute worst people, the charming psychopaths, gain power and unleash misery and death on millions, without even the tiniest pang of conscience. (Many rich and famous people are shocked if and when they ever realize, that they are constructed from exactly the same material as everyone else.)

:offtopic: