EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Unbalanced conditional ?
From: Paul Nord <[email protected]>
To: Dirk Zimoch <[email protected]>
Cc: EPICS <[email protected]>
Date: Thu, 8 Dec 2011 08:16:24 -0600
Dirk,

I'm not certain how CALC handles this, but doesn't the standard C expression require this form:   W = X?Y:Z
This should render code equivalent to:
	if (X!=0) {
		W = Y;
	} else {
		W = Z;
	}

Without the colon and another value, your line simply says:  B = A

Perhaps the full line should have been in this form:
	B==0?A:C
Or this might be allowed:
	B==0?A
But I'm not sure what it does if "B==0" is false.

Paul


On Dec 8, 2011, at 3:21 AM, Dirk Zimoch wrote:

> Hi all,
> 
> When I tried to upgrade from 3.14.8 to 3.14.12, I found that some CALC expressions are not working any more, e.g. "B=0?A"
> 
> In 3.14.8 and all previous versions that meant: If B is 0 then set VAL to A otherwise don't change VAL.
> 
> Now, I get the error message:
> 
> Unbalanced conditional ?: operators in CALC expression 'B=0?A'
> Can't set "recordname.CALC" to "B=0?A"
> 
> Was there any good reason for this incompatible change in the CALC behavior?
> 
> Dirk
> 



References:
Unbalanced conditional ? Dirk Zimoch

Navigate by Date:
Prev: Re: [building EPICS in RHEL-5 64bit] environment variables Alan Greer
Next: Re: Unbalanced conditional ? Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Unbalanced conditional ? Dirk Zimoch
Next: Re: Unbalanced conditional ? Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·