Page 1 of 1

HIX Vrs. 1.1 - Pluggins

Posted: Mon Nov 10, 2025 6:21 am
by Carles

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: Select all | Expand

<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.

Image

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

mylib1.prg

Code: Select all | Expand

function mylib1()
retu mylib2()

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

mylib2.prg

Code: Select all | Expand

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: Select all | Expand

   Root: /        Description 
════════════════════════════════════════
   mylib1.prg     Test lib1 
   mylib2.prg     Test lib2

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

Image

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.


Re: HIX Vrs. 1.1 - Pluggins

Posted: Mon Nov 10, 2025 11:08 am
by asesormix

Muy bueno.
Gracias


Re: HIX Vrs. 1.1 - Pluggins

Posted: Mon Nov 10, 2025 3:54 pm
by Adolfredo Martinez

Charly Excelente

Corriendo Perfectamente.


Re: HIX Vrs. 1.1 - Pluggins

Posted: Mon Nov 10, 2025 4:08 pm
by Adolfredo Martinez

Image