Pritpal Bedi wrote:
Przemek

#include 'xhb.ch'
#include 'hbclass.ch'
ENABLE TYPE CLASS ALL
Function Main()
   Local x
   x := {'121',12,.t.}
   ? x:isScalar       //   .T.
   ? x:asString      //   Error!
   ? x:Add( 200 )   //   Alert with error message:  Error BASE/1004 Message not 
found :ADD
   ? x:asString
   inkey(0)
   Return nil
What I am missing ?

It's caused by: #include 'xhb.ch'
See in contrib/xhb/xhbcomp.prg definitions used for overloaded character,
numeric, array and hash classes. Then look at source/rtl/tscalar.prg
in xHarbour repository and add other definitions you need.
If you are not interested in exact xHarbour behavior but rather in
class(y) compatiblity then you can simply add to these classes inheriting
from corresponding hb* ones (f.e. hbArray()).
If you want to add such modifications to SVN then please look at xHarbour
version of: ENABLE TYPE CLASS ALL command and then copy it to hbcompat.ch
and add _<type>() functions which will have the same functionality as in
xHarbour plus the ones included in contrib/xhb/xhbcomp.prg
All of the above is done at .prg level and can be changed by user.

best regards,
Przemek

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to