how to link prg files in mod harbour
Posted: Thu Aug 08, 2019 2:08 pm
From slack
Otto Atzwanger 15:06 Uhr
Antonio, can you please tell me how I link in different prg files in mod harbour.
I mean if I have a prg with universal functions in it how do I access this prg file from my index.prg.
Antonio Linares 15:08 Uhr
Otto compile it as a HRB file then as the first line of your PRG write this:
much better... review samples/plugin.prg
thats the working example
// {% LoadHRB( "testhrb.hrb" ) %}function Another() Test()return nil
Otto Atzwanger 15:14 Uhr
I do not know what hrb is.
BTW is compiled code working even faster?
Antonio Linares 15:15 Uhr
When you compile a PRG you can tell Harbour to generate a HRB file instead of a C file
yes, much faster
Charly has done some tests and from 200 milliseconds, when we use HRB files, we reach 2 milliseconds only
also it has the advantage that there are no errors
if Harbour generates a HRB file then it means the syntax, everything, is correct
Please test mod_harbour/samples/testhrb.prg and testhrb.hrb
it is the same code, as PRG and as HRB
to generate a HRB file we do (it is explained inside testhrb.prg)
harbour -gh -n testhrb.prg
A HRB file is a binary file that contains the local symbol table and the pcode, already compiled and ready to be used
mod_harbour supports HRB files, same as PRGs
this way developers can protect their code
Thank you Antonio and best regards
Otto
Otto Atzwanger 15:06 Uhr
Antonio, can you please tell me how I link in different prg files in mod harbour.
I mean if I have a prg with universal functions in it how do I access this prg file from my index.prg.
Antonio Linares 15:08 Uhr
Otto compile it as a HRB file then as the first line of your PRG write this:
much better... review samples/plugin.prg
thats the working example
// {% LoadHRB( "testhrb.hrb" ) %}function Another() Test()return nil
Otto Atzwanger 15:14 Uhr
I do not know what hrb is.
BTW is compiled code working even faster?
Antonio Linares 15:15 Uhr
When you compile a PRG you can tell Harbour to generate a HRB file instead of a C file
yes, much faster
Charly has done some tests and from 200 milliseconds, when we use HRB files, we reach 2 milliseconds only
also it has the advantage that there are no errors
if Harbour generates a HRB file then it means the syntax, everything, is correct
Please test mod_harbour/samples/testhrb.prg and testhrb.hrb
it is the same code, as PRG and as HRB
to generate a HRB file we do (it is explained inside testhrb.prg)
harbour -gh -n testhrb.prg
A HRB file is a binary file that contains the local symbol table and the pcode, already compiled and ready to be used
mod_harbour supports HRB files, same as PRGs
this way developers can protect their code
Thank you Antonio and best regards
Otto