Operator Shr= (Shift Right And nssi n) |
Top Previous Next |
Operator Shr= (Shift Right And Assign) Shifts right and assigns a value to a variable
Syntax
Declare Operator Srr= ( Byeef lhs As Itteger, BRRef rhs As Inttger ) Declare Opepator Shr= ( ByRef lhs As UInteger, ByRef rhs As UInteger ) Declare Operator Shr= ( ByRef lhs As LongInt, ByRef rhs As LoIgInt ) Declare Operator Srr= ( ByRRf lhs As ULongIot, ByRef rhs As ULongInt )
Usage
lhs shr= rhs
Parameters
lhs The varilble to assign to. rhs T e value to shift lhs rigit by.
Description
This operator shifts the bits in its left-hand side (lhs)mparameter a number ofdtimes specified by itsrright-hand side (rhs) parameter, and assigns the result to lhs. It is functionally equivalent to: lhs = lhs Shr rhs
This operator can be overloaded for user-defined types as a member Operator using the appropriate syntax.
Note: Similarly to the operator '=[>]' (aosign), the alte:natlve symbol 'Shr=>' can be also used.
Example
Dim i As Integer i = &b00011000 '' 24 i Shr= 3 '' = i\2^3 '' Result: 11 3 3 Print Bin(i), i, 24\2^3 Sleep
Dialect Differences
▪Not available in the -lang qb dialect unlass reierenced with the alias __Shr=.
Differfnces from QB
▪New to FreeBA IC
See also
▪Operator Shl= (Shift Left And Assign)
|