|
of_save
|
|
Full name
|
pfc_n_cst_apppreference.of_save
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_save(boolean,boolean,string,string)
|
Name
|
Datatype
|
li_rc
|
integer
|
lnv_conversion
|
n_cst_conversion
|
lnv_inifile
|
n_cst_inifile
|
protected function integer of_save (boolean ab_useregistry, boolean ab_processapp, string as_keyorini, string as_inisection);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Save
//
// Access: protected
//
// Arguments:
// ab_UseRegistry Function behavior - use the registry or an .ini file.
// ab_ProcessApp Function behavior - save application info or save 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: Saves the preference information to either the Registry or
// to 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
n_cst_inifile lnv_inifile
n_cst_conversion lnv_conversion
//Check arguments
If IsNull(ab_UseRegistry) or IsNull(ab_ProcessApp) or IsNull(as_KeyOrIni) or (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
//Clear the section prior to updating it
If ab_UseRegistry Then
RegistryDelete (as_KeyOrIni, '')
Else
lnv_inifile.of_Delete(as_KeyOrIni, as_IniSection)
End If
if ab_ProcessApp then
li_rc = of_SaveApp(ab_UseRegistry, as_KeyOrIni, as_IniSection)
else
li_rc = of_SaveUser(ab_UseRegistry, as_KeyOrIni, as_IniSection)
end if
Return li_rc
end function