of_getbit


pfcapsrv.pbl   >   pfc_n_cst_numerical   >   of_getbit   

Full name pfc_n_cst_numerical.of_getbit
Access public
Extend of boolean
Return value boolean
Prototype public function boolean of_getbit(long,unsignedinteger)

Name Datatype
No Data

Name Datatype
lb_null Boolean

public function boolean of_getbit (long al_decimal, unsignedinteger ai_bit);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_GetBit
//
//	Access: 			public
//
//	Arguments:
//	al_decimal		Decimal value whose on/off value needs to be determined (e.g. 47).
//	ai_bit			Position bit from right to left on the Decimal value.
//
//	Returns: 		boolean
//						True if the value is On.
//						False if the value is Off.
//						If any argument's value is NULL, function returns NULL.
//
//	Description:   Determines if the nth binary bit of a decimal number is 
//						1 or 0.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
// 5.0.03	Fixed problem when dealing with large numbers (>32k)
//				from "mod int" to "int mod"
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_null

//Check parameters
If IsNull(al_decimal) or IsNull(ai_bit) then
	SetNull(lb_null)
	Return lb_null
End If

//Assumption ai_bit is the nth bit counting right to left with
//the leftmost bit being bit one.
//al_decimal is a binary number as a base 10 long.
If Int(Mod(al_decimal / (2 ^(ai_bit - 1)), 2)) > 0 Then
	Return True
End If

Return False

end function

     
Name Owner
pfc_n_cst_numerical.of_bitwiseand pfc_n_cst_numerical
pfc_n_cst_numerical.of_bitwiseor pfc_n_cst_numerical
pfc_n_cst_numerical.of_bitwisexor pfc_n_cst_numerical
pfc_n_cst_filesrvunicode.of_dirlist pfc_n_cst_filesrvunicode
pfc_n_cst_filesrvunicode.of_getfileattributes pfc_n_cst_filesrvunicode
pfc_n_cst_filesrvsol2.of_getfileattributes pfc_n_cst_filesrvsol2
pfc_n_cst_filesrvsol2.of_dirlist pfc_n_cst_filesrvsol2
pfc_n_cst_filesrvwin32.of_dirlist pfc_n_cst_filesrvwin32
pfc_n_cst_filesrvwin32.of_getfileattributes pfc_n_cst_filesrvwin32
pfc_n_cst_filesrvhpux.of_getfileattributes pfc_n_cst_filesrvhpux
pfc_n_cst_filesrvhpux.of_dirlist pfc_n_cst_filesrvhpux
pfc_n_cst_filesrvaix.of_getfileattributes pfc_n_cst_filesrvaix
pfc_n_cst_filesrvaix.of_dirlist pfc_n_cst_filesrvaix

     
Name Owner
systemfunctions.int systemfunctions
systemfunctions.isnull systemfunctions
systemfunctions.mod systemfunctions
systemfunctions.setnull systemfunctions

     
Full name
No Data

     
Name Scope
No Data