TagRead() in text display functions does not work.

I cannot get TagRead to return a value in an text object with numeric display.

Consider the following example:

INT FUNCTION IsGreater(sTag)

RETURN StrToInt(TagRead(sTag)) > 100

END

If this function is placed in a text object the function displays nothing.  If I run this function in function Message() I receive a result. 

Parents
  • Correct. You cannot use blocking functions on graphics pages.
    Please change your function so that is accepts values instead of tag names:

    INT FUNCTION IsGreater(INT iValue)
    RETURN (iValue > 100)
    END


    Change the text object expression so that it calls the function with the value of the tag:
    IsGreater(MyTag)

    and not:
    IsGreater("MyTag")

    You could also omit the function entirely by entering the equation directly in the text object:
    (MyTag > 100)
Reply
  • Correct. You cannot use blocking functions on graphics pages.
    Please change your function so that is accepts values instead of tag names:

    INT FUNCTION IsGreater(INT iValue)
    RETURN (iValue > 100)
    END


    Change the text object expression so that it calls the function with the value of the tag:
    IsGreater(MyTag)

    and not:
    IsGreater("MyTag")

    You could also omit the function entirely by entering the equation directly in the text object:
    (MyTag > 100)
Children
No Data