* harbour/include/hbclass.ch
+ added:
ON ERROR FUNCTION <FuncName>
OPERATOR <op> FUNCTION <FuncName> <scope>
* harbour/include/hbapicls.h
* harbour/source/vm/classes.c
* harbour/source/vm/hvm.c
+ added support for overloading right side $ operator
* harbour/contrib/xhb/xhbfunc.c
* rewritten xhb_ains() and xhb_adel() in C
* harbour/contrib/xhb/xhb.ch
* changed AINS() conversion to be xHarbour compatible
* harbour/contrib/xhb/Makefile
+ added xhb.ch to PRG_HEADERS so it's installed automatically
during 'make install'
* harbour/contrib/xhb/Makefile
+ harbour/contrib/xhb/xhbmsgs.c
* harbour/contrib/xhb/xhbcomp.prg
+ added support for $ operator used with hashes and arrays
on right side working _exactly_ like in xHarbour.
+ added support for negative indexes in used in [] operator
for array and strings.
Please remember that standard harbour build (without
HB_COMPAT_XHB flag) generate warning for negative indexes,
if you wan to pacify them then instead of var[-1] use var[(-1)]
+ added support for assign string characters with [] index.
Please remember that for standard harbour build (without
HB_COMPAT_XHB flag) you have to use -ks compile time switch
if you want to assign strings in such way because this feature
needs different PCODE, f.e. try to compile this code:
proc main()
local s:="ABC"
s[(-1)] := "*"
? s
return
with and without -ks switch
+ added support for accessing hash items using OO interface, f.e.:
proc main()
local h:={"ABC"=>123.45,"XYZ"=>567.89}
? h["ABC"], h["XYZ"]
? h:ABC, h:XYZ
h:ABC+=1000
h:XYZ:=-2000
? h:ABC, h:XYZ
return
All of the above extensions are written in C code so the speed
overhead is very small. Harbour evaluates PCODE faster then xHarbour
so in speed tests where above operators are executed in loop without
any other code the xHarbour results with native support are comparable
with Harbour ones where above operators are overloaded using scalar
classes so in normal code you should not find any difference with
one exception for assigning characters in very long strings.
* contrib/xhb/xhbcomp.prg
+ Added "string as array" implementation. I didn't test
it for 100% compatibility, but the base is there.
One problem though that Harbour won't allow an zero
or negative index even with the -ks switch. (I find
the error useful though, so we should keep it, but allow
it with a switch -ks?)
* include/hbcompat.ch
* source/vm/arrayshb.c
* contrib/xhb/xhb.ch
* contrib/xhb/xhbfunc.c
+ Added HB_ASCAN() to Harbour, which does the same as
the plain AScan() in xhb. I decided to do this
because we already had hb_RAscan() implemented, and
having hb_Ascan() is good to keep symetry.
* Modified xhb lib to use the Harbour one.
* Translations moved to hbcompat.ch.
- Removed HB_COMPAT_XHB from Harbour level array functions.
* contrib/xhb/xhbcomp.prg
+ added "[]" operator overloading for the HBCharacter type class:
<string>[n] : access
assign is not implemented ( <string>[n] := <char> )
negative index is not implemented ( <string>[-n] )
+ added "$" operator overloading for the following type classes:
HBCharacter : <char> $ <array|hash>
HBDate : <date> $ <array|hash>
HBLogical : <logical> $ <array|hash>
HBNil : <nil> $ <array|hash>
HBNumeric : <numeric> $ <array|hash>
; all the new extended types, has a ::ClassName with the "HB" prefix.
* contrib/xhb/Makefile
* contrib/xhb/xhbfunc.c
+ contrib/xhb/xhb.ch
+ contrib/xhb/xhbcomp.prg
+ Added xhb_AScan(), xhb_AIns(), xhb_ADel() plus defines
to redirect extended AScan(), AIns(), ADel() calls to these
functions. They need to be tested as I'm no xhb user.
+ Added compatibility header, which adds a the above translations
and include hbcompat.ch.
+ Added INIT PROC xhb_Init() as a future place for xhb specific
startup settings.
; TODO:
- Add $ and [] operator overloading.
- Add operator overloading for hash type.
- Add a way hash API call to control the default flag
hb_hashNew() uses, then add this default setting to
the xhb libs INIT PROC.
; For better xhb compatibility, developers should add
#ifndef __XHARBOUR__
#include "xhb.ch"
#endif
to every .prg file they use.
+ contrib/xhb/make_b32.bat
+ contrib/xhb/make_vc.bat
+ contrib/xhb/makefile.bc
+ contrib/xhb/makefile.vc
+ Added non-GNU makefiles for xhb lib.
* include/hbcompat.ch
+ Added xhb compatibility translates for ENDSWITCH end friends.
* source/rtl/scrollbr.prg
* Minor formatting.
* harbour/include/hbextern.ch
+ harbour/contrib/xhb/xhbextrn.ch
* harbour/contrib/xhb/Makefile
* moved xHarbour compatible functions from hbextern.ch to xhbextrn.ch
* Changed hash creation mode from {=>}/Hash() to HB_HSetAutoAdd( {=>} )
* Changed xHb's string index access extensions: <string>[ n ], SubStr, Stuff used now
* Changed Inet* functions to HB_Inet*
* Changed use of hb_EnumIndex() to <enum>:__enumIndex()
; Tip library compiles now without xhb compatibility flag
; Please test it, I don't use all the functionality
* harbour/include/hbclass.ch
+ added new commands for scalar classes:
ASSOCIATE CLASS <ClassName> WITH TYPE
ARRAY|BLOCK|CHARACTER|DATE|HASH|LOGICAL|NIL|
NUMERIC|POINTER|SYMBOL
ENABLE CLASS TYPE ALL
ENABLE TYPE CLASS ARRAY|BLOCK|CHARACTER|DATE|HASH|LOGICAL|NIL|
NUMERIC|POINTER|SYMBOL
Please remeber that:
ENABLE CLASS TYPE ALL
and:
ENABLE TYPE CLASS ...
can be used in any place of code - this commands are translated to
REQUEST HB<TYPENAME>
so are not executed
* harbour/source/vm/classes.c
+ added __clsAssocType( <hClass>, <cType> ) => <lOK>
* harbour/common.mak
* harbour/source/rtl/tscalar.prg
* harbour/source/rtl/Makefile
+ harbour/source/rtl/tscalars.c
+ harbour/source/rtl/tscalard.c
+ harbour/source/rtl/tscalarh.c
+ harbour/source/rtl/tscalarl.c
+ harbour/source/rtl/tscalarp.c
+ harbour/source/rtl/tscalara.c
+ harbour/source/rtl/tscalaru.c
+ harbour/source/rtl/tscalarb.c
+ harbour/source/rtl/tscalarn.c
+ harbour/source/rtl/tscalarc.c
+ added scalar classes for basic types,
Now it's possible to define messages also for basic item types.
It's even possible to overload some not defined in HVM operators,
f.e. in this example we overload operator "+" so it makes
AADD( <aValue>, <xValue> )
for code like <aValue> + <xValue>:
#include "hbclass.ch"
PROC MAIN()
LOCAL a:={}
ASSOCIATE CLASS MyArray WITH TYPE ARRAY
a := a + "elem1"
a += "elem2"
a := a + "elem3"
a += "elem4"
? a:asString, a:isScalar
AEVAL(a,{|x,i|QOUT(i,x)})
RETURN
CREATE CLASS MyArray INHERIT __HBArray
OPERATOR "+" ARG xValue INLINE AADD( Self, xValue ), Self
ENDCLASS
Operators which have default actions for given types defined in HVM
cannot be overloaded.
* harbour/include/hbapicls.h
* harbour/source/vm/hvm.c
+ added hb_clsDoInit() function to initialize classy .prg functions
* harbour/source/compiler/complex.c
* allow to use NIL as class name
* harbour/source/compiler/harbour.yyc
* harbour/source/compiler/harbour.y
* harbour/source/compiler/harbour.yyh
% optimize automatically var[0] declaration and generate the same
PCODE as for var:={}
* harbour/source/rtl/tscalar.prg
+ added HASH, POINTER and SYMBOL scalar classes
* changed NIL class to not use any instance variables
* harbour/source/vm/classes.c
+ added support for scalar classes. Now at startup classy code looks
for hb<TYPENAME> functions and try to execute them to register
scalar classes. It's Class(y) compatible behavior and only the prefix
of scalar ceases class function is different: 'CSY' in class(y) and
'HB' in Harbour, f.e.: hbNumeric()
If you prefer xHarbour like not automatic scalar class registration
with some PP commands:
ASSOCIATE CLASS <ClassName> WITH TYPE
ARRAY|BLOCK|CHARACTER|DATE|HASH|LOGICAL|NIL|
NUMERIC|POINTER|SYMBOL
ENABLE CLASS TYPE ALL
ENABLE TYPE CLASS ARRAY|BLOCK|CHARACTER|DATE|HASH|LOGICAL|NIL|
NUMERIC|POINTER|SYMBOL
EXTEND [TYPE] ARRAY|BLOCK|CHARACTER|DATE|HASH|LOGICAL|NIL|
NUMERIC|POINTER|SYMBOL WITH METHOD <SomeFunc>
Then I can replace current code with it. If not then we should
divide scalar cases definitions into separated files to allow
easier overloading. I'm interesting in your opinions.
* harbour/include/hbapicls.h
* harbour/source/vm/hvm.c
+ added hb_clsDoInit() function to initialize classy .prg functions
* harbour/source/compiler/complex.c
* allow to use NIL as class name
* harbour/source/compiler/harbour.yyc
* harbour/source/compiler/harbour.y
* harbour/source/compiler/harbour.yyh
% optimize automatically var[0] declaration and generate the same
PCODE as for var:={}
* harbour/source/rtl/tscalar.prg
+ added HASH, POINTER and SYMBOL scalar classes
* changed NIL class to not use any instance variables
* harbour/source/vm/classes.c
+ added support for scalar classes. Now at startup classy code looks
for hb<TYPENAME> functions and try to execute them to register
scalar classes. It's Class(y) compatible behavior and only the prefix
of scalar ceases class function is different: 'CSY' in class(y) and
'HB' in Harbour, f.e.: hbNumeric()
If you prefer xHarbour like not automatic scalar class registration
with some PP commands:
ASSOCIATE CLASS <ClassName> WITH TYPE
ARRAY|BLOCK|CHARACTER|DATE|HASH|LOGICAL|NIL|
NUMERIC|POINTER|SYMBOL
ENABLE CLASS TYPE ALL
ENABLE TYPE CLASS ARRAY|BLOCK|CHARACTER|DATE|HASH|LOGICAL|NIL|
NUMERIC|POINTER|SYMBOL
EXTEND [TYPE] ARRAY|BLOCK|CHARACTER|DATE|HASH|LOGICAL|NIL|
NUMERIC|POINTER|SYMBOL WITH METHOD <SomeFunc>
Then I can replace current code with it. If not then we should
divide scalar cases definitions into separated files to allow
easier overloading. I'm interesting in your opinions.
* source/rtl/tbrowsys.prg
* source/rtl/getsys.prg
* source/rtl/tbrowse.prg
! Some rearrangements to avoid including the C5.3
compatible (and yet to be implemented) bloat in tbrowsys.prg
* common.mak
+ source/rtl/tbrowsys.prg
* source/rtl/Makefile
* source/rtl/getsys.prg
* source/rtl/tbrowse.prg
+ Added new file for C5.3 TB*() functions.
Most of them is dummy, a few of them were moved
here from existing files.
* include/hbextern.ch
+ Added rest of C5.3 TB*() functions.
* source/rtl/teditor.prg
! Fixed new scope violations reported by Guillermo.
* source/rtl/tbrowse.prg
+ :border implemented (to be tested).
! :setColumn() return value fixed, NOTE added.
! Non-character :picture handled properly.
(to be tested for full compatibility)
% Some optimizations.
- :TApplyKey() removed (it is not a C5.3 method)
; Some source cleanup and other changes.
; Work in progress.
* include/hbextern.ch
* common.mak
* source/rtl/Makefile
+ source/rtl/tscalar.prg
- source/rtl/array.prg
- source/rtl/block.prg
- source/rtl/characte.prg
- source/rtl/date.prg
- source/rtl/logical.prg
- source/rtl/nil.prg
- source/rtl/numeric.prg
- source/rtl/scalar.prg
+ Consolidated scalar classes to one file.
+ Minor optimizations and cleanup done on files.
+ Class function names now consistently HB*()
(was non-Class(y) compatible and a mixed list
of plain unprefixed class names and class names
prefixed with an underscore). Notice however that
Class(y) has only CsyArray() defined in its own
library, the rest was seemingly made only
available as additional source code.
! Fixed NIL class to be named NIL (was _NIL).
% Some unneeded MESSAGE redirections removed.
% LOCAL var[0] -> LOCAL var := {}. This results
in better pcode.
+ Added all these symbols to hbextern.ch
* source/rtl/symbol.prg
* Some cleanup.
; I believe this should be named HBSymbol() and
added to hbextern.ch
* harbour/source/compiler/hbopt.c
! fixed bad typo in last modification - thanks to Viktor
* added additional line number validation to not make optimizations
which will change line numbers
* contrib/libct/makefile.vc
* Some alignment.
* source/rtl/listbox.prg
! Using manifest constant.
* source/rtl/tbrowse.prg
! Some final fixes for full color compatibility.
* source/common/hbver.c
+ Added NOTE about what CA-Cl*ppers are returning
for Version().
* harbour/include/hbapi.h
+ HB_ISFIRSTIDCHAR() and HB_ISNEXTIDCHAR() macros
* harbour/source/rdd/wafunc.c
* changed FIELD->, _FIELD->, <alias>-> stripping from expressions
to respect shortcuts
* harbour/source/compiler/hbmain.c
* harbour/source/compiler/hbdead.c
* harbour/source/compiler/hbopt.c
* jump joining optimization changed to work also for code with line
numbers
* source/rtl/tbrowse.prg
! Color handling made fully C5.x compatible. Pls test.
+ One C5.3 bug replicated where no special header/footer
colors are being used if there is not header/footer separator
sepcified.
! Fixed compile error (because of unused var warning) when
HB_COMPAT_C53 is not defined.
* source/rtl/numeric.prg
* source/rtl/memoedit.prg
* source/rtl/typefile.prg
* source/rtl/block.prg
* source/rtl/symbol.prg
* source/rtl/errorsys.prg
* source/rtl/scalar.prg
* source/rtl/nil.prg
* source/rtl/radiogrp.prg
* source/rtl/logical.prg
* source/rtl/array.prg
* source/rtl/listbox.prg
* source/rtl/browse.prg
* source/rtl/characte.prg
* source/rtl/pushbtn.prg
* source/rtl/ttextlin.prg
* source/rtl/profiler.prg
* source/rtl/date.prg
* source/rtl/persist.prg
* source/debug/dbgbrwsr.prg
* source/debug/tbrwtext.prg
* source/debug/dbgtmenu.prg
+ Enabled "PROTECTED:" keyword in profiler.prg
* Finished CLASS declarations to use a more or less consistent syntax
inside Harbour (Class(y) compatible except SETGET and the METHOD
parameter lists, maybe some more).
* Finished WHILE, iif(), END, string quotation to be consistent along Harbour.
! Fixed some indentations.
* Some other minor cleanups.
* harbour/source/rtl/tbrowse.prg
! Fixed cell color. This was needed because the oCol:colorBlock()
now always contains a block (it cannot be NIL) to be CA-Cl*pper
compatible, so the logic had to be adjusted in :DispCell()
accordingly.
* harbour/utils/hbtest/rt_misc.prg
* harbour/utils/hbtest/make_c5x.bat
+ added alternative results for oGet:colorspec compatible with CL53
when HB_COMPAT_C53 macro is set
* harbour/include/Makefile
+ harbour/include/hbsxdef.ch
* harbour/include/dbinfo.ch
* harbour/include/hbrdddbf.h
* harbour/include/hbrddcdx.h
* harbour/include/hbrddntx.h
* harbour/contrib/bmdbfcdx/hbrddbmcdx.h
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/workarea.c
+ added SIx3 compatible triggers support
They should work like in SIx3 with some intentional excpetions:
1) if 4-th parameter exists (PREUSE/GET/PUT) then it's passed by
reference otherwise is not passed at all and PCOUNT() in trigger
functions returns 3
SIx3 do not pass 4-th parameter by reference and if it not
exist then passes 0
2) EVENT_POSTCLOSE is executed after SUPER_CLOSE()
SIx3 executes EVENT_POSTCLOSE just before SUPER_CLOSE()
3) EVENT_UPDATE is executed _ALWAYS_ when DBF is updated also
when WA does not have open indexes
SIx3 executes EVENT_UPDATE only when at least one index is
open without checking if it's updated or not
4) EVENT_POSTUSE is executed from OPEN() method in "DBF" RDD not
from index RDDs so before the indexes are open
SIx3 executes EVENT_POSTUSE after opening indexes
It's possible that I'll change this condition in the future
* makefile.vc
* makefile.gc
* makefile.bc
* config/rules.cf
+ Using Harbour -kM switch when building Harbour itself.
(this switch will turn off macro substitution in string
literals.)
* source/rtl/getsys.prg
* source/rtl/tgetlist.prg
* source/debug/debugger.prg
! Fixed scope violation in debugger by creating
a new :Get() method for HBGetList().
! Fixed some minor issues.
% Minor optimization. Like dropping HBGetList():ReadExit()
which was just a wrapper to SET( _SET_EXIT ).
! Replaced a few remaining external HBGetList() var accesses
with :ReadStats() calls.
! TGetList():GetApplyKey() parameter list rearranged after
yesterday to keep it compatible with previous versions.
This also avoids a crash in the debugger.
* source/rtl/memoedit.prg
* source/rtl/teditor.prg
* source/debug/tbrwtext.prg
+ HBEditor():RefreshWindow() renamed to :display()
old message name kept for compatibility.
+ HBEditor():hitTest() added.
+ HBEditor():changed() added. (returns internal
::lDirty which got renamed to ::lChanged)
* source/rtl/getlist.prg
* source/rtl/getsys.prg
* source/rtl/tgetlist.prg
! Fixes for UI problems reported by Lorenzo
and more. Mostly from xhb.
+ ReadModal() core functionality moved inside
HBGetList()
+ ReadStats() functionality moved indide
HBGetList()
+ All HBGetList() vars made protected.
+ Cleaned up the .prg and class interfaces.
! Fixed crashes of several GETSYS compatibility
functions, when no getlist was active.
We're still not fully C5.x compatible though.
* source/rtl/tmenusys.prg
+ Uses ReadStats() instead of direct
HBGetList() var access.
* source/rtl/tbrowse.prg
! :hitTest() fixed.
* source/rtl/tget.prg
! Minor fixes to :capCol() and :capRow()
* source/rtl/checkbox.prg
* source/rtl/listbox.prg
* source/rtl/menuto.prg
* source/rtl/pushbtn.prg
* source/rtl/radiobtn.prg
* source/rtl/radiogrp.prg
* source/rtl/scrollbr.prg
* source/rtl/tbcolumn.prg
* source/rtl/tbrowse.prg
* source/rtl/tget.prg
* source/rtl/tgetlist.prg
* source/rtl/tpopup.prg
* source/rtl/ttopbar.prg
* Formatting (some varnames uniformized).
* source/rtl/tget.prg
! :HitTest() crash fix.
! :HitTest() made more compatible.
+ Added proper wrappers for undocumented C5.3 vars.
+ Added support for Caption.
+ Added support for C5.3 color handling (it's quite ugly,
but it's on by default).
; Some snippets from xhb but heavily fixed.
* source/rtl/scrollbr.prg
* source/rtl/tpopup.prg
* source/rtl/radiogrp.prg
* source/rtl/listbox.prg
* source/rtl/checkbox.prg
* source/rtl/tget.prg
* source/rtl/ttopbar.prg
* source/rtl/pushbtn.prg
* source/rtl/radiobtn.prg
% __GUIColor() -> hb_ColorSelect()
* source/rtl/teditor.prg
* source/rtl/tbrowse.prg
! Fixed to assign SetColor() in New() rather than in INIT.
(INIT value gets evaluated and stored on first class usage,
not on every instantiantion.)
* source/rtl/tget.prg
* tests/rto_get.prg
+ Added Harbour extensions:
:hideInput (logical value)
:style (1 char long string to control mask character when :hideInput is .T.)
QUESTION: Is there any need to support multiple hiding styles?
(like always fully masked or masked with random chars?)
! Fixed several bugs in SET DELIMITERS handling.
(color, focus behaviour, "caching", positioning)
+ Added test cases for SET DELIMITERS issues.
* harbour/include/hbrdddbf.h
* harbour/source/rdd/dbf1.c
+ added two new members to DBFAREA structure: fModStamp and fTrigger
* harbour/include/hbrddntx.h
* harbour/include/hbrddcdx.h
* harbour/contrib/bmdbfcdx/hbrddbmcdx.h
* updated for DBFAREA structure modifications
* harbour/contrib/libct/ctnet.c
* use hb_stricmp() instead of stricmp()
* harbour/include/hbrddcdx.h
* harbour/source/rdd/dbfcdx/dbfcdx1.c
* updated for DBFAREA structure modifications
+ added some very basic support for order temperature flags
* source/rtl/getsys.prg
! Fix for crash in TGetList():ShowGetMsg() reported by Lorenzo.
* contrib/libct/blank.prg
* source/rtl/menuto.prg
* source/rtl/valtoexp.prg
* source/rtl/readkey.prg
* source/rtl/browse.prg
* source/debug/debugger.prg
+ Replaced END with ENDSWITCH and ENDWITH
* harbour/include/std.ch
* cover ENDSEQUENCE translation with HB_C52_STRICT macro
+ added translations for END SWITCH, END WITH, END OBJECT
* harbour/source/compiler/complex.c
* harbour/source/compiler/harbour.y
* harbour/source/compiler/harbour.yyc
* harbour/source/compiler/harbour.yyh
+ added support for ENDSEQ[UENCE], ENDSW[ITCH] and ENDW[ITH]
* harbour/source/rtl/hbgtcore.c
! changed string to color number translation to be fully Clipper
compatible. Now I do not know any examples which we translate
differently - if someone will find any them then please inform me.
The only one intentional difference between Harbour and Clipper
is in color number to string translation and background highlighting
attribute "*", Clipper put it just before "/" as part of foreground
color (f.e.: 248 => "N*+/W") but Harbour as part background color
(f.e.: 248 => "N+/W*") - Clipper compatible behavior is enabled when
Harbour is compiled with HB_C52_STRICT macro
* harbour/utils/hbtest/rt_misc.prg
* control the position of background highlighting attribute (*) in
expected results depending on HB_C52_STRICT. Harbour passes correctly
all included color translation tests.
* source/rtl/hbgtcore.c
! Fixed handling of some strangely formatted colorstrings
mainly inside TGet(). The low-level functionality
modified is the colorstring to number conversion. The
only change is to continue (and not exit) on a non-std
char.
* utils/hbtest/rt_misc.prg
+ Added some color string parsing tests. Some of them fail.
* source/rtl/achoice.prg
* source/debug/debugger.prg
* utils/hbtest/hbtest.prg
* utils/hbtest/rt_array.prg
* Formatting.
* tests/rto_get.prg
* source/rtl/tget.prg
! Fixed display issue when using display->varput->display
sequence. (Thanks Lorenzo)
+ Above case added to test suite.
* source/rtl/tbrowse.prg
+ Some scattered logic moved inside :Configure()
! Some TOFIX-es added.
! ::ColorSpec() to call Configure().
* source/debug/dbgtobj.prg
* source/debug/dbgwa.prg
+ Formatting, var name cleanup.