Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Expression to Convert a Boolean to a Number
PostPosted: Wed Sep 09, 2015 9:30 am 

Joined: Tue Sep 08, 2015 1:32 pm
Posts: 15

Offline
I was wondering if it's possible to use an expression on a Curve within a TrendViewer that would change a boolean dataSource value to 0 if it's false and 10 if it's true.

From what I have seen in the examples they seem to return only 0 or 1 unless using a System.Math function. Is it possible to create our own function and reference that in the expression?

Thanks in advance.


 Profile  
 
 Post subject: Re: Expression to Convert a Boolean to a Number
PostPosted: Wed Sep 16, 2015 8:53 am 

Joined: Tue Sep 08, 2015 1:32 pm
Posts: 15

Offline
I realised that I answered this question myself while typing the question!

I created a public static function in a script module then called this function in the expression, works perfectly.


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron