F_DATAWINDOW_COPY

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name : f_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!)

0 comments:

Post a Comment