This is something strange too:
FUNCTION MAIN()
LOCAL oTest := Test()
? AT( "", "Test" )
? AT( "", oTest:Test )
INKEY( 0 )
RETURN NIL
#include "Hbclass.ch"
CLASS Test
DATA Test INIT "Test"
ENDCLASS
The result is:
1
0
Shouldn't be the same value? With Harbour I get:
0
0
Another sample:
FUNCTION MAIN()
LOCAL cVar := "Test"
LOCAL oTest := Test()
? AT( "", "Test" )
? AT( "", cVar )
? AT( "", oTest:Test )
INKEY( 0 )
RETURN NIL
#include "Hbclass.ch"
CLASS Test
DATA Test INIT "Test"
ENDCLASS
Result:
1
0
0
Harbour:
0
0
0
Expected:
1
1
1
An empty string is contained in any string.
The inconsistency is becaussse when using the CONSTANT values "" and
"Test" the result is generated in COMPILE TIME by the compiler, and it obviously has a minor bug - comapred to the RTL implementtation.
The decision to have 0 vs. 1 I suppose iss arbitrary - both makes sense
it just has to be consistent. :)
Thank you. Can you fix it?
Enrico, sorry for the delayed reply - I have been very busy the past few montths. I don't know whenn I willl have the time. I will try when I can.
Il 18/07/2024 20:54, Ron Pinkas ha scritto:
The inconsistency is becaussse when using the CONSTANT values "" and
"Test" the result is generated in COMPILE TIME by the compiler, and it obviously has a minor bug - comapred to the RTL implementtation.
The decision to have 0 vs. 1 I suppose iss arbitrary - both makes sense
it just has to be consistent. :)
Thank you. Can you fix it?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 53:07:28 |
Calls: | 10,397 |
Calls today: | 5 |
Files: | 14,067 |
Messages: | 6,417,392 |
Posted today: | 1 |