|
of_restoreuser
|
|
Full name
|
pfc_n_cst_apppreference.of_restoreuser
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_restoreuser(boolean,string,string)
|
Name
|
Datatype
|
lb_toolbartext
|
boolean
|
lb_toolbartips
|
boolean
|
li_rc
|
integer
|
lnv_conversion
|
n_cst_conversion
|
ls_toolbartext
|
string
|
ls_toolbartips
|
string
|
ls_userid
|
string
|
protected function integer of_restoreuser (boolean ab_useregistry, string as_keyorini, string as_inisection);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_RestoreUser
//
// 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.
//
// Returns: Integer
// 1 if it succeeds and -1 if an error occurs.
//
// Description: Restores the App User 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.
//
//////////////////////////////////////////////////////////////////////////////
boolean lb_toolbartext, lb_toolbartips
integer li_rc
string ls_toolbartext, ls_toolbartips, ls_userid
n_cst_conversion lnv_conversion
//Parameter checking done in calling function
//Restore user information
li_rc = of_Restore (ab_useregistry, as_keyorini, as_inisection, 'toolbartext', ls_toolbartext, &
lnv_conversion.of_string(inv_appmanager.iapp_object.toolbartext))
li_rc = of_Restore (ab_useregistry, as_keyorini, as_inisection, 'toolbartips', ls_toolbartips, &
lnv_conversion.of_string(inv_appmanager.iapp_object.toolbartips))
li_rc = of_Restore (ab_useregistry, as_keyorini, as_inisection, 'userid', ls_userid, &
inv_appmanager.of_getuserid() )
//Convert to the appropriate data types
lb_toolbartext = lnv_conversion.of_Boolean(ls_toolbartext)
lb_toolbartips = lnv_conversion.of_Boolean(ls_toolbartips)
// Important values so validate them.
if isnull(lb_toolbartext) then lb_toolbartext = false
if isnull(lb_toolbartips) then lb_toolbartips = true
// application properties - if value is blank then we don't want to change the current setting
inv_appmanager.iapp_object.toolbartext = lb_ToolbarText
inv_appmanager.iapp_object.toolbartips = lb_ToolbarTips
if ls_userid <> "" then inv_appmanager.of_SetUserid(ls_userid)
return li_rc
end function