|
of_read
|
|
Full name
|
pfc_n_cst_mru.of_read
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_read(string,string)
|
Name
|
Datatype
|
li_index
|
Integer
|
li_itemcount
|
Integer
|
li_rc
|
Integer
|
lnv_mruattrib
|
n_cst_mruattrib
|
ls_mrukeyname
|
String
|
ls_section
|
String
|
ls_value
|
String
|
protected function integer of_read (string as_section, string as_id);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Read
//
// Access: protected
//
// Arguments:
// as_section section to retrieve data from ini or registry
// as_id registered id to read in
//
// Returns: Integer
// SUCCESS = 1
// ERROR = -1
//
// Description: Get the key data from the ini file
//
//////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////
Integer li_index, li_rc, li_itemcount
String ls_mrukeyname, ls_value, ls_section
n_cst_mruattrib lnv_mruattrib
// check arguments
If IsNull(as_section) or as_section = "" or &
IsNull(as_id) or (as_id = "") Then
Return -1
End If
// Trim and Convert the ID to lower case.
as_id = Trim(Lower(as_id))
ls_section = as_section + " " + as_id
// get # of items to remember
of_ReadKeys(ls_section, is_mrucountkey, ls_value, string(ii_mruitemcount))
if isnumber(ls_value) then
li_itemcount = integer(ls_value)
else
li_itemcount = ii_mruitemcount
end if
// loop through mru item count and get information from storage location
for li_index = li_itemcount to 1 Step -1
ls_value = ""
ls_MRUKeyName = is_mruitemkey + string(li_index)
of_ReadKeys(ls_section, ls_MRUKeyName, ls_value, "")
// No data probably means first time through application, so don't generate an error
if ls_value = "" then
continue
end if
// can override decode logic in event script
li_rc = this.event pfc_decode(ls_value, lnv_mruattrib)
If li_rc < 0 Then exit
//Add the new row to the datastore
lnv_mruattrib.is_id = as_id
li_rc = of_additem(lnv_mruattrib)
If li_rc < 0 Then exit
end for
return li_rc
end function