If the text that you want to compare is in an editable text field or is otherwise selectable, then you can copy it to the clipboard on the SUT and then pull that value into your script. Here’s some sample code for what that might look like:
typeText commandkey, "a"
TypeText commandkey, "c"
put RemoteClipboard() into testVal
if testVal is not equal to "5.58"
logError "field is displaying wrong value:" && testVal
Another approach would be to use the text-image generation feature to create a text image of the value that you are looking for. This requires that you know the font properties (face, size, etc.) used to display the text. This would look something like this:
if not imageFound((Text:"5.58", TextFont:"Helvetica", TextSize:"10"))
logError "Incorrect value displayed"
Note that this command could use a variable in place of the hard-coded text string so that you could iterate through many values:
if not imageFound((Text:myStringVar, TextFont:"Helvetica", TextSize:"10"))
logError myStringVar && "not found"