Page 1 of 2

HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 3:15 am
by Roberto Lopez
Hi All,
- HMG 3.0.0 (Forum Test VI) Changelog:

English:
--------

- Updated: Harbour compiler to 2.0 (Created from SVN 2009.10.14).
HMG IDE 2.9.4 and earlier versions ARE NOT COMPATIBLE with this
HMG version.

- Updated: MingW compiler to 4.4.1

- Modified: Samples.

Removed: ADORDD samples (adordd not working on
current Harbour release)

Added:

-\HMG\SAMPLES\RDD.SQL\MYSQL
-\HMG\SAMPLES\RDD.SQL\ODBC
-\HMG\SAMPLES\RDD.SQL\ARRAY
-\HMG\SAMPLES\MEMORY.TABLES
-\HMG\SAMPLES\MULTI.WIN
-\HMG\SAMPLES\SQLITE
-\HMG\SAMPLES\POSTGRESQL

Modified:

-\HMG\SAMPLES\MULTI.PRG

New: 'Build.bat' (it replaces 'compile.bat').

Build [/i|/r|/d|/cs|/ci/cr] <PrgFile> | <filelist.hbp> [config.hbc]

[/i] : incremental build
[/r] : incremental build (rebuild all)

[/cs] : Console/mixed mode (std build)
[/ci] : Console/mixed mode (incremental build)
[/cr] : Console/mixed mode (incremental rebuild all)

[/d] : Debug mode (gui and console)

<filelist.hbm> : A text file with .hbp extension containing a source list
<configfile.hbc>: A text file with configuration parameters as additional
libs, include paths and lib paths.

<configfile.hbc> Syntax:

incpaths = incpath1 incpath2 ... incpathn

libpaths = libpath1 libpath2 ... libpathn

libs = lib1 lib2 ... libn

- library names must not include 'lib' prefix nor '.a' extension.

- 'build.bat' will create an 'error.log' file in the app folder when build
process ends with an error condition.

Sample: \HMG\SAMPLES\MULTI.PRG


Español:
--------

- Actualizado: Harbour compiler a 2.0 (SVN 2009.10.12)
HMG-IDE versión 2.9.4 y anteriores no es compatible con esta versión
de HMG.

- Actualizado: MingW compiler a 4.4.1

- Modificado: Samples.

Eliminado: Ejemplos ADORDD (adordd no funciona en la
versión actual de Harbour)

Agregados:

-\HMG\SAMPLES\RDD.SQL\MYSQL
-\HMG\SAMPLES\RDD.SQL\ODBC
-\HMG\SAMPLES\RDD.SQL\ARRAY
-\HMG\SAMPLES\MEMORY.TABLES
-\HMG\SAMPLES\MULTI.WIN
-\HMG\SAMPLES\SQLITE
-\HMG\SAMPLES\POSTGRESQL

Modificado:

-\HMG\SAMPLES\MULTI.PRG

Nuevo:'Build.bat' (reemplaza a 'compile.bat').

Build [/i|/r|/d|/cs|/ci/cr] <PrgFile> | <filelist.hbp> [config.hbc]

[/i] : incremental build
[/r] : incremental build (rebuild all)

[/cs] : Console/mixed mode (std build)
[/ci] : Console/mixed mode (incremental build)
[/cr] : Console/mixed mode (incremental rebuild all)

[/d] : Debug mode (gui and console)


<filelist.hbp> : Un archivo de texto con la lista de programas del proyecto.
<configfile.hbc>: Un archivo de texto con información de configuración
(librerías adicionales y paths de include y librerías adicionales).

<configfile.hbc> Syntax:

incpaths = incpath1 incpath2 ... incpathn

libpaths = libpath1 libpath2 ... libpathn

libs = lib1 lib2 ... libn

- Los nombres de librería no deben incluir el prefijo 'lib' ni la
extensión '.a'

- 'build.bat' creará un archivo llamado 'error.log' en la carpeta de la
aplicaci'ón cuando el proceso de compilación falle.


Ejemplo: \HMG\SAMPLES\MULTI.PRG

Well... I guess that I'll should call 3.0 as 'Sudip Release', because various of the new features (and samples) comes from his requests :)

Download/descargas:hmg300_Test_06.exe

Enjoy!

Roberto.

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 3:35 am
by Vanguarda
Thanks Master,

With best Regards,

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 7:50 am
by Rathinagiri
-\HMG\SAMPLES\POSTGRESQL?

OMG! Thanks Roberto. It's gr8!

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 10:10 am
by esgici
Thanks a lot Maestro and Sudip :D

Best Regards

--

Esgici

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 11:18 am
by gfilatov
Hi Roberto,

Thanks for your efforts :!:

Please be so kind to update a sample.prg at the folder hmg\samples\sqlite with code below:

Code: Select all

* SQLITE Sample by Rathinagiri / MOL / Sudip (HMG Forum)

#include "minigui.ch"

function main
local aTable := {}
local aCurRow := {}
public dbo := nil
public cDBName := "sample.db3"

set century on
set date ital

if .not. file(cDBName)
   create_populate()
else
   connect2db(cDBName)   
endif   

define window sample at 0,0 width 800 height 700 main

define grid table
   row 10
   col 10
   width 780
   height 500
   widths {200,100,100,100,50,200}
   headers {"Text","Number","Floating","Date1","Logic","Text2"}
end grid

define button P_ViewRecord
	row 600 
	col 100
	width 140
	height 24
	caption "View record = Giri11"
	action ViewRecord()
end button

define button P_ChangeRecord
	row 600 
	col 300
	width 140
	height 24
	caption "Popraw"
	action ChangeRecord()
end button

