|
of_additem
|
|
Full name
|
pfc_u_lvs.of_additem
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_additem(any[])
|
Name
|
Datatype
|
lds_datastore
|
n_ds
|
li_newindex
|
integer
|
ll_row
|
long
|
public function integer of_additem (any aa_columnvalues[]);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_AddItem
//
// Access: public
//
// Arguments:
// aa_ColumnValues[] The array containing the data to be used for the new item.
//
// Returns: Integer
// Returns the index of the item if it was added successfully,
// -1 if an error occurrs.
//
// Description: Add a new item to the ListView using a inserted row. The row does
// not have to be added to the datastore first using this method. Pass
// the row in with the aa_columnvalues array.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
long ll_row
integer li_newindex
n_ds lds_datastore
// check arguments
if upperbound(aa_columnvalues) < 1 Then Return -1
// Create the storage datastore
lds_datastore = create n_ds
If isvalid(inv_datasource) then
If inv_datasource.of_ConvertToRow(aa_columnvalues, lds_datastore, ll_row) <> 1 Then
Destroy lds_datastore
Return -1
End If
End If
// Add the item to the listview
li_newindex = this.event pfc_additem(lds_datastore, ll_row)
Destroy lds_datastore
return li_newindex
end function