Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I cast a String to a BOOLEAN in PB 7 ??

Status
Not open for further replies.

PANTLORD

Programmer
Aug 28, 2001
49
EU
Hi there,

Just wondering if I can cast a datastore string value to a boolean like below;

BOOLEAN(a_local_datastore.object.field_name[1])

It doesn't seem to want to let me do it. I am passing this value to a BOOLEAN type in a struct and know that the datastore will return NO or YES.

Any ideas on how I can acheive this if not by casting?

Many thanks
Niall

[thumbsup2]
 
Hi,

Try something like:
Code:
boolean lb_Value
lb_Value = (String(a_local_datastore.object.field_name[1])="YES")
struct.boolean = lb_Value

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top