end window
RefreshTable()
sample.center
sample.activate
return NIL

function RefreshTable

	sample.table.DeleteAllItems()
	
	aTable := sql(dbo,"select * from new where date1 <= "+c2sql(ctod("15-04-2010")))
	for i := 1 to len(aTable)
		aCurRow := aTable[i]
		sample.table.additem({aCurRow[1],str(aCurRow[2]),str(aCurRow[3]),dtoc(aCurRow[4]),iif(aCurRow[5]==1,"True","False"),aCurRow[6]})
	next i
	if sample.table.itemcount > 0
		sample.table.value := 1
	endif
	sample.table.Refresh
return nil   


function create_populate()
local cCreateSQL := "CREATE TABLE new (text VARCHAR(50), number INTEGER PRIMARY KEY AUTOINCREMENT, floating FLOAT, date1 DATE, logic INTEGER, text2  VARCHAR(40))"
local cCreateIndex := "CREATE UNIQUE INDEX unique1 ON new (text,text2)"


if .not. connect2db(cDBName,.t.)
   return nil
endif

if .not. miscsql(dbo,cCreateSQL)
   return nil
endif

if .not. miscsql(dbo,cCreateIndex)
   return nil
endif

for i := 1 to 100
   
cQStr := "insert into new (text,floating,date1,logic,text2) values ("+;
          c2sql("Giri"+alltrim(str(i)))+","+;
          c2sql(123.45)+","+;
          iif(i <= 50,c2sql(date()),c2sql(ctod("18-09-2010")))+","+;
          c2sql(.t.)+","+;
          c2sql("India")+;
          ")"
if .not. miscsql(dbo,cQstr)
   return nil
endif
          
next i

msginfo("Insert Queries Completed!")
          
return nil


function ViewRecord
	local aResult
	
	aResult := sql(dbo, 'Select text2 from new where text = "Giri11"') // for update')
	if !empty(aResult)
		msgbox("Result is: " + aResult[1,1])
	endif
 return
 
function ChangeRecord
	local aTemp := {space(40)}
	
	aTemp := InputWindow("Put your value for TEXT2", {"New value:"}, {space(40)}, {40})
	if aTemp[1] != Nil // changed here
		cQstr := "update new set text2= '" +aTemp[1] +"' where text='Giri11'"
	    if !miscsql(dbo,cQstr)
			msginfo("Error during writing!")
		else
			msgbox("TEXT2 saved OK")
			RefreshTable()
		endif
	endif
return

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 11:48 am
by Roberto Lopez
rathinagiri wrote:-\HMG\SAMPLES\POSTGRESQL?

OMG! Thanks Roberto. It's gr8!
Sometimes, I remain silent, but I read messages and think about them :)

Regards,

Roberto.

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 11:52 am
by Roberto Lopez
gfilatov wrote:Hi Roberto,

Thanks for your efforts :!:

Please be so kind to update a sample.prg at the folder hmg\samples\sqlite with code below:
<...>
Thanks! I'll replace the file.

What you exactly changed and which is the reason? (I'm lazy today to check myself :) )

Regards,

Roberto.

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 12:44 pm
by gfilatov
Roberto Lopez wrote:
gfilatov wrote:Hi Roberto,

Thanks for your efforts :!:

Please be so kind to update a sample.prg at the folder hmg\samples\sqlite with code below:
<...>
Thanks! I'll replace the file.

What you exactly changed and which is the reason? (I'm lazy today to check myself :) )
Roberto,

I've got the following two replaces: :arrow:

1) wrong text in sql query 'for update' provokes the error message (look at below)
function ViewRecord
local aResult

aResult := sql(dbo, 'Select text2 from new where text = "Giri11"') // for update')
if !empty(aResult)
msgbox("Result is: " + aResult[1,1])
endif
return
2) correction for checking of return of function InputWindow (we have error at selection the 'Cancel' button)
aTemp := InputWindow("Put your value for TEXT2", {"New value:"}, {space(40)}, {40})
if aTemp[1] != Nil // changed here
That's all :idea:

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 1:34 pm
by Roberto Lopez
gfilatov wrote:
Roberto Lopez wrote:
gfilatov wrote:Hi Roberto,

Thanks for your efforts :!:

Please be so kind to update a sample.prg at the folder hmg\samples\sqlite with code below:
<...>
Thanks! I'll replace the file.

What you exactly changed and which is the reason? (I'm lazy today to check myself :) )
Roberto,

I've got the following two replaces: :arrow:

1) wrong text in sql query 'for update' provokes the error message (look at below)
function ViewRecord
local aResult

aResult := sql(dbo, 'Select text2 from new where text = "Giri11"') // for update')
if !empty(aResult)
msgbox("Result is: " + aResult[1,1])
endif
return
2) correction for checking of return of function InputWindow (we have error at selection the 'Cancel' button)
aTemp := InputWindow("Put your value for TEXT2", {"New value:"}, {space(40)}, {40})
if aTemp[1] != Nil // changed here
That's all :idea:
Many thanks for the explanation.

Regards,

Roberto.

Re: HMG 3.0 (Forum Test VI)

Posted: Sun Oct 18, 2009 2:13 pm
by Roberto Lopez
rathinagiri wrote:-\HMG\SAMPLES\POSTGRESQL?

OMG! Thanks Roberto. It's gr8!
And... I guess that when SUdip and you tried to import the dll missed 'pexports'.

An adequate batch for import the dll is:
set path=c:\mingw\bin
pexports libpq.dll > libpq.def
dlltool --input-def libpq.def --dllname libpq.dll --output-lib libpq.a -k
copy libpq.a c:\hmg\harbour\lib
Regards,

Roberto.