PBDR.COM

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

 
 
Referencing Other Rows
In the datawindow expressions painter it can be useful to reference other rows within the datawindow result set. When building expressions when you use a column name you reference the data item in the current row. This is very powerful as PowerBuilder executes the expression for every row in turn based on the relative row position.

A useful feature is the ability to reference other rows from the current relative row. For example in a list of customers and orders you could check to see if the customer name has changed and display a bitmap to indicate the change of customer. You can do this with out creating a group band at break of customer which allows you to put the customer name next to the first order! Something you cannot do with a group band.

To access the properties you would code the access to the column with an array subscript following the column name. Only this is a special subscript that is relative to the current row:

bitmap( if( customer[ -1 ] = customer, '', 'smile.bmp' )

 

Top of Page

Legal Notice

Ken Howe 2011