Mike,
I believe the following will work if you use a formula in an
IF/THEN/ELSE object. In this example, the "B" input pin of the
IF/THEN/ELSE has been renamed "Rec" (you may name the pin any thing you
want, using the A.B syntax, the expression to the left of the dot is the
pin name and the expression to the right is the name of the record
field). This also assumes myField is a text scalar.
+---------------------------+
+------+ | IF/THEN/ELSE |
| TEXT | +---------------------------+
+------+---------------| A | | THEN |
|abcdef| |---| A==Rec.myField |------+
+------+ ---|Rec| | ELSE +
| +---+----------------+------+
+----------------+ |
| RECORD | |
+----------------+ |
|myField| abcdef |---
+----------------+
Gustin, Mike wrote:
>
> Hi Everyone,
>
> I am trying to compare a text string with a record text string to see if
> they are equal, using the relational operator == . When I do this I get an
> error message "Unable to convert text to record" or "Unable to convert
> record to text" depending on how I hook it up.
>
> I have tried using "Get Field" and the A.B syntax in relational expression
> to extract the field back as text but it does not work.
>
> Mike Gustin
> mgustin@sme.siemens.com
I believe the following will work if you use a formula in an
IF/THEN/ELSE object. In this example, the "B" input pin of the
IF/THEN/ELSE has been renamed "Rec" (you may name the pin any thing you
want, using the A.B syntax, the expression to the left of the dot is the
pin name and the expression to the right is the name of the record
field). This also assumes myField is a text scalar.
+---------------------------+
+------+ | IF/THEN/ELSE |
| TEXT | +---------------------------+
+------+---------------| A | | THEN |
|abcdef| |---| A==Rec.myField |------+
+------+ ---|Rec| | ELSE +
| +---+----------------+------+
+----------------+ |
| RECORD | |
+----------------+ |
|myField| abcdef |---
+----------------+
Gustin, Mike wrote:
>
> Hi Everyone,
>
> I am trying to compare a text string with a record text string to see if
> they are equal, using the relational operator == . When I do this I get an
> error message "Unable to convert text to record" or "Unable to convert
> record to text" depending on how I hook it up.
>
> I have tried using "Get Field" and the A.B syntax in relational expression
> to extract the field back as text but it does not work.
>
> Mike Gustin
> mgustin@sme.siemens.com
Hi Everyone,
I am trying to compare a text string with a record text string to see if
they are equal, using the relational operator == . When I do this I get an
error message "Unable to convert text to record" or "Unable to convert
record to text" depending on how I hook it up.
I have tried using "Get Field" and the A.B syntax in relational expression
to extract the field back as text but it does not work.
According to the HP-Vee reference book a dyadic operator, such as
==,supports combining records and other data types but it does not seem to
work. The reference book refers the output as being converted to a record
type but then how do you access the record? A relational object should
return a 0 or 1 which confuses the issue more. Besides using a relational
object I have tried using conditional objects also with the same result.
I greatly appreciate any help.
Mike Gustin
mgustin@sme.siemens.com