Topic Options
#56640 - 01/17/19 12:20 PM Global Condition Not a String
daveg@rexlumber. Offline
OL Newbie

Registered: 06/29/15
Posts: 12
Is it possible to base a condition on a field that is not a string? e.g. if a discount_total = 0.00, can I determine whether or not text boxes are displayed based on the global condition if discount_total = 0.00.

Top
#56641 - 01/17/19 12:40 PM Re: Global Condition Not a String [Re: daveg@rexlumber.]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 435
Loc: Québec, Canada
Yes it is, but if the value, for the condition, comes from the data, then it is a string.

But, lets say that you have a data value that you wish to use based on whether or not it is greater than '0.00'. Then you need first to convert your string value '0.00' to a floating point value (float) like so:

if(&myVar > strtofloat('0.00'))
...
...
enfif()

Top
#56646 - 01/17/19 03:12 PM Re: Global Condition Not a String [Re: daveg@rexlumber.]
daveg@rexlumber. Offline
OL Newbie

Registered: 06/29/15
Posts: 12
This would be done in the Press Talk of the Condition?

Top
#56647 - 01/17/19 03:15 PM Re: Global Condition Not a String [Re: daveg@rexlumber.]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 435
Loc: Québec, Canada
Yes...or it could be done in any object where you have the field name being in marroon (redish). This means it is a field that allows PressTalk expression.

Top
#56648 - 01/17/19 03:16 PM Re: Global Condition Not a String [Re: daveg@rexlumber.]
daveg@rexlumber. Offline
OL Newbie

Registered: 06/29/15
Posts: 12
Thank you I will try.

Top