|
of_restore
|
|
Full name
|
pfc_n_cst_apppreference.of_restore
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_restore(boolean,boolean,string,string)
|
Name
|
Datatype
|
li_rc
|
integer
|
protected function integer of_restore (boolean ab_useregistry, boolean ab_processapp, string as_keyorini, string as_inisection);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Restore
//
// Access: protected
//
// Arguments:
// ab_useregistry Function behavior - use the registry or an .ini file.
// ab_processapp Function behavior - restore application info or restore user info
// 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.
//
// Returns: Integer
// 1 if it succeeds and -1 if an error occurs.
//
// Description: Restores the preference information from either the Registry
// or from an .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_rc
//Check arguments
if isnull(ab_useregistry) or isnull(ab_processapp) or isnull(as_keyorini) then
return -1
end if
// as_inisection will be blank if using registry
if (as_keyorini = "") then
return -1
end if
//Validate specifics for either Registry or .Ini functionality.
if ab_useregistry then
else
//Check for the existance of the file.
if not fileexists(as_keyorini) then
return -1
end If
//Check the section parameter
if isnull(as_inisection) or Len(Trim(as_inisection))=0 then
return -1
end if
end if
if ab_processapp then
li_rc = of_RestoreApp(ab_useregistry, as_keyorini, as_inisection)
else
li_rc = of_RestoreUser(ab_useregistry, as_keyorini, as_inisection)
end if
return li_rc
end function