Page 1 of 1
Compile Console Mode
Posted: Mon Aug 01, 2011 8:57 am
by Tristan
Hello,
How to compile for creating console mode application?
Thanks,
Tristan
Re: Compile Console Mode
Posted: Mon Aug 01, 2011 9:45 am
by Rathinagiri
Re: Compile Console Mode
Posted: Tue Aug 23, 2011 4:57 am
by luisfrancisco62
hola
como puedo hacer una aplicacion win y que me salga el modo consola cuando lo pida y no desde el principio?
gracias
Re: Compile Console Mode
Posted: Fri Aug 26, 2011 7:43 am
by Sankarasubramanian
Dear Mr.Rathinagiri,
If possible please provide a demo prg for console mode compilation.
with Regards,
Sankarasubramanian
Re: Compile Console Mode
Posted: Fri Aug 26, 2011 8:34 am
by Rathinagiri
This is from \samples\console\hello.prg
Code: Select all
function Main()
SetMode(25,80)
CLS
@ 10,10 say 'Hello'
alert('Hello')
return nil
And this is the note from HMG reference.
By default two gt drivers are ALWAYS linked: GTGUI (as default) and GTWIN (Windows console). To create console/mixed mode apps. you only must add this line to your main .prg:
REQUEST HB_GT_WIN_DEFAULT
Re: Compile Console Mode
Posted: Fri Aug 26, 2011 2:52 pm
by Sankarasubramanian
#include "hmg.ch"
REQUEST HB_GT_WIN_DEFAULT
Function Main
DEFINE WINDOW Win_1 ;
ROW 0 ;
COL 0 ;
WIDTH 400 ;
HEIGHT 400 ;
TITLE 'Hello World!' ;
WINDOWTYPE MAIN
DEFINE BUTTON Button_1
ROW 180
COL 160
CAPTION 'Console'
ACTION Test_console()
END BUTTON
END WINDOW
Win_1.Center
Win_1.Activate
Return
Function Test_console
SetMode(25,80)
CLS
@ 10,10 say 'Hello'
alert('Hello')
CLS
quit
Return
Dear Mr.Rathinagiri
Thanks for your immediate response.
I have tried a mixed with this, Am I doing it correct?
with regards,
Sankarasubramanian
Re: Compile Console Mode
Posted: Fri Aug 26, 2011 3:23 pm
by Rathinagiri
I think you are doing correct.