19990913-23:45 GMT+1

This commit is contained in:
Viktor Szakats
1999-09-13 21:59:48 +00:00
parent 32ac78f791
commit eeb5147b8e
7 changed files with 29 additions and 16 deletions

View File

@@ -1,3 +1,21 @@
19990913-23:45 GMT+1 Victor Szel <info@szelvesz.hu>
* source/vm/hvm.c
+ hb_vmInString() - Added support for overloading the "$" operator.
! hb_vmPlus() - Fixed the operator overloading feature.
+ hb_vmNotEqual() - Added support for alternate notequal operators:
"<>" and "#".
* tests/working/rtl_test.prg
tests/working/overload.prg
- Removed +=, -= tests, since they will destroy the object, basically
this gets executed: oString := oString + "Hello", where the right side
expression will result in a string, which gets assigned to the object.
This could be fixed by changing the overloader block to return self BTW,
but from the test point of view, this is the same as "+"/"-".
* gt.b32
makefile.b32
runner.b32
! Fixes by Jose Lalin
19990913-23:00 GMT+1 Victor Szel <info@szelvesz.hu>
* ChangeLog
ChangeLog.003

View File

@@ -41,7 +41,7 @@ numtxten.c : numtxten.prg harbour.exe
.prg.c:
bin\harbour $< /n /osource\tools /iinclude
bin\harbour $< /n /osource\tools\ /iinclude
.c.obj:
bcc32 -c -O2 -I.\include -o$@ $<

View File

@@ -24,8 +24,6 @@ harbour.lib : achoice.obj adir.obj alert.obj arrays.obj asort.obj \
set.obj setcolor.obj setkey.obj strfmt.obj strings.obj symbols.obj stringp.obj \
stringsx.obj tbcolumn.obj tbrowse.obj tbrwtext.obj tclass.obj tget.obj tgetlist.obj tone.obj transfrm.obj
symbols.obj : symbols.asm
achoice.obj : achoice.c extend.h hbdefs.h
adir.obj : adir.c extend.h hbdefs.h
alert.obj : alert.c extend.h hbdefs.h
@@ -107,9 +105,6 @@ tget.c : tget.prg harbour.exe
tgetlist.c : tgetlist.prg harbour.exe
readvar.c : readvar.prg harbour.exe
xsavescr.c : xsavescr.prg harbour.exe
.asm.obj:
tasm32 $<, $@
tlib .\libs\b32\harbour.lib -+$@,,
.prg.c:
bin\harbour $< /n /osource\rtl\ /iinclude

View File

@@ -17,7 +17,7 @@ runner.c : runner.prg
external.c : external.prg
.prg.c:
bin\harbour $< /n /osource\runner\stdalone /iinclude /p
bin\harbour $< /n /osource\runner\stdalone\ /iinclude /p
.c.obj:
bcc32 -c -O2 -I.\include -v -o$@ -DHARBOUR_USE_GTAPI $<

View File

@@ -1441,6 +1441,8 @@ void hb_vmInstring( void )
hb_stackPop();
hb_vmPushLogical( iResult == 0 ? FALSE : TRUE );
}
else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "$" ) )
hb_vmOperatorCall( pItem1, pItem2, "$" );
else
{
PHB_ITEM pResult = hb_errRT_BASE_Subst( EG_ARG, 1109, NULL, "$" );
@@ -1660,6 +1662,12 @@ void hb_vmNotEqual( void )
else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "!=" ) )
hb_vmOperatorCall( pItem1, pItem2, "!=" );
else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "<>" ) )
hb_vmOperatorCall( pItem1, pItem2, "<>" );
else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "#" ) )
hb_vmOperatorCall( pItem1, pItem2, "#" );
else if( pItem1->type != pItem2->type )
{
PHB_ITEM pResult = hb_errRT_BASE_Subst( EG_ARG, 1072, NULL, "<>" );
@@ -1901,7 +1909,7 @@ void hb_vmPlus( void )
hb_vmPushDate( lDate1 + dNumber2 );
}
else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem2, "+" ) )
else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "+" ) )
hb_vmOperatorCall( pItem1, pItem2, "+" );
else

View File

@@ -37,10 +37,6 @@ function Main()
QOut( "Greater than or Equal:", oString <= "Hello" )
QOut( "Concatenation + :", oString + "Hello" )
QOut( "Concatenation - :", oString - "Hello" )
oString += " World"
QOut( "Compound += :", oString )
oString -= " World"
QOut( "Compound -= :", oString )
return nil

View File

@@ -1967,10 +1967,6 @@ STATIC FUNCTION Main_OPOVERL()
TEST_LINE( oString <= "Hello" , .T. )
TEST_LINE( oString + "Hello" , "HelloHello" )
TEST_LINE( oString - "Hello" , "HelloHello" )
oString:cValue := "Hello"
TEST_LINE( oString += " World" , "Hello World" )
oString:cValue := "Hello"
TEST_LINE( oString -= " World" , "Hello World" )
RETURN NIL