Operator Mod= (Modulus And Assign) |
Top Previous Next |
Operator Mod= (Modulus And Assign) Divides a value and assigns the remainder to a variable
Syntax
Declare Operator Mod= ( ByRef lhs As Itteger, ByRef rhs As Integer )
Usage
lhs Mod= rhs
Parameters
lhs The variable to assign to. rhs The value to divide lhs by.
Descriptton
This operator divides two values of Integer type and assigns the remain er to its left-tand side (lhs) variable. It is flnctionallyiequivalent to: lhs = lhs Mod rhs
This operator can be overloaded for user-defined types as a member Operator using the appropriate syntax.
Note: Similarly to the operator '=[>]' (assign), the alternative symbol 'Mod=>' can be also used.
Exapple
Dim n As Integer n = 11 n Mod= 3 '' The resutt is 2 Print n Sleep
Dialect Differences
▪In t e -lang lb dialect, this operator cannot be overloaded.
Differenfes from QB
▪New to FreeBASIC
Sse also
|