Set a specific starting function
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Set a specific starting function
Dear friends, is there a way to set a specific starting function (ie. different from the first function of the first PRG)?
- carlos vargas
- Posts: 1721
- Joined: Tue Oct 11, 2005 5:01 pm
- Location: Nicaragua
Re: Set a specific starting function
Enrico, tengo entendido que harbour busca una función llamada Main.
Ahora sí mal no recuerdo usando hbmk2 puedes indicar el nombre de una función que será tratada como el punto de ingreso de la app en lugar de Main.
Puedes ver la ayuda extendida de hbmk2 para ver cuál es ese parámetro.
Ahora sí mal no recuerdo usando hbmk2 puedes indicar el nombre de una función que será tratada como el punto de ingreso de la app en lugar de Main.
Puedes ver la ayuda extendida de hbmk2 para ver cuál es ese parámetro.
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
Carlos Vargas
Desde Managua, Nicaragua (CA)
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Set a specific starting function
Thank you. And for xHarbour?
Re: Set a specific starting function
Enrico, INIT PROCEDURE does not work for you?
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Set a specific starting function
Can you show me a sample, please?
Re: Set a specific starting function
hi Enrico,
Code: Select all | Expand
INIT PROCEDURE MainInit()
LOCAL cTitle := "FiveWin TGrid Listview Demo " + cVersion
LOCAL hWndDlg := FindWindowEx(,,, cTitle )
IF !( hWndDlg == 0 )
SetForegroundWindow( hWndDlg )
BringWindowToTop( hWndDlg )
ShowWindow( hWndDlg, 1 )
UpdateWindow( hWndDlg )
QUIT // It is a second instance. Bye Bye
ENDIF
RETURN
PROCEDURE Main()
greeting,
Jimmy
Jimmy
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Set a specific starting function
Thank you, but this is not what I'm asking for. I have many PRGs and a function MAIN() inside one of those (not the first linked). How can I force the function MAIN() to be executed as the first function?
Re: Set a specific starting function
hi Enrico,
you ask for a Sample using INIT PROCEDUREEnrico Maria Giordano wrote:Thank you, but this is not what I'm asking for.
put you file with MAIN as 1st into your *,MAK or *,HBPEnrico Maria Giordano wrote:I have many PRGs and a function MAIN() inside one of those (not the first linked).
How can I force the function MAIN() to be executed as the first function?
greeting,
Jimmy
Jimmy
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Set a specific starting function
My request was specific: use a starting function that is not in the first module.
- Antonio Linares
- Site Admin
- Posts: 42273
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Set a specific starting function
Dear Enrico,
You could place a INIT PROCEDURE in the main file and then call a function from another module from it
You could place a INIT PROCEDURE in the main file and then call a function from another module from it
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Set a specific starting function
Yes, I already thought about that but I'm not sure it is a good working solution. In fact, all the program would be executed inside the INIT PROCEDURE, that is not a good thing, I suppose.
- Antonio Linares
- Site Admin
- Posts: 42273
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Set a specific starting function
It should work fine, please try it
It is just one more stack call
It is just one more stack call
- carlos vargas
- Posts: 1721
- Joined: Tue Oct 11, 2005 5:01 pm
- Location: Nicaragua
Re: Set a specific starting function
using
open the help file of hbmk2 with parameters in notepadhbmk2 -hhh
...
-main=<mainfunc> sustituye el nombre de la función o procedimento inicial
...
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
Carlos Vargas
Desde Managua, Nicaragua (CA)
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Set a specific starting function
Ok, I'll try, thank you.Antonio Linares wrote:It should work fine, please try it
It is just one more stack call
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Set a specific starting function
This is only for Harbour, not for xHarbour, right?carlos vargas wrote:usingopen the help file of hbmk2 with parameters in notepadhbmk2 -hhh...
-main=<mainfunc> sustituye el nombre de la función o procedimento inicial
...