Page 1 of 2

HMG 3.0 Test III

Posted: Tue Oct 13, 2009 4:43 am
by Roberto Lopez
- HMG 3.0.0 Changelog:

English:
--------

- Updated: Harbour compiler to 2.0 (Created from SVN 2009.10.12 ).
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: RDDSQL samples.

-\HMG\SAMPLES\RDD.SQL\MYSQL
-\HMG\SAMPLES\RDD.SQL\ODBC
-\HMG\SAMPLES\RDD.SQL\ARRAY


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)

Agregado: Ejemplos RDDSQL.

-\HMG\SAMPLES\RDD.SQL\MYSQL
-\HMG\SAMPLES\RDD.SQL\ODBC
-\HMG\SAMPLES\RDD.SQL\ARRAY

Download/Descarga:http://sourceforge.net/projects/harbour ... e/download

Enjoy!

Roberto.

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 4:51 am
by Rathinagiri
Thanks Roberto. :)

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 5:37 am
by Vanguarda
Thanks Master.

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 9:11 am
by esgici
Thanks a lot Maestro :D

Best regards

--

Esgici

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 9:22 am
by sudip
Hello Master Roberto,

Thanks a lot! I tested with TEMPRARY TABLE using HB_DBCREATETEMP() function!!!! And it runs fine!!! :) (as of now I am testing with 3.0.0 Test II)

I cannot resist myself to show the codes. Codes were originally written by Grigory Filatov. Thank you Grigory :)

Code: Select all

#include <minigui.ch>

Function Main
	SET DELETED ON
	
	define window winMain ;
		at 0, 0 ;
		width 640 height 400 main ;
		title "Temporary Table" ;
		on init CreateTemp()
		
		DEFINE BROWSE brwTemp
			COL 0
			ROW 0
			WIDTH 600
			HEIGHT 340
			HEADERS {"Item Code", "Item Description", "Rate"}
			WIDTHS {125, 300, 100}
			WORKAREA curItem
			FIELDS {"curitem->itemcd", "curitem->itemnm", "curItem->rate"}
			ALLOWEDIT .T.
			INPLACEEDIT .T.
			ALLOWAPPEND .T.
			ALLOWDELETE .T.
			LOCK .T.
			JUSTIFY {0, 0, 1}
		END BROWSE
		
		@ 350, 0 label lblShow value "Alt-A: Add, Dbl-Click: Modify, Del: Delete" AUTOSIZE

	end window
	
	winMain.center
	winMain.activate

Return
 
function CreateTemp()
	local aDbf := {}
	aadd(adbf,	{"itemcd", "c",	10, 0})
	aadd(adbf,	{"itemnm", "c",	40,	0})
	aadd(adbf,	{"rate",   "n",	 8, 2})
	
   if !hb_dbcreatetemp("curItem", adbf)
		msgbox("Cannot create temporary table: Item")
		RELEASE WINDOW ALL
		return nil
	endif
	
	if select("curItem") = 0
		use curItem new
	endif
	select curItem
	append blank
	curItem->itemcd := "CD"
	curItem->itemnm := "Compact Disc"
	curItem->rate := 10.00
	unlock

	return nil
With best regards.

Sudip

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 1:11 pm
by Roberto Lopez
sudip wrote:Hello Master Roberto,

Thanks a lot! I tested with TEMPRARY TABLE using HB_DBCREATETEMP() function!!!! And it runs fine!!! :) (as of now I am testing with 3.0.0 Test II)

I cannot resist myself to show the codes. Codes were originally written by Grigory Filatov. Thank you Grigory :)

Code: Select all

#include <minigui.ch>

Function Main
	SET DELETED ON
	
	define window winMain ;
		at 0, 0 ;
		width 640 height 400 main ;
		title "Temporary Table" ;
		on init CreateTemp()
		
		DEFINE BROWSE brwTemp
			COL 0
			ROW 0
			WIDTH 600
			HEIGHT 340
			HEADERS {"Item Code", "Item Description", "Rate"}
			WIDTHS {125, 300, 100}
			WORKAREA curItem
			FIELDS {"curitem->itemcd", "curitem->itemnm", "curItem->rate"}
			ALLOWEDIT .T.
			INPLACEEDIT .T.
			ALLOWAPPEND .T.
			ALLOWDELETE .T.
			LOCK .T.
			JUSTIFY {0, 0, 1}
		END BROWSE
		
		@ 350, 0 label lblShow value "Alt-A: Add, Dbl-Click: Modify, Del: Delete" AUTOSIZE

	end window
	
	winMain.center
	winMain.activate

Return
 
function CreateTemp()
	local aDbf := {}
	aadd(adbf,	{"itemcd", "c",	10, 0})
	aadd(adbf,	{"itemnm", "c",	40,	0})
	aadd(adbf,	{"rate",   "n",	 8, 2})
	
   if !hb_dbcreatetemp("curItem", adbf)
		msgbox("Cannot create temporary table: Item")
		RELEASE WINDOW ALL
		return nil
	endif
	
	if select("curItem") = 0
		use curItem new
	endif
	select curItem
	append blank
	curItem->itemcd := "CD"
	curItem->itemnm := "Compact Disc"
	curItem->rate := 10.00
	unlock

	return nil
With best regards.

Sudip
I'll add to the next release, adding appropriate credits for Grigory.

Regards,

