PowerBuilder Function DataWindow Copy gf_datawindow_copy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
///////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Function Name : gf_datawindow_copy // Argument Name : adw_1, Arg Type : datawindow, Pass By : Value // adw_2, Arg Type : datawindow, Pass By : Reference // Return Type : (None) /////////////////////////////////////////////////////////////////////////////////////////////////////////////// String ls_dwcopy String ls_type String ls_name String ls_count Datawindowchild ldw_child Integer li_count Integer li_index Integer li_rc //accept text on datawindow about to be copied adw_1.AcceptText() //clear out the destination adw_2.Reset() //This section is not needed if the destination does not contain child datawindows. ls_count = adw_2.Object.DataWindow.column.count li_count = Integer (ls_count) For li_index = 1 To li_count ls_type = adw_2.Describe("#" + String(li_index) + ".edit.style") If ls_type = "dddw" Then ls_name = adw_2.Describe("#" + String(li_index) + ".name") li_rc = adw_2.GetChild(ls_name , ldw_child) If li_rc = -1 Then MessageBox("Error on DWC Retreive",String(li_rc)) Else ldw_child.SetTransObject(sqlca) ldw_child.Retrieve() End If End If Next //put the data portion of source datawindow into a string adw_1.RowsCopy(1, adw_1.RowCount(), Primary!, adw_2, 1, Primary!) |
Good Luck!
Subscribe
Login
0 Comments
Oldest