HB_FUNC() SYNTAX

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

HB_FUNC() SYNTAX

Post by jairpinho »

Hello, where can I find documentation about the hb_func () function, the types of variables and parameters accepted among other information. where does this function come from? harbour?
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: HB_FUNC() SYNTAX

Post by bpd2000 »

Hi
HB_FUNC... used when embedding C-code into .prg file
In the Harbour there is a possibility to insert fragments of C code in the prg file. This may be conveniently, if you don't want to create a .c file for a pair of C functions and then putting it in the project. This can be done with the help of directives #pragma BEGINDUMP ... #pragma ENDDUMP.
HB_FUNC...
{
// C/C++ code
}
#pragma ENDDUMP

Code: Select all

#pragma BEGINDUMP
   #include < extend.h >
   #include < math.h >
   HB_FUNC( SIN )
   {
      double x = hb_parnd(1);
      hb_retnd( sin( x ) );
   }
#pragma ENDDUMP
refer: http://www.kresin.ru/en/hrbfaq_3.html#Doc7
also refer: https://github.com/Petewg/harbour-core/wiki/et-cetera
BPD
Convert Dream into Reality through HMG
Post Reply