Compile Console Mode

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
Tristan
Posts: 40
Joined: Sun Jul 19, 2009 2:15 pm

Compile Console Mode

Post by Tristan »

Hello,

How to compile for creating console mode application?

Thanks,
Tristan
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Compile Console Mode

Post by Rathinagiri »

East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
luisfrancisco62
Posts: 66
Joined: Thu Mar 18, 2010 12:16 am
Location: Colombia
Contact:

Re: Compile Console Mode

Post 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
Sankarasubramanian
Posts: 10
Joined: Sat Dec 18, 2010 2:04 pm

Re: Compile Console Mode

Post by Sankarasubramanian »

rathinagiri wrote:Hi,

Kindly see here.

http://hmgforum.com/viewtopic.php?p=17302#p17302
Dear Mr.Rathinagiri,

If possible please provide a demo prg for console mode compilation.

with Regards,
Sankarasubramanian
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Compile Console Mode

Post 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
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Sankarasubramanian
Posts: 10
Joined: Sat Dec 18, 2010 2:04 pm

Re: Compile Console Mode

Post 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
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Compile Console Mode

Post by Rathinagiri »

I think you are doing correct.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply