I have defined a class property as a raw value, however I cannot get the property set. Here is what I have:
Class TestRawProp:
define private property rHexCode as raw
get.
set.
constructor public TestRawProp:
def var rTemp as raw.
put-string(rTemp,1) = "Test".
TestRawProp:rHexCode = rTemp.
rTemp = "".
rTemp = TestRawProp:rHexCode().
message get-string(rTemp,1) view-as alert-box.
end constructor.
end class.
The message statement shows the unknown value. Any help would be appreciated.
I tried running this code but ended up in multiple errors (CONSTRUCTOR missing parentheses, Unknown field TestRawProp, Incompatible data types in assignment etc). I fixed all these and I get the expected output. Please see the following code. If there is something else you are running, please provide complete ABL code.
Class TestRawProp: define private property rHexCode as raw get. set. constructor public TestRawProp(): def var rTemp as raw. put-string(rTemp,1) = "Test". rHexCode = rTemp. PUT-STRING(rTemp,1) = "". rTemp = rHexCode. message get-string(rTemp,1) view-as alert-box. end constructor. end class.
DEFINE VAR trp AS CLASS TestRawProp. trp = NEW TestRawProp().
Something is wrong with your example and I do not expect it to compile, since you reference rHexCode as if it is a static property (prefixing the class name) instead of an instance property (THIS-OBJECT).
Please fix the example to something that is syntactically correct, so that we can see where your actual problem is.
Sorry, the code was a snip.