PBDR.COM

About   -   Contact   -   Purchase   -   Search   -   What's New

 
 
Faster Boolean Assignment
Because PowerBuilder is an interpreted language then the size of your scripts can have an effect on your overall system speed. By reducing an objects size by 10% your object will load 10% faster, run 10% faster and use 10% less memory.

This next tip is something I use to help maximize every last drop of performance from PB when doing Boolean assignment.

Instead of coding:
IF a = b THEN
    cbx_1.checked = TRUE
ELSE
    cbx_1.checked = FALSE
END IF

Code:
cbx_1.checked = a = b

Another example:
IF dw_1.GetItemString( 1, "column" ) = "AND" THEN
    lb_Bool = TRUE
ELSE
    lb_Bool = FALSE
END IF

Code:
lb_Bool = dw_1.GetItemString( 1, "column" ) = "AND"

You can save space and slightly reduce execution time as well as object load times by using this simple technique.

 

Top of Page

Legal Notice

Ken Howe 2011