Roberto.

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 1:33 pm
by sudip
Thank you Master Roberto :)
IMHO, usability of temporary table with HMG 3.0.0 will dramatically increase the usability of BROWSE, at least to novice programmers like me.
We can use this facility with 1-to-many forms, storing query results from SQL database etc.
With best regards.
Sudip

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 1:51 pm
by gfilatov
sudip wrote:Thank you Master Roberto :)
IMHO, usability of temporary table with HMG 3.0.0 will dramatically increase the usability of BROWSE, at least to novice programmers like me.
We can use this facility with 1-to-many forms, storing query results from SQL database etc.
With best regards.
Hello Sudip,

The Harbour beta3 allows to use a true Memory File System besides of the temporary table which is created on the hard disk.
This feature based upon a new contribution HbMemIO by Mindaugas Kavaliauskas. :idea:
Take a look for the following sample (adapted for HMG):

Code: Select all

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2002-2009 Roberto Lopez <harbourminigui@gmail.com>
 * http://harbourminigui.googlepages.com/
 *
 * Copyright 2009 Grigory Filatov <gfilatov@freemail.ru>
 *
 * Based on MEMIO sample included in Harbour distribution
*/

#include "minigui.ch"

REQUEST HB_MEMIO

*--------------------------------------------------------*
Function Main()
*--------------------------------------------------------*

	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
		WIDTH 640 HEIGHT 480 ;
		TITLE 'Memory File System Demo' ;
		MAIN NOMAXIMIZE ;
		ON INIT OpenTable() ;
		ON RELEASE CloseTable()

		DEFINE MAIN MENU

			DEFINE POPUP 'Test'
				ITEM "Exit"		ACTION ThisWindow.Release()
			END POPUP

		END MENU

		@ 10,10 BROWSE Browse_1	;
			WIDTH 610	;
			HEIGHT 390	;	
			HEADERS { 'Code' , 'Name' , 'Residents' } ;
			WIDTHS { 50 , 160 , 100 } ;
			WORKAREA memarea ;
			FIELDS { 'Code' , 'Name' , 'Residents' } ;
			JUSTIFY { BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT, BROWSE_JTFY_RIGHT } ;
			EDIT ;
			INPLACE ;
			READONLY { .T. , .F. , .F. }

	END WINDOW

	CENTER WINDOW Form_1

	ACTIVATE WINDOW Form_1

Return nil

*--------------------------------------------------------*
Procedure OpenTable
*--------------------------------------------------------*

   CreateTable()

   INDEX ON FIELD->RESIDENTS TAG residents

   GO TOP

Return

*--------------------------------------------------------*
Procedure CloseTable
*--------------------------------------------------------*

   DBCLOSEAREA()
   DBDROP("mem:test")  // Free memory resource

Return

*--------------------------------------------------------*
Function CreateTable
*--------------------------------------------------------*

   DBCREATE("mem:test", {{"CODE", "C", 3, 0},{"NAME", "C", 50, 0},{"RESIDENTS", "N", 11, 0}},, .T., "memarea")

   DBAPPEND()
   REPLACE CODE WITH 'LTU', NAME WITH 'Lithuania', RESIDENTS WITH 3369600
   DBAPPEND()
   REPLACE CODE WITH 'USA', NAME WITH 'United States of America', RESIDENTS WITH 305397000
   DBAPPEND()
   REPLACE CODE WITH 'POR', NAME WITH 'Portugal', RESIDENTS WITH 10617600
   DBAPPEND()
   REPLACE CODE WITH 'POL', NAME WITH 'Poland', RESIDENTS WITH 38115967
   DBAPPEND()
   REPLACE CODE WITH 'AUS', NAME WITH 'Australia', RESIDENTS WITH 21446187
   DBAPPEND()
   REPLACE CODE WITH 'FRA', NAME WITH 'France', RESIDENTS WITH 64473140
   DBAPPEND()
   REPLACE CODE WITH 'RUS', NAME WITH 'Russia', RESIDENTS WITH 141900000

Return Nil

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 4:17 pm
by sudip
Hello Grigory,
Thanks a lot :)
But, I can't compiled the code:

Code: Select all

Harbour 2.0.0beta3 (Rev. 12422)
Copyright (c) 1999-2009, http://www.harbour-project.org/
Compiling 'demo.prg'...
Lines 12105, Functions/Procedures 4
Generating C source output to 'demo.c'... Done.
demo.o:demo.c:(.data+0x1c8): undefined reference to `HB_FUN_HB_MEMIO'
collect2: ld returned 1 exit status
May be I have done some careless mistakes (again) ;)
With best regards.
Sudip

Re: HMG 3.0 Test III

Posted: Tue Oct 13, 2009 6:05 pm
by Roberto Lopez
sudip wrote:Hello Grigory,
Thanks a lot :)
But, I can't compiled the code:

Code: Select all

Harbour 2.0.0beta3 (Rev. 12422)
Copyright (c) 1999-2009, http://www.harbour-project.org/
Compiling 'demo.prg'...
Lines 12105, Functions/Procedures 4
Generating C source output to 'demo.c'... Done.
demo.o:demo.c:(.data+0x1c8): undefined reference to `HB_FUN_HB_MEMIO'
collect2: ld returned 1 exit status
May be I have done some careless mistakes (again) ;)
With best regards.
Sudip
You must link libhbmemio.a.

You must modify compile.bat to add it.

I'll link by default from next test release.

Regards,

Roberto.