numsandwich(
PRIMARY
,
EXTRA
)

The numsandwich( function is similar to the sandwich function, but for numbers. If the value is zero the result is zero, but if the value is not zero the result is the value plus the extra.


Parameters

This function has two parameters:

primary – primary numeric value

extra – extra numeric value


Description

This function is similar to the sandwich function, but for numbers. If the primary value is zero the result is zero, but if the primary value is not zero the result is the primary value plus the extra value. For example, this could be useful for calculating the size of an object plus a border. If the object size is zero, the border is omitted also.

numsandwich(20,10) ☞ 30
numsandwich(0,10) ☞ 0

Note: This function is equivalent to:

?(value<>0,value+extra,0)

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.