Code: Select all
p_p := __pp_Init()
Command_s := "SET MARGIN TO"
Preprocessed_s := __pp_Process( p_p, Command_s )
Code: Select all
Set( _SET_MARGIN, 0 )
Code: Select all
p_p := __pp_Init()
Command_s := "SET MARGIN TO"
Preprocessed_s := __pp_Process( p_p, Command_s )
Code: Select all
Set( _SET_MARGIN, 0 )
You can look at the following working example:REQUEST __pp_StdRules
Code: Select all
REQUEST HB_GT_WIN_DEFAULT
REQUEST __pp_StdRules
PROCEDURE Main()
LOCAL cString
LOCAL pPP := __pp_Init()
CLS
? "Testing Harbour run-time preprocessing"
?
? cString := "@ 10, 10 SAY 'Hello!'"
? __pp_Process( pPP, cString )
?
? cString := "? 'Hello mom'"
? __pp_Process( pPP, cString )
?
? cString := "SET MARGIN TO Something"
? __pp_Process( pPP, cString )
?
WAIT
RETURN
Attachments
You can look at the following working example:REQUEST __pp_StdRules
Code: Select all
REQUEST HB_GT_WIN_DEFAULT
REQUEST __pp_StdRules
PROCEDURE Main()
LOCAL cString
LOCAL pPP := __pp_Init()
CLS
? "Testing Harbour run-time preprocessing"
?
? cString := "@ 10, 10 SAY 'Hello!'"
? __pp_Process( pPP, cString )
?
? cString := "? 'Hello mom'"
? __pp_Process( pPP, cString )
?
? cString := "SET MARGIN TO Something"
? __pp_Process( pPP, cString )
?
WAIT
RETURN
Attachments
Code: Select all
Function GetSystemClipboard()
Local ClipBoard_s := ""
ClipBoard_s := System.Clipboard
Return ClipBoard_s
Code: Select all
#INCLUDE "i_pseudofunc.CH"
#include "FILEIO.CH"
#INCLUDE "COMMON.CH"
#INCLUDE "directry.ch"
#Include "hbinkey.ch"
#Include "inkey.ch"
#INCLUDE "hbgtinfo.ch"
#include "inkey.ch"
#include "set.ch"
Code: Select all
Function GetSystemClipboard()
Local ClipBoard_s := ""
ClipBoard_s := System.Clipboard
Return ClipBoard_s
Code: Select all
#INCLUDE "i_pseudofunc.CH"
#include "FILEIO.CH"
#INCLUDE "COMMON.CH"
#INCLUDE "directry.ch"
#Include "hbinkey.ch"
#Include "inkey.ch"
#INCLUDE "hbgtinfo.ch"
#include "inkey.ch"
#include "set.ch"
]]>
]]>
Code: Select all
#include "hmg.ch"
REQUEST HB_MEMIO
Function Main
Local aRows [20] [4]
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 690 ;
HEIGHT 400 ;
TITLE 'Changing the height of a grid row.' ;
MAIN
aRows [1] := {113.12,date(),1,1 , .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [2] := {123.12,date(),2,2 , .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [3] := {133.12,date(),3,3, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [4] := {143.12,date(),1,4, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [5] := {153.12,date(),2,5, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [6] := {163.12,date(),3,6, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [7] := {173.12,date(),1,7, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [8] := {183.12,date(),2,8, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [9] := {193.12,date(),3,9, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [10] := {113.12,date(),1,10, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [11] := {123.12,date(),2,11, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [12] := {133.12,date(),3,12, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [13] := {143.12,date(),1,13, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [14] := {153.12,date(),2,14, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [15] := {163.12,date(),3,15, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [16] := {173.12,date(),1,16, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [17] := {183.12,date(),2,17, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [18] := {193.12,date(),3,18, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [19] := {113.12,date(),1,19, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [20] := {123.12,date(),2,20, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
@ 10,60 GRID Grid_1 ;
WIDTH 620 ;
HEIGHT 330 ;
HEADERS {'Column 1','Column 2','Column 3','Column 4','Column 5', 'Column TXT'} ;
WIDTHS {140,140,140,140,140, 100} ;
ITEMS aRows ;
EDIT ON CHANGE playbeep() ;
COLUMNCONTROLS { {'TEXTBOX','NUMERIC','$ 999,999.99'} , {'DATEPICKER','DROPDOWN'} , {'COMBOBOX',{'One','Two','Three'}} , { 'SPINNER' , 1 , 20 } , { 'CHECKBOX' , 'Yes' , 'No' }, Nil } ;
CELLNAVIGATION
@ 10,10 SLIDER Slider_1 ;
RANGE 1,10 ;
VALUE 1 ;
TOOLTIP "Grid Row Height" ;
VERTICAL ;
ON CHANGE { || ( SetGridRowHeight ( "Form_1", "Grid_1", Form_1.Slider_1.Value * 12 ), Form_1.RowHeight_label.Value := Str( Form_1.Slider_1.Value * 12, 3 ) ) }
@ 130, 10 LABEL RowHeight_label VALUE Str( Form_1.Slider_1.Value * 12, 3 ) WIDTH 45
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
****************
Function SetGridRowHeight ( cFormName, cGridName, nHeight )
Local cDummyPNG := "mem:__Dummy_" + cFormName + "_" + cGridName + ".png"
Local hBitmap := BT_BitmapCreateNew (1, nHeight, { 255, 255, 255 } )
Local Ret := BT_BitmapSaveFile (hBitmap, cDummyPNG, BT_FILEFORMAT_PNG)
BT_BitmapRelease ( hBitmap )
IF Ret
SetProperty ( cFormName, cGridName, "Image", .T., { cDummyPNG } )
ENDIF
hb_vfErase( cDummyPNG )
RETURN Ret
Code: Select all
#include "hmg.ch"
REQUEST HB_MEMIO
Function Main
Local aRows [20] [4]
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 690 ;
HEIGHT 400 ;
TITLE 'Changing the height of a grid row.' ;
MAIN
aRows [1] := {113.12,date(),1,1 , .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [2] := {123.12,date(),2,2 , .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [3] := {133.12,date(),3,3, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [4] := {143.12,date(),1,4, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [5] := {153.12,date(),2,5, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [6] := {163.12,date(),3,6, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [7] := {173.12,date(),1,7, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [8] := {183.12,date(),2,8, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [9] := {193.12,date(),3,9, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [10] := {113.12,date(),1,10, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [11] := {123.12,date(),2,11, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [12] := {133.12,date(),3,12, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [13] := {143.12,date(),1,13, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [14] := {153.12,date(),2,14, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [15] := {163.12,date(),3,15, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [16] := {173.12,date(),1,16, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [17] := {183.12,date(),2,17, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [18] := {193.12,date(),3,18, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [19] := {113.12,date(),1,19, .t., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
aRows [20] := {123.12,date(),2,20, .f., "1st line" + CRLF + "2nd line" + CRLF + "3rd line" }
@ 10,60 GRID Grid_1 ;
WIDTH 620 ;
HEIGHT 330 ;
HEADERS {'Column 1','Column 2','Column 3','Column 4','Column 5', 'Column TXT'} ;
WIDTHS {140,140,140,140,140, 100} ;
ITEMS aRows ;
EDIT ON CHANGE playbeep() ;
COLUMNCONTROLS { {'TEXTBOX','NUMERIC','$ 999,999.99'} , {'DATEPICKER','DROPDOWN'} , {'COMBOBOX',{'One','Two','Three'}} , { 'SPINNER' , 1 , 20 } , { 'CHECKBOX' , 'Yes' , 'No' }, Nil } ;
CELLNAVIGATION
@ 10,10 SLIDER Slider_1 ;
RANGE 1,10 ;
VALUE 1 ;
TOOLTIP "Grid Row Height" ;
VERTICAL ;
ON CHANGE { || ( SetGridRowHeight ( "Form_1", "Grid_1", Form_1.Slider_1.Value * 12 ), Form_1.RowHeight_label.Value := Str( Form_1.Slider_1.Value * 12, 3 ) ) }
@ 130, 10 LABEL RowHeight_label VALUE Str( Form_1.Slider_1.Value * 12, 3 ) WIDTH 45
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
****************
Function SetGridRowHeight ( cFormName, cGridName, nHeight )
Local cDummyPNG := "mem:__Dummy_" + cFormName + "_" + cGridName + ".png"
Local hBitmap := BT_BitmapCreateNew (1, nHeight, { 255, 255, 255 } )
Local Ret := BT_BitmapSaveFile (hBitmap, cDummyPNG, BT_FILEFORMAT_PNG)
BT_BitmapRelease ( hBitmap )
IF Ret
SetProperty ( cFormName, cGridName, "Image", .T., { cDummyPNG } )
ENDIF
hb_vfErase( cDummyPNG )
RETURN Ret
]]>The GCC 14 compiler code was branched from the main Git branch with release preparations for GCC 14 underway. A status report was just published outlining release plans for getting GCC 14.1 stable out around 7 May.
With the GCC 14 code now being branched, GCC 15 is in development on the mainline Git code. A GCC 14.1 release candidate should be out next week while the hope is to release GCC 14.1 stable around 7 May. In today's status report they have cleared all the highest priority "P1" regressions while now are up to 606 P2 regressions and 57 P3 regressions.
Long story short, GCC 14.1 stable should be out by mid-May.
]]>The GCC 14 compiler code was branched from the main Git branch with release preparations for GCC 14 underway. A status report was just published outlining release plans for getting GCC 14.1 stable out around 7 May.
With the GCC 14 code now being branched, GCC 15 is in development on the mainline Git code. A GCC 14.1 release candidate should be out next week while the hope is to release GCC 14.1 stable around 7 May. In today's status report they have cleared all the highest priority "P1" regressions while now are up to 606 P2 regressions and 57 P3 regressions.
Long story short, GCC 14.1 stable should be out by mid-May.
]]>May 7, 2024
The GCC developers are pleased to announce the release of GCC 14.1.
This release is a major release, containing new features (as well as many other improvements) relative to GCC 13.x.
Release History
GCC 14.1
May 7, 2024
References and Acknowledgements
GCC used to stand for the GNU C Compiler, but since the compiler supports several other languages aside from C, it now stands for the GNU Compiler Collection.
The GCC developers would like to thank the numerous people that have contributed new features, improvements, bug fixes, and other changes as well as test results to GCC. This amazing group of volunteers is what makes GCC successful.
]]>May 7, 2024
The GCC developers are pleased to announce the release of GCC 14.1.
This release is a major release, containing new features (as well as many other improvements) relative to GCC 13.x.
Release History
GCC 14.1
May 7, 2024
References and Acknowledgements
GCC used to stand for the GNU C Compiler, but since the compiler supports several other languages aside from C, it now stands for the GNU Compiler Collection.
The GCC developers would like to thank the numerous people that have contributed new features, improvements, bug fixes, and other changes as well as test results to GCC. This amazing group of volunteers is what makes GCC successful.
Code: Select all
2024-05-08 16:38:30 Windows 10 10.0
Harbour 3.2.0dev (r2404101339) MinGW GNU C 14.1 (64-bit) x86-64
THREADS: 0
N_LOOPS: 1000000
[ T000: empty loop overhead ]...................................0.02
====================================================================
[ T001: x := L_C ]..............................................0.02
[ T002: x := L_N ]..............................................0.00
[ T003: x := L_D ]..............................................0.02
[ T004: x := S_C ]..............................................0.02
[ T005: x := S_N ]..............................................0.02
[ T006: x := S_D ]..............................................0.02
[ T007: x := M->M_C ]...........................................0.02
[ T008: x := M->M_N ]...........................................0.02
[ T009: x := M->M_D ]...........................................0.02
[ T010: x := M->P_C ]...........................................0.03
[ T011: x := M->P_N ]...........................................0.02
[ T012: x := M->P_D ]...........................................0.02
[ T013: x := F_C ]..............................................0.02
[ T014: x := F_N ]..............................................0.02
[ T015: x := F_D ]..............................................0.02
[ T016: x := o:Args ]...........................................0.05
[ T017: x := o[ 2 ] ]...........................................0.05
[ T018: Round( i / 1000, 2 ) ]..................................0.08
[ T019: Str( i / 1000 ) ].......................................0.22
[ T020: Val( s ) ]..............................................0.08
[ T021: Val( a [ i % 16 + 1 ] ) ]...............................0.11
[ T022: DToS( d - i % 10000 ) ].................................0.13
[ T023: Eval( {|| i % 16 } ) ]..................................0.14
[ T024: Eval( bc := {|| i % 16 } ) ]............................0.08
[ T025: Eval( {| x | x % 16 }, i ) ]............................0.11
[ T026: Eval( bc := {| x | x % 16 }, i ) ]......................0.08
[ T027: Eval( {| x | f1( x ) }, i ) ]...........................0.13
[ T028: Eval( bc := {| x | f1( x ) }, i ) ].....................0.09
[ T029: Eval( bc := &( "{| x | f1( x ) }" ), i ) ]..............0.09
[ T030: x := &( "f1(" + Str( i ) + ")" ) ]......................0.72
[ T031: bc := &( "{| x | f1( x ) }" ), Eval( bc, i ) ]..........0.91
[ T032: x := ValType( x ) + ValType( i ) ]......................0.11
[ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.25
[ T034: x := a[ i % 16 + 1 ] == s ].............................0.08
[ T035: x := a[ i % 16 + 1 ] = s ]..............................0.09
[ T036: x := a[ i % 16 + 1 ] >= s ].............................0.09
[ T037: x := a[ i % 16 + 1 ] <= s ].............................0.09
[ T038: x := a[ i % 16 + 1 ] < s ]..............................0.09
[ T039: x := a[ i % 16 + 1 ] > s ]..............................0.09
[ T040: AScan( a, i % 16 ) ]....................................0.11
[ T041: AScan( a, {| x | x == i % 16 } ) ]......................0.94
[ T042: iif( i % 1000 == 0, a := {}, ), AAdd(a,{i,1,.T.,s, ]....0.30
[ T043: x := a ]................................................0.02
[ T044: x := {} ]...............................................0.03
[ T045: f0() ]..................................................0.02
[ T046: f1( i ) ]...............................................0.03
[ T047: f2( c[1...8] ) ]........................................0.03
[ T048: f2( c[1...40000] ) ]....................................0.02
[ T049: f2( @c[1...40000] ) ]...................................0.02
[ T050: f2( @c[1...40000] ), c2 := c ]..........................0.03
[ T051: f3( a, a2, s, i, s2, bc, i, n, x ) ]....................0.09
[ T052: f2( a ) ]...............................................0.03
[ T053: x := f4() ].............................................0.13
[ T054: x := f5() ].............................................0.08
[ T055: x := Space( 16 ) ]......................................0.06
[ T056: f_prv( c ) ]............................................0.09
====================================================================
[ total application time: ].....................................7.09
[ total real time: ]............................................7.11
2024-05-08 16:41:12 Windows 10 10.0
Harbour 3.2.0dev (r2404101339) (MT)+ MinGW GNU C 14.1 (64-bit) x86-64
THREADS: all->56
N_LOOPS: 1000000
[ T000: empty loop overhead ]...................................0.02
====================================================================
[ T001: x := L_C ]..............................................0.84
[ T002: x := L_N ]..............................................0.28
[ T003: x := L_D ]..............................................0.34
[ T004: x := S_C ]..............................................0.78
[ T005: x := S_N ]..............................................1.27
[ T006: x := S_D ]..............................................1.05
[ T007: x := M->M_C ]...........................................1.33
[ T008: x := M->M_N ]...........................................1.22
[ T009: x := M->M_D ]...........................................1.22
[ T010: x := M->P_C ]...........................................1.27
[ T011: x := M->P_N ]...........................................1.23
[ T012: x := M->P_D ]...........................................1.52
[ T013: x := F_C ]..............................................0.55
[ T014: x := F_N ]..............................................0.70
[ T015: x := F_D ]..............................................0.64
[ T016: x := o:Args ]...........................................6.61
[ T017: x := o[ 2 ] ]...........................................2.05
[ T018: Round( i / 1000, 2 ) ]..................................8.72
[ T019: Str( i / 1000 ) ]......................................12.92
[ T020: Val( s ) ]..............................................8.77
[ T021: Val( a [ i % 16 + 1 ] ) ]..............................11.33
[ T022: DToS( d - i % 10000 ) ]................................11.42
[ T023: Eval( {|| i % 16 } ) ].................................17.70
[ T024: Eval( bc := {|| i % 16 } ) ]............................9.08
[ T025: Eval( {| x | x % 16 }, i ) ]...........................18.73
[ T026: Eval( bc := {| x | x % 16 }, i ) ]......................9.08
[ T027: Eval( {| x | f1( x ) }, i ) ]..........................18.61
[ T028: Eval( bc := {| x | f1( x ) }, i ) ]....................10.86
[ T029: Eval( bc := &( "{| x | f1( x ) }" ), i ) ].............10.80
[ T030: x := &( "f1(" + Str( i ) + ")" ) ].....................17.77
[ T031: bc := &( "{| x | f1( x ) }" ), Eval( bc, i ) ].........20.66
[ T032: x := ValType( x ) + ValType( i ) ].....................11.80
[ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ].........12.14
[ T034: x := a[ i % 16 + 1 ] == s ].............................9.22
[ T035: x := a[ i % 16 + 1 ] = s ]..............................9.28
[ T036: x := a[ i % 16 + 1 ] >= s ].............................9.70
[ T037: x := a[ i % 16 + 1 ] <= s ].............................9.89
[ T038: x := a[ i % 16 + 1 ] < s ]..............................9.89
[ T039: x := a[ i % 16 + 1 ] > s ]..............................9.72
[ T040: AScan( a, i % 16 ) ]...................................10.53
[ T041: AScan( a, {| x | x == i % 16 } ) ].....................20.42
[ T042: iif( i % 1000 == 0, a := {}, ), AAdd(a,{i,1,.T.,s, ]...17.70
[ T043: x := a ]................................................2.39
[ T044: x := {} ]...............................................8.20
[ T045: f0() ]..................................................3.50
[ T046: f1( i ) ]...............................................4.89
[ T047: f2( c[1...8] ) ]........................................4.61
[ T048: f2( c[1...40000] ) ]....................................4.61
[ T049: f2( @c[1...40000] ) ]...................................4.72
[ T050: f2( @c[1...40000] ), c2 := c ]..........................6.58
[ T051: f3( a, a2, s, i, s2, bc, i, n, x ) ]....................9.67
[ T052: f2( a ) ]...............................................4.67
[ T053: x := f4() ]............................................10.34
[ T054: x := f5() ].............................................9.50
[ T055: x := Space( 16 ) ]......................................8.02
[ T056: f_prv( c ) ]...........................................10.53
====================================================================
[ total application time: ]....................................22.50
[ total real time: ]............................................6.79
Code: Select all
2024-05-08 16:38:30 Windows 10 10.0
Harbour 3.2.0dev (r2404101339) MinGW GNU C 14.1 (64-bit) x86-64
THREADS: 0
N_LOOPS: 1000000
[ T000: empty loop overhead ]...................................0.02
====================================================================
[ T001: x := L_C ]..............................................0.02
[ T002: x := L_N ]..............................................0.00
[ T003: x := L_D ]..............................................0.02
[ T004: x := S_C ]..............................................0.02
[ T005: x := S_N ]..............................................0.02
[ T006: x := S_D ]..............................................0.02
[ T007: x := M->M_C ]...........................................0.02
[ T008: x := M->M_N ]...........................................0.02
[ T009: x := M->M_D ]...........................................0.02
[ T010: x := M->P_C ]...........................................0.03
[ T011: x := M->P_N ]...........................................0.02
[ T012: x := M->P_D ]...........................................0.02
[ T013: x := F_C ]..............................................0.02
[ T014: x := F_N ]..............................................0.02
[ T015: x := F_D ]..............................................0.02
[ T016: x := o:Args ]...........................................0.05
[ T017: x := o[ 2 ] ]...........................................0.05
[ T018: Round( i / 1000, 2 ) ]..................................0.08
[ T019: Str( i / 1000 ) ].......................................0.22
[ T020: Val( s ) ]..............................................0.08
[ T021: Val( a [ i % 16 + 1 ] ) ]...............................0.11
[ T022: DToS( d - i % 10000 ) ].................................0.13
[ T023: Eval( {|| i % 16 } ) ]..................................0.14
[ T024: Eval( bc := {|| i % 16 } ) ]............................0.08
[ T025: Eval( {| x | x % 16 }, i ) ]............................0.11
[ T026: Eval( bc := {| x | x % 16 }, i ) ]......................0.08
[ T027: Eval( {| x | f1( x ) }, i ) ]...........................0.13
[ T028: Eval( bc := {| x | f1( x ) }, i ) ].....................0.09
[ T029: Eval( bc := &( "{| x | f1( x ) }" ), i ) ]..............0.09
[ T030: x := &( "f1(" + Str( i ) + ")" ) ]......................0.72
[ T031: bc := &( "{| x | f1( x ) }" ), Eval( bc, i ) ]..........0.91
[ T032: x := ValType( x ) + ValType( i ) ]......................0.11
[ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.25
[ T034: x := a[ i % 16 + 1 ] == s ].............................0.08
[ T035: x := a[ i % 16 + 1 ] = s ]..............................0.09
[ T036: x := a[ i % 16 + 1 ] >= s ].............................0.09
[ T037: x := a[ i % 16 + 1 ] <= s ].............................0.09
[ T038: x := a[ i % 16 + 1 ] < s ]..............................0.09
[ T039: x := a[ i % 16 + 1 ] > s ]..............................0.09
[ T040: AScan( a, i % 16 ) ]....................................0.11
[ T041: AScan( a, {| x | x == i % 16 } ) ]......................0.94
[ T042: iif( i % 1000 == 0, a := {}, ), AAdd(a,{i,1,.T.,s, ]....0.30
[ T043: x := a ]................................................0.02
[ T044: x := {} ]...............................................0.03
[ T045: f0() ]..................................................0.02
[ T046: f1( i ) ]...............................................0.03
[ T047: f2( c[1...8] ) ]........................................0.03
[ T048: f2( c[1...40000] ) ]....................................0.02
[ T049: f2( @c[1...40000] ) ]...................................0.02
[ T050: f2( @c[1...40000] ), c2 := c ]..........................0.03
[ T051: f3( a, a2, s, i, s2, bc, i, n, x ) ]....................0.09
[ T052: f2( a ) ]...............................................0.03
[ T053: x := f4() ].............................................0.13
[ T054: x := f5() ].............................................0.08
[ T055: x := Space( 16 ) ]......................................0.06
[ T056: f_prv( c ) ]............................................0.09
====================================================================
[ total application time: ].....................................7.09
[ total real time: ]............................................7.11
2024-05-08 16:41:12 Windows 10 10.0
Harbour 3.2.0dev (r2404101339) (MT)+ MinGW GNU C 14.1 (64-bit) x86-64
THREADS: all->56
N_LOOPS: 1000000
[ T000: empty loop overhead ]...................................0.02
====================================================================
[ T001: x := L_C ]..............................................0.84
[ T002: x := L_N ]..............................................0.28
[ T003: x := L_D ]..............................................0.34
[ T004: x := S_C ]..............................................0.78
[ T005: x := S_N ]..............................................1.27
[ T006: x := S_D ]..............................................1.05
[ T007: x := M->M_C ]...........................................1.33
[ T008: x := M->M_N ]...........................................1.22
[ T009: x := M->M_D ]...........................................1.22
[ T010: x := M->P_C ]...........................................1.27
[ T011: x := M->P_N ]...........................................1.23
[ T012: x := M->P_D ]...........................................1.52
[ T013: x := F_C ]..............................................0.55
[ T014: x := F_N ]..............................................0.70
[ T015: x := F_D ]..............................................0.64
[ T016: x := o:Args ]...........................................6.61
[ T017: x := o[ 2 ] ]...........................................2.05
[ T018: Round( i / 1000, 2 ) ]..................................8.72
[ T019: Str( i / 1000 ) ]......................................12.92
[ T020: Val( s ) ]..............................................8.77
[ T021: Val( a [ i % 16 + 1 ] ) ]..............................11.33
[ T022: DToS( d - i % 10000 ) ]................................11.42
[ T023: Eval( {|| i % 16 } ) ].................................17.70
[ T024: Eval( bc := {|| i % 16 } ) ]............................9.08
[ T025: Eval( {| x | x % 16 }, i ) ]...........................18.73
[ T026: Eval( bc := {| x | x % 16 }, i ) ]......................9.08
[ T027: Eval( {| x | f1( x ) }, i ) ]..........................18.61
[ T028: Eval( bc := {| x | f1( x ) }, i ) ]....................10.86
[ T029: Eval( bc := &( "{| x | f1( x ) }" ), i ) ].............10.80
[ T030: x := &( "f1(" + Str( i ) + ")" ) ].....................17.77
[ T031: bc := &( "{| x | f1( x ) }" ), Eval( bc, i ) ].........20.66
[ T032: x := ValType( x ) + ValType( i ) ].....................11.80
[ T033: x := StrZero( i % 100, 2 ) $ a[ i % 16 + 1 ] ].........12.14
[ T034: x := a[ i % 16 + 1 ] == s ].............................9.22
[ T035: x := a[ i % 16 + 1 ] = s ]..............................9.28
[ T036: x := a[ i % 16 + 1 ] >= s ].............................9.70
[ T037: x := a[ i % 16 + 1 ] <= s ].............................9.89
[ T038: x := a[ i % 16 + 1 ] < s ]..............................9.89
[ T039: x := a[ i % 16 + 1 ] > s ]..............................9.72
[ T040: AScan( a, i % 16 ) ]...................................10.53
[ T041: AScan( a, {| x | x == i % 16 } ) ].....................20.42
[ T042: iif( i % 1000 == 0, a := {}, ), AAdd(a,{i,1,.T.,s, ]...17.70
[ T043: x := a ]................................................2.39
[ T044: x := {} ]...............................................8.20
[ T045: f0() ]..................................................3.50
[ T046: f1( i ) ]...............................................4.89
[ T047: f2( c[1...8] ) ]........................................4.61
[ T048: f2( c[1...40000] ) ]....................................4.61
[ T049: f2( @c[1...40000] ) ]...................................4.72
[ T050: f2( @c[1...40000] ), c2 := c ]..........................6.58
[ T051: f3( a, a2, s, i, s2, bc, i, n, x ) ]....................9.67
[ T052: f2( a ) ]...............................................4.67
[ T053: x := f4() ]............................................10.34
[ T054: x := f5() ].............................................9.50
[ T055: x := Space( 16 ) ]......................................8.02
[ T056: f_prv( c ) ]...........................................10.53
====================================================================
[ total application time: ]....................................22.50
[ total real time: ]............................................6.79
Attachments
Attachments
Attachments
HMG 3.4.4 with MinGW 14.1Attachments
HMG 3.4.4 with MinGW 14.1I will wait for an offer from Rathinagiri as the donor of the above update.-------------------------------------------------------
HMG 64 Package (build date: 25.05.2024)
-------------------------------------------------------
Components versions:
--------------------
HMG 3.6 Stable (64 bits) UNICODE
Harbour 3.2.0dev (r2404101339)
Harbour Make (hbmk2) 3.2.0dev (r2024-04-10 13:39)
gcc version 14.1.0 (MinGW-W64 x86_64-msvcrt-posix-seh, built by Brecht Sanders, r1)
I will wait for an offer from Rathinagiri as the donor of the above update.-------------------------------------------------------
HMG 64 Package (build date: 25.05.2024)
-------------------------------------------------------
Components versions:
--------------------
HMG 3.6 Stable (64 bits) UNICODE
Harbour 3.2.0dev (r2404101339)
Harbour Make (hbmk2) 3.2.0dev (r2024-04-10 13:39)
gcc version 14.1.0 (MinGW-W64 x86_64-msvcrt-posix-seh, built by Brecht Sanders, r1)
Attachments
The Address column contains multiline strings.Attachments
The Address column contains multiline strings.Attachments
Attachments
Attachments
Test applicationAttachments
Test applicationCode: Select all
#include "hmg.ch"
#include "TSBrowse.ch"
REQUEST DBFCDX
*----------------------------------------
FUNCTION Main()
*----------------------------------------
LOCAL obrw
LOCAL aFilters := { { .F., "AGE>40" }, { .F., "STATE='NY'" }, { .F., "MARRIED" } }
LOCAL aCheck[ 3 ], n
LOCAL nRow := 40
LOCAL nCol := 40
USE CUSTOMER NEW SHARED VIA "DBFCDX"
DEFINE WINDOW win_1 ;
AT 0, 0 ;
WIDTH 600 HEIGHT 400 ;
MAIN ;
TITLE Alias() + ": Dynamic Filter Test" ;
ICON "lupa.ico" ;
FONT "Arial" ;
SIZE 10 ;
NOMAXIMIZE NOSIZE
FOR n := 1 TO Len( aFilters )
aCheck[ n ] := CreateChk( nRow, nCol, thiswindow.Name, aFilters, n )
this.( aCheck[ n ] ).Cargo := n
this.( aCheck[ n ] ).OnChange := {|| n := this.Cargo, aFilters[ n, 1 ] := ! aFilters[ n, 1 ], ;
SetProperty( 'win_1', "Label_1", "Value", "FILTER : " + ResetFilter( obrw, aFilters ) ) }
nCol += 150
NEXT
@ 80, 40 LABEL Label_1 VALUE "FILTER : " WIDTH 400 HEIGHT 25 CENTERALIGN
DEFINE TBROWSE obrw AT 115, 40 ;
CELLED SELECTOR "pointer.bmp" ;
COLORS CLR_BLACK, CLR_WHITE, CLR_BLACK, { RGB( 231, 242, 255 ), GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) } ;
ALIAS Alias() ;
WIDTH win_1.Width - 70 - GetBorderWidth() HEIGHT 220 ;
ON INIT {| ob | TsbCreate( ob, .T. ) }
END TBROWSE ON END {| ob | TsbCreate( ob, .F. ) }
END WINDOW
ON KEY ESCAPE OF win_1 ACTION win_1.Release()
CENTER WINDOW win_1
ACTIVATE WINDOW win_1
RETURN NIL
*----------------------------------------
STATIC PROCEDURE TsbCreate( obrw, lInit )
*----------------------------------------
LOCAL aFields, oCol
IF lInit
// initial columns
aFields := { "ID", "CITY", "STATE", "MARRIED", "AGE" }
LoadFields( "oBrw", "win_1", .F., aFields )
FOR EACH oCol IN oBrw:aColumns
oCol:cHeading := oCol:cName
NEXT
WITH OBJECT oBrw
:nHeightCell += 4
:nHeightHead := oBrw:nHeightCell - 2
:SetColor( { 5 }, { CLR_WHITE } )
:SetColor( { 6 }, { RGB( 0, 0, 128 ) } )
:SetAppendMode( .F. )
:SetDeleteMode( .T., .F. )
:lNoResetPos := .T.
:lNoMoveCols := .T.
:lNoKeyChar := .T.
:lNoChangeOrd := .T.
:lNoHScroll := .T.
END OBJECT
ELSE
obrw:SetNoHoles()
obrw:SetFocus()
ENDIF
RETURN
*----------------------------------------
STATIC FUNCTION CreateChk( nRow, nCol, oDlg, aFilters, nIndex )
*----------------------------------------
LOCAL cChk := "Check_" + hb_ntos( nIndex )
@ nROW, nCol CheckBox ( cChk ) PARENT ( oDlg ) ;
CAPTION aFilters[ nIndex, 2 ] VALUE aFilters[ nIndex, 1 ] ;
WIDTH 150 HEIGHT 21
RETURN cChk
*----------------------------------------
STATIC FUNCTION ResetFilter( obrw, aFilters )
*----------------------------------------
LOCAL cFilter
LOCAL af := {}
AEval( aFilters, {| a | If( a[ 1 ], AAdd( af, a[ 2 ] ), nil ) } )
cFilter := LB_Array2String( af, " .AND. " )
IF Empty( cFilter )
oBrw:FilterData()
ELSE
oBrw:FilterData( cFilter, , .T. )
ENDIF
RETURN cFilter
Code: Select all
#include "hmg.ch"
#include "TSBrowse.ch"
REQUEST DBFCDX
*----------------------------------------
FUNCTION Main()
*----------------------------------------
LOCAL obrw
LOCAL aFilters := { { .F., "AGE>40" }, { .F., "STATE='NY'" }, { .F., "MARRIED" } }
LOCAL aCheck[ 3 ], n
LOCAL nRow := 40
LOCAL nCol := 40
USE CUSTOMER NEW SHARED VIA "DBFCDX"
DEFINE WINDOW win_1 ;
AT 0, 0 ;
WIDTH 600 HEIGHT 400 ;
MAIN ;
TITLE Alias() + ": Dynamic Filter Test" ;
ICON "lupa.ico" ;
FONT "Arial" ;
SIZE 10 ;
NOMAXIMIZE NOSIZE
FOR n := 1 TO Len( aFilters )
aCheck[ n ] := CreateChk( nRow, nCol, thiswindow.Name, aFilters, n )
this.( aCheck[ n ] ).Cargo := n
this.( aCheck[ n ] ).OnChange := {|| n := this.Cargo, aFilters[ n, 1 ] := ! aFilters[ n, 1 ], ;
SetProperty( 'win_1', "Label_1", "Value", "FILTER : " + ResetFilter( obrw, aFilters ) ) }
nCol += 150
NEXT
@ 80, 40 LABEL Label_1 VALUE "FILTER : " WIDTH 400 HEIGHT 25 CENTERALIGN
DEFINE TBROWSE obrw AT 115, 40 ;
CELLED SELECTOR "pointer.bmp" ;
COLORS CLR_BLACK, CLR_WHITE, CLR_BLACK, { RGB( 231, 242, 255 ), GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) } ;
ALIAS Alias() ;
WIDTH win_1.Width - 70 - GetBorderWidth() HEIGHT 220 ;
ON INIT {| ob | TsbCreate( ob, .T. ) }
END TBROWSE ON END {| ob | TsbCreate( ob, .F. ) }
END WINDOW
ON KEY ESCAPE OF win_1 ACTION win_1.Release()
CENTER WINDOW win_1
ACTIVATE WINDOW win_1
RETURN NIL
*----------------------------------------
STATIC PROCEDURE TsbCreate( obrw, lInit )
*----------------------------------------
LOCAL aFields, oCol
IF lInit
// initial columns
aFields := { "ID", "CITY", "STATE", "MARRIED", "AGE" }
LoadFields( "oBrw", "win_1", .F., aFields )
FOR EACH oCol IN oBrw:aColumns
oCol:cHeading := oCol:cName
NEXT
WITH OBJECT oBrw
:nHeightCell += 4
:nHeightHead := oBrw:nHeightCell - 2
:SetColor( { 5 }, { CLR_WHITE } )
:SetColor( { 6 }, { RGB( 0, 0, 128 ) } )
:SetAppendMode( .F. )
:SetDeleteMode( .T., .F. )
:lNoResetPos := .T.
:lNoMoveCols := .T.
:lNoKeyChar := .T.
:lNoChangeOrd := .T.
:lNoHScroll := .T.
END OBJECT
ELSE
obrw:SetNoHoles()
obrw:SetFocus()
ENDIF
RETURN
*----------------------------------------
STATIC FUNCTION CreateChk( nRow, nCol, oDlg, aFilters, nIndex )
*----------------------------------------
LOCAL cChk := "Check_" + hb_ntos( nIndex )
@ nROW, nCol CheckBox ( cChk ) PARENT ( oDlg ) ;
CAPTION aFilters[ nIndex, 2 ] VALUE aFilters[ nIndex, 1 ] ;
WIDTH 150 HEIGHT 21
RETURN cChk
*----------------------------------------
STATIC FUNCTION ResetFilter( obrw, aFilters )
*----------------------------------------
LOCAL cFilter
LOCAL af := {}
AEval( aFilters, {| a | If( a[ 1 ], AAdd( af, a[ 2 ] ), nil ) } )
cFilter := LB_Array2String( af, " .AND. " )
IF Empty( cFilter )
oBrw:FilterData()
ELSE
oBrw:FilterData( cFilter, , .T. )
ENDIF
RETURN cFilter
Attachments
Attachments
Code: Select all
/* Test Grid Query */
Procedure Main
local aGrid, nGrid
LOCAL aMinMaxInfo := {}, i, nWidth
local aHeaders := {"Sno","Words","Numeric","Factor","Value","Y","Date"}
local aWidths := {50,70,70,50,70,50,80}
local aJustify := {2,0,1,0,0,2,2}
local cWin := "FrmMain"
Set( _SET_DEBUG, .f. )
Set Century ON
Set Date British
DEFINE FONT FontBold FONTNAME _HMG_DefaultFontName SIZE _HMG_DefaultFontSize + 1 BOLD
aGrid := { { '001', 'One', 100, 4, 400,.t.,Date() },;
{ '002', 'Two', 100, 6, 600,.t.,Date()-10 },;
{ '003', 'Three', 100, 7, 700,.t.,Date()-365 },;
{ '004', 'Four', 100, 5, 500,.f.,Date()-100 },;
{ '005', 'Five', 100, 3, 300,.t.,Date()-50 },;
{ '006', 'Six', 100, 5, 500,.t.,Date()-90 },;
{ '007', 'Seven', 100, 7, 700,.f.,Date()-200 },;
{ '008', 'Eight', 100, 9, 900,.t.,Date()-150 },;
{ '009', 'Nine', 100, 5, 500,.t.,Date()-60 },;
{ '010', 'Ten', 100, 4, 400,.f.,Date()-80 },;
{ '011', 'Eleven',100, 6, 600,.t.,Date()-70 },;
{ '012', 'Twelve',100, 7, 700,.f.,Date()-30 } }
nGrid := 0
AEval(aWidths, {|e| nGrid += e})
define window &cWin at 0,0 width 640 height 480 title "F2 - Query" main
ON KEY ESCAPE OF &cWin Action thisWindow.Release
ON KEY F2 of &cWin Action GridQuery(cWin,"Grid1")
@ 10,10 Grid Grid1 of &cWin autosizewidth nGrid height 400 Headers aHeaders Widths aWidths ;
Items aGrid Value 1 justify aJustify backcolor BROWN fontcolor YELLOW nosortheaders
for i := 1 to getproperty(cWin,"Grid1","ColumnCount")
// Dynamic Header
FrmMain.Grid1.HeaderDYNAMICFONT(i) := {|| 'FontBold' }
FrmMain.Grid1.HeaderDYNAMICBACKCOLOR(i) := {|| BROWN }
FrmMain.Grid1.HeaderDYNAMICFORECOLOR(i) := {|| YELLOW }
nWidth := FrmMain.Grid1.COLUMNWIDTH(i)
AAdd( aMinMaxInfo, { nWidth, nWidth } )
next
FrmMain.Grid1.COLUMNWIDTHLIMITS := aMinMaxInfo
end window
DoMethod(cWin,"Activate")
return
Attachments
Code: Select all
/* Test Grid Query */
Procedure Main
local aGrid, nGrid
LOCAL aMinMaxInfo := {}, i, nWidth
local aHeaders := {"Sno","Words","Numeric","Factor","Value","Y","Date"}
local aWidths := {50,70,70,50,70,50,80}
local aJustify := {2,0,1,0,0,2,2}
local cWin := "FrmMain"
Set( _SET_DEBUG, .f. )
Set Century ON
Set Date British
DEFINE FONT FontBold FONTNAME _HMG_DefaultFontName SIZE _HMG_DefaultFontSize + 1 BOLD
aGrid := { { '001', 'One', 100, 4, 400,.t.,Date() },;
{ '002', 'Two', 100, 6, 600,.t.,Date()-10 },;
{ '003', 'Three', 100, 7, 700,.t.,Date()-365 },;
{ '004', 'Four', 100, 5, 500,.f.,Date()-100 },;
{ '005', 'Five', 100, 3, 300,.t.,Date()-50 },;
{ '006', 'Six', 100, 5, 500,.t.,Date()-90 },;
{ '007', 'Seven', 100, 7, 700,.f.,Date()-200 },;
{ '008', 'Eight', 100, 9, 900,.t.,Date()-150 },;
{ '009', 'Nine', 100, 5, 500,.t.,Date()-60 },;
{ '010', 'Ten', 100, 4, 400,.f.,Date()-80 },;
{ '011', 'Eleven',100, 6, 600,.t.,Date()-70 },;
{ '012', 'Twelve',100, 7, 700,.f.,Date()-30 } }
nGrid := 0
AEval(aWidths, {|e| nGrid += e})
define window &cWin at 0,0 width 640 height 480 title "F2 - Query" main
ON KEY ESCAPE OF &cWin Action thisWindow.Release
ON KEY F2 of &cWin Action GridQuery(cWin,"Grid1")
@ 10,10 Grid Grid1 of &cWin autosizewidth nGrid height 400 Headers aHeaders Widths aWidths ;
Items aGrid Value 1 justify aJustify backcolor BROWN fontcolor YELLOW nosortheaders
for i := 1 to getproperty(cWin,"Grid1","ColumnCount")
// Dynamic Header
FrmMain.Grid1.HeaderDYNAMICFONT(i) := {|| 'FontBold' }
FrmMain.Grid1.HeaderDYNAMICBACKCOLOR(i) := {|| BROWN }
FrmMain.Grid1.HeaderDYNAMICFORECOLOR(i) := {|| YELLOW }
nWidth := FrmMain.Grid1.COLUMNWIDTH(i)
AAdd( aMinMaxInfo, { nWidth, nWidth } )
next
FrmMain.Grid1.COLUMNWIDTHLIMITS := aMinMaxInfo
end window
DoMethod(cWin,"Activate")
return
Attachments
Attachments
BrowserDb.rar (183.09 KiB)Attachments
BrowserDb.rar (183.09 KiB)Attachments
Attachments
Code: Select all
Components versions:
--------------------
Harbour MiniGUI Extended Edition 24.05 (Release)
Harbour 3.2.0dev (r2405092123)
Harbour Make (hbmk2) 3.2.0dev (r2024-05-09 21:23)
-------------------------------------------------
Code: Select all
Components versions:
--------------------
Harbour MiniGUI Extended Edition 24.05 (Release)
Harbour 3.2.0dev (r2402161723)
Harbour Make (hbmk2) 3.2.0dev (r2024-02-16 17:23)
Embarcadero C++ 7.70 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
Code: Select all
Components versions:
--------------------
Harbour MiniGUI Extended Edition 24.05 (Release)
Harbour 3.2.0dev (r2405092123)
Harbour Make (hbmk2) 3.2.0dev (r2024-05-09 21:23)
-------------------------------------------------
Code: Select all
Components versions:
--------------------
Harbour MiniGUI Extended Edition 24.05 (Release)
Harbour 3.2.0dev (r2402161723)
Harbour Make (hbmk2) 3.2.0dev (r2024-02-16 17:23)
Embarcadero C++ 7.70 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.