of_restore


pfcwnsrv.pbl   >   pfc_n_cst_winsrv_preference   >   of_restore   

Full name pfc_n_cst_winsrv_preference.of_restore
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_restore(boolean,string,string,string,ref string,string)

Name Datatype
No Data

Name Datatype
DEFAULT string

protected function integer of_restore (boolean ab_useregistry, string as_keyorini, string as_inisection, string as_subkey, ref string as_value, string as_default);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_Restore
//
//	Access:  		protected
//
//	Arguments:
//	ab_UseRegistry	Function behavior. - use the registry or an .ini file.
//	as_KeyOrIni		The KeyName for use with the Registry or the IniFile name
//						for use with an .Ini file.
//	as_IniSection	The name of the .Ini section. 
//	as_SubKey			The key value to be used on either the Registry or .Ini file.
//	as_value			The value to be restored from either the Registry or .Ini file.
//							Passed by reference.
// as_default		Used also as a default value, if the desired value is not found.
//
//	Returns:  		integer
//						1 if it succeeds.
//						0 if the default value was used.
//
//	Description:  	Perform the actual Get from the Registry or the .Ini file.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.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.
//
//////////////////////////////////////////////////////////////////////////////

constant string DEFAULT='$%^'

If ab_UseRegistry Then
	If RegistryGet (as_KeyOrIni, as_SubKey, as_Value) =1 Then
		Return 1
	End If
	as_Value = as_default
	Return 0
End If	

as_value = ProfileString (as_KeyOrIni, as_IniSection, as_SubKey, DEFAULT)
If as_value=DEFAULT Then
	as_Value = as_default
	Return 0
End If
Return 1

end function

     
Name Owner
pfc_n_cst_winsrv_preference.of_restorepositivenumber pfc_n_cst_winsrv_preference
pfc_n_cst_winsrv_preference.of_restoremenu pfc_n_cst_winsrv_preference
pfc_n_cst_winsrv_preference.of_restore pfc_n_cst_winsrv_preference

     
Name Owner
systemfunctions.profilestring systemfunctions
systemfunctions.registryget systemfunctions

     
Full name
No Data

     
Name Scope
No Data