Description

ETMethod provides services that are analogous to the Set_Property (properties ROWDATA, COLDATA, LIST, SORTEDCOL) and Send_Message (messages INSERT, DELETE) functionality with the important difference that those services first attempt to modify bound DataSets. If the attempt to modify the DataSet(s) is successful, the edit table(s) is modified accordingly.

Syntax

success = ETMethod (ETName, service, param1, param2, error)

Parameters

ETMethod accepts the following parameters:

ParameterDescription
ETNameThe name of an edit table control.
ServiceThe name of a service. Possible values are: INSERT, DELETE, UPDATE, SORT, and TRIM.
Param1Varies dependent on Service.
Param2Varies dependent on Service.
ErrorThe error text that is returned if the function fails.

Services

The table below describes the each of the above mentioned Services:

ServiceDescription
INSERTParam1 = RowNumber, Param2 = RowData. Inserts values represented in RowData as a row number (RowNumber) into a DataSet or edit table. If RowNumber is -1, the row is appended. If RowData is not specified, it behaves like the DSOINSERT event, collecting data from other (not EditTable) controls bound to the DataSet and inserting the assembled row instead.
DELETEParam1 = RowNumber, Param2 = RowData (output parameter). Deletes a row number (identified by RowNumber variable) from the DataSet or edit table and returns the values from the deleted row to the RowData variable.
UPDATEParam1 = RowData, Param2 = Coords. Where Coords is an array composed of: ColumnNumber :@fm: RowNumber. If the ColumnNumber variable is 0 (zero), the entire row is updated; if the RowNumber variable is 0, the entire column is updated; if both variables are 0, all columns are updated; and if both variables are not 0, just the cell is updated. Behaves similar to the Set_Property function (ETName, DEFPROP$, RowData, Coords).
SORTParam1 = SortColList :@fm: DirectionList, Param2 = N/A. Sorts a DataSet or edit table by the specified columns and directions where SortColList and DirectionList are @vm delimited arrays. See the SORTEDCOL property.
TRIMParam1 = SafeDeleteFlag, Param2 = N/A. Removes the empty rows from an edit table or DataSet. If SafeDeleteFlag is set to TRUE$, the row is deleted only if both the entire DataSet row and the entire edit table row are empty.

Returns

A Boolean value indicating success (1) or failure (0)

See also

Set_Property()SORTEDCOL propertyDSOINSERT event

Example

Set = @window: ".DBTABLE_1"
sort = 1: @fm: 1 ;     * sort first column ascending
if ETMethod (et, 'SORT', sort, "", error) else
       MSG ("", error)
       return
end
  • No labels