of_write


pfcapsrv.pbl   >   pfc_n_cst_mru   >   of_write   

Full name pfc_n_cst_mru.of_write
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_write(string,integer)

Name Datatype
No Data

Name Datatype
li_index integer
li_rc integer
ll_rowcount long
ls_key string
ls_mrukeyname string

protected function integer of_write (string as_section, integer ai_itemcount);//////////////////////////////////////////////////////////////////////////////
//
//	Function:	of_Write
//
//	Access:		protected
//
//	Arguments:	
//	as_section		section to write key information
//	ai_itemcount	number of items to write out
//
//	Returns:		integer
//	SUCCESS = 1
//	ERROR = -1
//
//	Description:
//	store the key data from the mrukeys datastore to 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_index, li_rc
long		ll_rowcount
string	ls_mrukeyname, ls_key

If IsNull(as_section) or as_section = "" Then
	Return -1
End If

If IsNull(ai_itemcount) or ai_itemcount < 1 Then
	Return -1
End If

ll_rowcount = ids_mrukeys.RowCount()
if ll_rowcount <= 0 then
	Return ll_rowcount
end if

// calculate # of rows to save to ini file.  1 is the lowest rownumber to go to
if ll_rowcount > ai_itemcount then
	ll_rowcount = ai_itemcount
end if

for li_index = 1 to ll_rowcount

	// set up compound keys
	ls_MRUKeyName = is_mruitemkey + string(li_index)

	// can override encode logic in event script
	li_rc = this.event pfc_encode(li_index, ls_key)
	If li_rc < 0 Then exit

	li_rc = of_writekeys(as_section, ls_MRUKeyName, ls_key)
	if li_rc < 0 then exit
	
end for

// write the number of items for the MRU
ls_key = string(ai_itemcount)
li_rc = of_writekeys(as_section, is_mrucountkey, ls_key)

return li_rc
end function

     
Name Owner
pfc_n_cst_mru.of_save pfc_n_cst_mru

     
Name Owner
datastore.rowcount datastore
systemfunctions.isnull systemfunctions
systemfunctions.string systemfunctions
pfc_n_cst_mru.of_writekeys pfc_n_cst_mru
pfc_n_cst_mru.pfc_encode pfc_n_cst_mru

     
Full name
No Data

     
Name Scope
No Data