Different results depending on how properties are read in expressionsPermanent link for this heading

Last update: 4 August 2017

When properties of objects are read in Fabasoft expressions and then used as in-parameters for methods different results can appear depending on the way the properties are read.

  • Option 1: Reading the property via

%3Cobject%20allow%3D%22autoplay%22%3E.%3A%20The%20attribute%20definition%20of%20the%20target%20attribute%20is%20regarded%3C%2Fobject%3E

By clicking on the video, your IP address will be transmitted to YouTube and YouTube will know that you have watched the video.

  • Option 2: Reading the property via

%3Cobject%20allow%3D%22autoplay%22%3E.GetAttributeValue%28%2C%20%29%3A%20Due%20to%20technical%20reasons%20the%20attribute%20definition%20cannot%20be%20regarded%3C%2Fobject%3E

By clicking on the video, your IP address will be transmitted to YouTube and YouTube will know that you have watched the video.

This behavior has practical consequences especially when DATETIME-properties are read as the attribute definition defines whether date and time are stored in local time or UTC.

Example: COO.10.7715.3.7602.TESTSWC@10.7715:testdate was set to 31.12.2008 in GUI.

Reading the property via option 1 and formatting via COOSYSTEM@1.1:Format(...) :

       coort.Trace(COOSYSTEM@1.1:Format(COO.10.7715.3.7602.TESTSWC@10.7715:testdate, "yymmdd")[4]);

    

returns 090101

Reading the property via option 2 and formatting:

       coort.Trace(COOSYSTEM@1.1:Format(COO.10.7715.3.7602.GetAttributeValue(cootx, "TESTSWC@10.7715:testdate",0), "yymmdd")[4]);

    

returns 081231.

The technical background is that the Fabasoft kernel is not able to determine the underlying attribute definition (including the property „Disable Conversion“) and therefore treats the DATETIME value like any value returned from an external ActiveX call.

Conclusio: Reading properties in expressions should be done via option 1 (

%3Cobject%20allow%3D%22autoplay%22%3E.%29%20whenever%20possible.%20If%20it%20is%20by%20any%20reason%20absolutely%20necessary%20to%20use%20option%202%20an%20explicit%20typecast%20to%20the%20desired%20attribute%20definition%20has%20to%20be%20used.%20For%20the%20example%20listed%20above%20this%20would%20look%20like%20the%20following%3A%3C%2Fobject%3E

By clicking on the video, your IP address will be transmitted to YouTube and YouTube will know that you have watched the video.

       coort.Trace(COOSYSTEM@1.1:Format(TESTSWC@10.7715:testdate(COO.10.7715.3.7602.GetAttributeValue(cootx, "TESTSWC@10.7715:testdate",0)), "yymmdd")[4]);

    

Download PDF

Download PDF