Search This Blog

Friday, January 31, 2014

Comparison of variant value with a number in one step

Hi

Sometimes you may need to compare some field value with a particular number in one step.
F.x. you may have something like this:

if <expression> then

elseif <expression> then

elseif <expression> then

end if

However if a field of a Number type is empty

 then its value has Text type


My suggestion is next

You cannot use pure lotusscript to do required comparison in one step because of lotusscript run-time error.

if isnumeric(doc.numberfield(0)) and doc.numberfield(0) > 50 then '<-- Error here

elseif <expression> then

elseif <expression> then

end if

However, @Formula language can handle such case using the same way:

@if(@isNumber(numberfield) & numberfield>50)

So all you need to do is to use the following construction:

if Join(Evaluate({@if(@isNumber(numberfield) & numberfield>50; "Yes"; "No")}, doc)) = "Yes" then

elseif <expression> then

elseif <expression> then

end if

No comments:

Post a Comment