Using Conditional Expression in DataWindow Properties

    By: Mr. Rik Brooks on Sep 01, 2014

    In this article, Senior Programmer/Analyst, Rik Brooks, explains how to use conditional expressions in a DataWindow.

    Every object in a DataWindow has properties. The properties for each object depend upon the object type. For the purposes of this article, I am going to use a column object and the Color property. The Color property is the foreground color. You will find it in the Font tabpage of the properties box.

    The IF function is not the same as the if statement in PowerScript. The IF function is has the following format:

    IF(expression, true_value, false_value)

    So when the DataWindow encounters this it will look at the expression. If it evaluated to TRUE then it will return the “true_value”. If the expression evaluates to FALSE then it returns the last or the “false_value”).

    For example, suppose you have a column that holds the age of an individual. You want that age to be in red if the individual is under 18 and black if not. The IF could be put into the expression for Text Color. You need to go to your Properties panel, click on the Font tabpage then look for the Text Color. You will find a little button beside the Text Color. If you click on that button you will be able to edit the expression for the Font Color.


    Login to read the article. Not a member? Create a free account!

    Released: September 1, 2014, 11:00 am | Updated: November 3, 2014, 2:37 pm
    Keywords: PowerBuilder Article | Technical Journal | DataWindow | Design | Development | PowerBuilder | Rik Brooks




    Copyright © 2014 ISUG-TECH. All Rights Reserved
    All material, files, logos and trademarks within this site are copyright their respective organizations

    Terms of Service - Privacy Policy - Contact the Help Desk