of_setbarposition


pfcwnsrv.pbl   >   pfc_n_cst_winsrv_statusbar   >   of_setbarposition   

Full name pfc_n_cst_winsrv_statusbar.of_setbarposition
Access public
Extend of integer
Return value integer
Prototype public function integer of_setbarposition(integer)

Name Datatype
No Data

Name Datatype
ldc_completion decimal
li_rc integer
ls_modifyexp string
ls_visible string

public function integer of_setbarposition (integer ai_position);//////////////////////////////////////////////////////////////////////////////
//
//	Function:	of_SetBarPosition
//
//	Access:		Public
//
//	Arguments:
//	ai_position	The new position of the bar.
//	
//	Returns:		Integer
//	SUCCESS = the current position of the progress bar
//	ERROR = -1
//
//	Description:
//	Sets the current position of the progress bar
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1999 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.
//
//////////////////////////////////////////////////////////////////////////////
decimal	ldc_completion
string	ls_modifyexp, ls_visible
integer	li_rc

// Check arguments.
If IsNull(ai_position) Then
	Return -1
End If

// If this is less than the minimum, the current position is set to the minimum
if ai_position < ii_barmin then
	ai_position = ii_barmin
end if

// If this is greater than the maximum, the current position is set to the maximum
if ai_position > ii_barmax then
	ai_position = ii_barmax
end if

ii_barposition = ai_position

// if maximum value is zero we are completed (prevents divide by zero)
// otherwise find our completion percentage
if (ii_barmax = 0) or (ii_barposition > ii_barmax) then
	ldc_completion = 1
else
	ls_visible = 'pfc_progress.visible="1" '
	ldc_completion = ii_barposition / ii_barmax
	ii_barpctcomplete = ldc_completion * 100
end if

ls_modifyexp = of_BarUpdateVisuals(ldc_completion)
li_rc = of_Modify(ls_visible + ls_modifyexp)

// turn off bar after it reaches 100%
if ldc_completion >= 1 and ib_barautoreset then
	this.post function of_barreset()
end if

if li_rc < 0 then
	Return li_rc
else
	Return ii_barposition
end if
end function

     
Name Owner
pfc_n_cst_winsrv_statusbar.of_barincrement pfc_n_cst_winsrv_statusbar

     
Name Owner
systemfunctions.isnull systemfunctions
pfc_n_cst_winsrv_statusbar.of_modify pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_barreset pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_barupdatevisuals pfc_n_cst_winsrv_statusbar

     
Full name
No Data

     
Name Scope
No Data