Schultz’s PowerBuilder Notes

More Modify and Describe


How do I change the contents of a text field?

ls_modify = “name.text = ‘” + ls_location_name + “’”
ls_rc = dw_1.Modify(ls_modify)
If ls_rc = “” then
   MessageBox(“dw_1.Modify(ls_modify)”, “Failure”)
End if

How do I get a column property

if ll_rc > 0 then
   choose case dwo.name
      case "cb_costing_editor"
         ls_eval = "'if(timesheet_hours = costing_hours or (recon_ind = ~"N~" and wrkr_tp_cd = 2),0,6)'"
     ls_eval = "evaluate(" + ls_eval + ", " + String(row) + ")"
     ls_border = dw_worker_display.Describe(ls_eval)
     if ls_border = lcs_RAISED the // Get the costing information off the timesheet
            ldbl_costing_hours       = dw_worker_display.GetItemDecimal(row, "costing_hours")
            ldbl_timesheet_hours     = dw_worker_display.GetItemDecimal(row, "timesheet_hours")

            if (ldbl_costing_hours <> ldbl_timesheet_hours) then
               if wf_open_employee_specific(row) < 0 then
                  ll_rc = FAILURE
               end if
            end if
         end if
   end choose
end if&#91;/sourcecode&#93;
<h3>Remove bolding from columns</h3>
//Remove bolding from dw columns
li_col_cnt = Integer(dw_rows.Object.DataWindow.Column.Count)
for li_col = 1 to li_col_cnt
   ls_modify = "#" + string(li_col) + ".Font.Weight =  400"
   dw_rows.Modify(ls_modify)
next

Tips on Building Modify and Describe Expressions

DwSyntax Utility.

Examine Datawindow Export code and look for how similar expressions are built.

Advertisements

May 22, 2008 - Posted by | Modify and Describe | , , , , , , , , , , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: