FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour HIX Vrs. 1.1 - Pluggins
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
HIX Vrs. 1.1 - Pluggins
Posted: Mon Nov 10, 2025 06:21 AM

Hi,

Version 1.1 has the new loader command. This lets us pre-load stuff when we start up the server - different PRG/HRB files with functions that we can use in our program.

For example: I've got an index.html file where I inject some PRG code. In that code, I'm calling a function called mylib1().

Code (harbour): Select all Collapse
<html>
<h1>Loading modules</h1><hr>

<?prg 
    local cHtml := mylib1()
	
retu cHtml 
?>
<hr>

So, if I haven't defined this function in Harbour, HIX will throw an error saying it doesn't know what this function is.

I'm going to create 2 files with functions that I'll use in my app.

mylib1.prg

Code (harbour): Select all Collapse
function mylib1()
retu mylib2()

mylib1() calls a function mylib2() that will be in another file.

mylib2.prg

Code (harbour): Select all Collapse
function mylib2()
retu 'From mylib2() => ' + dtoc(date()) + ' ' + time()

Now the only thing left is to use the "loader" command to tell it to load these modules on startup.

Code (harbour): Select all Collapse
   Root: /        Description 
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
   mylib1.prg     Test lib1 
   mylib2.prg     Test lib2

When we start the server, the page will run properly.

Now HIX can run modules in HRB format. This means that if we specify .hrb files in the loader, HIX will automatically handle it - if there's a same-named .prg file, it'll load, compile, and save it. This way we can create our HRBs without worrying about the process. And when we publish the app, we could protect the PRG source code by only distributing the HRB files!

C.

Salutacions, saludos, regards

"...programar es fรกcil, hacer programas es difรญcil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 18
Joined: Wed Feb 12, 2020 04:55 PM
Re: HIX Vrs. 1.1 - Pluggins
Posted: Mon Nov 10, 2025 11:08 AM

Muy bueno. Gracias

Posts: 141
Joined: Fri Feb 15, 2019 01:37 PM
Re: HIX Vrs. 1.1 - Pluggins
Posted: Mon Nov 10, 2025 03:54 PM

Charly Excelente

Corriendo Perfectamente.

Posts: 141
Joined: Fri Feb 15, 2019 01:37 PM
Re: HIX Vrs. 1.1 - Pluggins
Posted: Mon Nov 10, 2025 04:08 PM

Continue the discussion