Init

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalNumber Init(SalString sSourceName,
SalWindowHandle hWndSource,
SalArray<SalString> sItemNames,
SalArray<SalWindowHandle> hWndItems)

The Init method initializes the DataTransfer object from a single-record or multi-record data source, or a combo box.

Parameters

Name Description
SalString sSourceName Name of the transfer source object. For data sources this is typically the name of the Logical Unit associated with the data source.
SalWindowHandle hWndSource Window handle of transfer source object.
SalArray<SalString> sItemNames Array with names of all the items to be transferred. These names are later used at the destination to retrieve the transferred data.
SalArray<SalWindowHandle> hWndItems Array with window handles of all the items to be transferred. These handles are used by the DataTransfer object to collect the data to be transferred.

Returns

This method does not return a value.

Comments

If a single-record data source (e.g. cFormWindow) is used, only the current record will be stored in the DataTransfer object. If a multi-record data source (e.g. cTableWindow) is used, all selected rows will be stored in the DataTransfer object.

Application forms are concidered as multiple-record data sources???

Example

Set sArray[0] = 'CUSTOMER_ID'
Set hWndArray[0] = colCustomerId
Set sArray[1] = 'ORDER_ID'
Set hWndArray[1] = colOrderId
Call DataTransfer.Init( 'DemoOrder', hWndForm, sArray, hWndArray )
Call SalCreateWindow ( 'frmDemoOrder', hWndMDI )
C# code
// Data transfer
Var.DataTransfer.Init("ReportParameter", SalWindowHandle.Null, sArray, hWndArray);
sArray[0] = ((SalTableColumn)SalWindow.FindControl(i_hWndSelf, "colResultKey")).Number.ToString(0);
Var.DataTransfer.ItemAdd("RESULT_KEY", sArray);
sArray[0] = sReportId;
Var.DataTransfer.ItemAdd("REPORT_ID", sArray);
sArray[0] = sParameters;
Var.DataTransfer.ItemAdd("PARAMETERS", sArray);
// Open customized dialog
Sal.ModalDialog(sDialog, Sys.hWndMDI);