|
of_Retrieve
|
|
Full name
|
pfc_n_cst_lvsrv_datasource.of_Retrieve
|
Access
|
public
|
Extend of
|
long
|
Return value
|
long
|
Prototype
|
public function long of_Retrieve(any[20],ref n_ds)
|
Name
|
Datatype
|
ll_cnt
|
long
|
ll_NewRows
|
long
|
lw_parentwindow
|
window
|
public function long of_Retrieve (any aa_args[20], ref n_ds ads_data);//////////////////////////////////////////////////////////////////////////////
// Public Function: of_Retrieve
// Arguments: aa_Args[20] An array of type Any which contains the retrieval arguments to the DataStore.
// Returns: Long
// Returns the number of items retrieved if successful
// -1 if an error occurred
// Description: Retrieve the data for ListView with items from the data source.
//////////////////////////////////////////////////////////////////////////////
// Rev. History: Version
// 6.0 Initial version
// 7.0 Changed the datatypes of local "row" variables from integer to long
//////////////////////////////////////////////////////////////////////////////
// Copyright © 1996-1999 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_NewRows, ll_cnt
window lw_parentwindow
if IsNull(ilv_requestor) or not Isvalid(ilv_requestor) then return -1
// Retrieve data into the DataStore and pass the arguments to the cache
if (inv_Attrib.is_method = inv_Cache.SQL) or (inv_Attrib.is_method = inv_Cache.RETRIEVE) then
// register the arguments; retrieve the cache and get the reference
inv_Cache.of_RegisterArgs(CACHE_ID, aa_Args)
if inv_Cache.of_Refresh(CACHE_ID) < 0 then return -1
end if
// Get a reference to the cache - data was retrieved on registration
if inv_Cache.of_GetRegistered(CACHE_ID, ads_data) <> 1 then return -1
// turn back on the base service as cache does not turn it on
ads_data.of_SetBase(true)
//// datastore needs parent window reference to perform updates
//ilv_requestor.of_Getparentwindow(lw_parentwindow)
//ads_data.of_SetParentWindow(lw_parentwindow)
// Clear the status flags for the new rows - want them to be notmodified!
ll_NewRows = ads_data.RowCount()
for ll_Cnt = 1 to ll_NewRows
ads_data.SetItemStatus(ll_Cnt, 0, Primary!, DataModified!)
ads_data.SetItemStatus(ll_Cnt, 0, Primary!, NotModified!)
next
// return the rows in the datasource
return ll_NewRows
end function