of_load


pfcapsrv.pbl   >   pfc_n_cst_mru   >   of_load   

Full name pfc_n_cst_mru.of_load
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_load()

Name Datatype
No Data

Name Datatype
li_index integer
li_itemcount integer
li_rc integer
lnv_string n_cst_string
ls_defaultcount string
ls_id string
ls_iditemcount string
ls_MRUKeyName string
ls_value string

protected function integer of_load ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:	of_Load
//
//	Access:		protected
//
//	Arguments:	None
//
//	Returns:		integer
//	SUCCESS = 1
//	ERROR = -1
//
//	Description:
//	Load the key data to the mrukeys datastore from the ini file or registry
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_rc, li_itemcount, li_index
string	ls_id, ls_MRUKeyName, ls_value, ls_defaultcount, ls_iditemcount
n_cst_string	lnv_string

// cannot restore mru info without this information
if (is_userinifile = "") and (is_userkey = "") then
	return -1
end if

// get # of default items for entire MRU process
// [MRU]
// itemcount=
ls_defaultcount = string(ii_mruitemcount)
of_ReadKeys(is_mrusection, is_mrucountkey, ls_value, ls_defaultcount)
if isnumber(ls_value) then
	// use new value over default one
	ii_mruitemcount = integer(ls_value)
end if

//read registered id list
// [MRU Registered Id]
// itemcount=
// itemX=id=Employee Window;iditemcount=5
of_ReadKeys(is_mruregisteredsection, is_mrucountkey, ls_value, ls_defaultcount)
li_itemcount = integer(ls_value)
for li_index = 1 to li_itemcount
	ls_MRUKeyName = is_mruitemkey + string(li_index)
	of_ReadKeys(is_mruregisteredsection, ls_MRUKeyName, ls_value, "")
	if ls_value <> "" then
		ls_id = lnv_string.of_GetKeyValue (ls_value, "id", is_delimiter)
		ls_iditemcount = lnv_string.of_GetKeyValue (ls_value, "iditemcount", is_delimiter)
		ls_id = Trim(Lower(ls_id))
		if IsNumber(ls_iditemcount) then
			li_rc = of_Register(ls_id, integer(ls_iditemcount))
		else
			li_rc = of_Register(ls_id)
		end if
		if li_rc < 0 then exit
	end if
end for

//read registered id data
// [MRU id]
// itemcount=
// itemX=xxx
li_itemcount = upperbound(inv_register)
for li_index = 1 to li_itemcount
	ls_id = inv_register[li_index].is_id
	li_rc = of_Read(is_mrusection, ls_id)
	if li_rc < 0 then exit
end for

//read general info
// [MRU]
//li_rc = of_Read(is_mrusection)

return li_rc
end function

     
Name Owner
pfc_n_cst_mru.pfc_open pfc_n_cst_mru

     
Name Owner
systemfunctions.integer systemfunctions
systemfunctions.isnumber systemfunctions
systemfunctions.lower systemfunctions
systemfunctions.string systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_mru.of_readkeys pfc_n_cst_mru
pfc_n_cst_mru.of_register pfc_n_cst_mru
pfc_n_cst_mru.of_register pfc_n_cst_mru
pfc_n_cst_mru.of_read pfc_n_cst_mru
pfc_n_cst_string.of_getkeyvalue pfc_n_cst_string

     
Full name
No Data

     
Name Scope
No Data