Got a couple of class methods , overloaded but one is defined as a pass "by addres"s the other is defined as pass “by value”.
Now the compiler already throws an error message with entities passed by value
Syntax Error: Procedure doesnt belong to module: CLASSNAME.PROCEDURE
I wouldnt have expected this message but the help docs isnt clear if entities are passed “by address” or “by value” if such a thing could exist, the help doc examples showing FILE are not really clear.
Anyway when I call a class with every datatype & entity overloaded so there is 1 “by address” method and 1 “by value” method (even though in procedure overloading all datatypes by values are treated the same so probably best to just use an ? (any) ), I found when calling the class using address(loc:byte) its treated as an any “by value”!
Shouldnt Address() work with the runtime recognising its being by passed “by address” instead of passing the variable address as “by value”?
I know technically Address() is working as expected, but its not working with the runtime parameters, or am I wrong in this instance?
Open to opinions!
TIA
!*Key and *Index are the same entities
Code
App Window Byte Button Take Accepted.
Case Upper(Loc:Type)
OF 'STRING'
Message(CallClass:GetParam.DataTyperS(Address(Loc:Byte)))
OF 'LONG'
Message(CallClass:GetParam.DataTyperL(Address(Loc:Byte)))
Else
Message('Error')
End
Class GetParam
IS_DTL:Byte Equate(04h)
IS_DTS:Byte Equate('_BYTE_')
DataTyperS Procedure(*Byte pType),String
!DataTyperS Procedure(Byte pType),String !Procedure Overloading Rule 6 - Using ? (an ANY)
DataTyperL Procedure(*Byte pType),Long
!DataTyperL Procedure(Byte pType),Long !Procedure Overloading Rule 6 - Using ? (an ANY)
GetParam.DataTyperS Procedure(*Byte pType)
Code
Return IS_DTS:Byte
!GetParam.DataTyperS Procedure(Byte pType) !Procedure Overloading Rule 6 - Using ? (an ANY)
! Code
! Return IS_DTS:Byte
GetParam.DataTyperL Procedure(*Byte pType)
Code
Return IS_DTL:Byte
GetParam.DataTyperL Procedure(Byte pType) !Procedure Overloading Rule 6 - Using ? (an ANY)
Code
Return IS_DTL:Byte