Universo Online
Web Sites 
                  Pessoais

 

Welcome the page of the Howto
Harbour Project!

This page will have varius subjects of how to use [x]harbour.

Doubts and diferences between Harbour and Clipper is commented here

How to of Harbour in English
Indice

1 - As I create in program to show Hello Brazil in the screen

2 - As To use a Related Tbrowse

3 - As to compile the [X]Harbour of the Sources


4 - As to print in [X]Harbour



It asks One: As I create in program to show Hello Brazil in the screen


It creates a small program that contains the following lines and it nominates it of hellobr.prg

  • Function Main
  • "Hello Brazil"
  • return Nil

Now we go to compile hellobr.prg(I assume that the compiler Borland C++ this installed >

  • Using an archive bat
  • uses Bld_b32 Hellobr
  • hellobr

  • Using the command line
  • Harbour - n - m hellobr.prg
  • For not need to type always places the following line in its autoexec.bat
  • Set HBLIB=rtl.lib lang.lib vm.lib macro.lib pp.lib common.lib gtwin.lib rdd.lib dbfcdx.lib dbfntx.lib
  • bcc32 - the -5 - tW hellobr.c %HBLIB%

[to Top ------ ]
 


Question 2: As To use a Related Tbrowse

  • First tbrel.zip for windows/DOS/OS2 or tbrel1.zip for linux lowers the source
  • later It compiles the system as suggested in question 1.
  • This topic, has also samples of how to use the following RDD: The RDDADS and the DBFCDX. See the program source code on how to use usalos

[to Top ------ ]
 


Question 3: As to compile the Harbour of the Sources

To compile harbour from the sources you needs

  • Of the Sources that can be lowered Here
  • If you use the LibCT, or the nanfor in its program lowers the source of the contribution Here
  • Of the Bison program that can be lowered here and unpacks it in c:\bison
  • Of Following Envars must be set in autoexec.bat(on NT/2K/XP on autoexec.nt)
    SET HB_LEX=SIMPLEX
    SET BISON_SIMPLES=c:/bison/bison.simple
    SET CFLAGS = -5 - - A8
    SET PATH=%path%;c:\bison

Installed the Sources:
  • 1 - It creates a called diretorio Harbour, if you ja has it makes you anger to bring up to date its distribution harbour
  • 2 - The following pkunzip command unpacks the sources using - d c:\harbour(windows) in the case of linux uses unzip zip - d/usr/local/harbour
  • 3 - If you lowered the contribution package creates a diretorio of name contrib (c:\harbour\contrib) and desconpacte the sources of contribui‡Æo for this diretorio and in the case of linux uses unzip zip - d/usr/local/harbour/contrib
  • 4 - it compiles the sources using the command make - fmakefile.bc(for Borland C++ 5,5, or only make for Linux and Djgpp)
  • 5 - Apos the compilation, installs the binarios with make_b32 (for Borland C++ 5,5) or make install (Linux or DJGPP)
  • 6 - you has now finishes it version of harbour

[to Top ------ ]
 


4 - As to print in [ x]Harbour

In The Linux
Windows
function main()

place OUTRACImp: = "deskjet"
place TEMPCFile: = strtran(Time(), ":")+'.tmp '
/* Directing the exit for the archive */
set to printer on
set console off
set to printer you (TEMPCFile)
/* Printing (for the archive) */
qout("Test of impressao")
qout("Test of impressao")
qout("Test of impressao")
qout("Test of impressao")
/* Incapacitating the exit for the archive */
set to printer off
set console on
/* Printing in the printer default (generally "lp")
*/
__ run("lpr "+ TEMPCFile)
/* Printing in one another printer */
/* run("lpr - P "+ OUTRACImp +" "+ TEMPCFile) */
return(nil)
function main()

# ifdef __ XHARBOUR __
place OUTRACImp: = GetPrinters()[1,1 ]
# else
place OUTRACImp: = "LPT1"
# endif
set to printer on
set console off
# ifdef __ XHARBOUR __
set(24, "WIN:"+OUTRAImp)
# else
set to printer you (OUTRACImp)
# endif
/* Printing (for the archive) */
qout("Test of impressao")
qout("Test of impressao")
qout("Test of impressao")
qout("Test of impressao")
/* Incapacitating the exit for the archive */
set to printer off
set console on
/* Printing in the printer default (generally "lp")
*/
return(nil)

The information below, had been sent by
Mike Maciel




1 - Installing and configuring the HARBOUR with BCC 5.5
1.1 - Creating the archive bcc32.cfg
1.2 - Creating the archive ilink.cfg
1.3 - Modifying the Autoexec.bat

2 - Using the Harbour
2.1 - Creating our first program
2.2 - Generating, Compilando and Linkando the code

3 - Download of the examples of the configuration archives

4 - Main errors, possible causes and solutions

1 - Installing and configuring the HARBOUR with BCC 5.5

It unpacks the Harbour in the C:\Harbour folder . Soon after, you it will have to install the Borland C Copiler 5.5. For this, it executes the installation, and when to ask for the place of the installation modifies standard C:\BORLAND\BCC55 for C:\BCC55 (he is not obligator, but this will facilitate in the hour to configure paths in autoexec.bat).

After installed the Harbour and BCC 5,5, we will go to create the archives of configuration of BCC 5,5, and to edit the AUTOEXEC.BAT. If it does not scare! It is easy as to say behind Pindamonhagada for front (... rs...)  

1.1 - Creating the archive bcc32.cfg

This is the archive of configuration of the BCC. In it you will inform the ways for directory/LIB and/INCLUDE of the BCCe of the Harbour. For this, it opens the Note Block, and types the following one:

- Ic:\bcc55\include;c:\harbour\include
- Lc:\bcc55\lib;c:\harbour\lib

Now it saves the archive in directory C:\BCC\BIN , with the name of bcc32.cfg . This will make with that the compiler looks the Libs and Includes in the directories of the BCC and the Harbour.

1.2 - Creating the archive ilink.cfg

Here we will go to create the archive of configuration of the linkador of the BCC. For such, we will use the Note Block again. It opens a new archive and it types:

- Lc:\bcc55\lib;c:\harbour\lib

Now it saves it in directory C:\BCC55\BIN with the name of ilink32.cfg . This archive will make with that the lincador of the BCC looks for for libraries in directories/LIB of the BCC and the Harbour.

1.3 - Modifying autoexec.bat

Again we go to use the Note Block for this task. It goes in Archive, To open..., and types " C:\AUTOEXEC.BAT " (with the quotations marks) in the box of text Name of the Archive .
Opened autoexec.bat , we will go to add two directories in path. For this it adds the following lines in the end of autoexec.bat .

PATH=%PATH%;C:\BCC55\BIN;C:\HARBOUR\BIN

It saves the archive.
It will be necessary now, to restart the computer so that the alterations in path are validated.

2 - Using the Harbour

2.1 - Creating our first program

After (hard) the process of configuration, we go to compile our first program. He will be something simple (the celebrity Hello, World). For this, it opens the Prompt of the DOS. Will have to appear this:

Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1999

C:\WINDOWS >

Root goes for the directory, typing COMPACT DISC \

Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1999

C:\WINDOWS > COMPACT DISC \

C: \ >

Now it creates a directory. In the example we go to create directories called HBTEST, but you can change the name for any another one that to find necessary. He types the commands:

MD\HBTEST
CD\HBTEST

It will go to be thus:

Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1999

C:\WINDOWS > COMPACT DISC \

C: \ > MD\HBTEST

C: \ > CD\HBTEST

C:\HBTEST >

Teste.prg creates an archive with the name . This will be the code source of our program. To create it you it will be able to use any publishing American National Standard Code for Information Interchange (text without formatting) of its preference. I suggest the EDIT, of the MSDOS. To use he edits it, types in prompt of the one Of:

edit teste.prg

He types the following code below for our program:

/* Testing the HARBOUR. */

function main

    to clear screen
    " HEllo, World! "
    quit
return nil

/* This and ' the end of our test */

It saves the archive and skirt of the publisher.

Attention!
The first function to be executed in our program will be always the first function declared in the archive source.

2.2 - Generating, Compilando and Linkando the code

Edited the code of our program, we now go to generate   source C to leaving of our source PRG. For this it types:

HARBOUR /N /M teste.prg

If everything to give certain will go to appear something more or less thus:

Harbour Compiler Alpha build 38.0 (Flex)
Copyright 1999-2002, http://www.harbour-project.org/
Compiling 'teste.prg'...
Lines 11, Functions/Procedures 2
Generating C source output to 'teste.c'... Done.
Attention: It is important that parameters/N and/M always are informed.

Generated the archive teste.c, we will go then to compile it and to linkar it. It is there that the BCC will enter in action. The Harbour supplies a lot archive (extension BAT) that it facilitates the work. For this it types:

bld_b32 teste.c

It will go to appear more or but this:

Borland C++ 5,5,1 will be Win32 Copyright (c) 1993, 2000 Borland
teste.c:
Incremental Turbo Link 5,00 Copyright 9c) 1997, 2000 Borland
C:\HBTEST >

Soon! Now it is alone to execute our program!

3 - Download of the examples of the configuration archives

Available here for Download the cited examples above. To lower them, click on link with the right button of mouse and selects To save destination as..., remembering that the archives bcc32.cfg and ilink.cfg must be placed in directory/ BIN of the BCC.
ATTENTION! For security guard questions, the archive example of autoexec.bat is in format TXT (text without formatting)

ARCHIVE EXAMPLE DESCRIPTION
bcc32.cfg Example of the archive of configuration of compiler BCC 5.5
ilink.cfg Example of the archive of configuration of the linkador.
autoexec.txt Example of the alterations made in autoexec.bat
teste.prg Code source of the cited example above

 

4 - Modifying config.sys

If vocˆ receives the message Without space from environment, you needs to insert the line below in config.sys

Shell=c:\windows\command.com/e:2048/p.

4 - Main errors, possible causes and solutions

ERROR POSSIBLE CAUSE SOLUTION
When I type command HARBOUR nome_do_arquivo, appears the message Command or name of invalid archive - the Path (way) was not configured correctly in autoexec.bat
- autoexec.bat Edits, indicating the correct way.
When compiling the source C as bld_b32, appears some messages of error - the archives bcc32.cfg and ilink.cfg had not been created.
- the archives bcc32.cfg and ilink.cfg had not been configured correctly
- It creates the archives above as explained.
- It configures the archives correctly, as explained above.
I obtained to generate the program,   but when executing it polishes a line and only returns to prompt - parameters/N/M for the HARBOUR had not been informed - It generates sources C again, using nome_do_arquivo command HARBOUR/N/M.
Error of environment space - Error when configuring harbour - config.sys Sees the section modifying.

More News...



[Source Forge]

More News

You finish The News
Dave's news


The Previous News

2ø quarto 2000
1 quarto 2000
4ø quarto 1999
3ø quarto 1999
2ø quarto 1999

 

Ultimo build:
Alpha 39 - 2002-03-14

Ingles | Espanhol | Polones

Last updated on 2002/06/04