-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodARITMETICS.bas
43 lines (42 loc) · 1.41 KB
/
modARITMETICS.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Attribute VB_Name = "modARITMETICS"
Option Explicit
Function CALC_NUMBER_WITH_NUMBER(ByVal nl As Long, ByVal nr As Long, op As String) As String
Select Case op
Case "*"
CALC_NUMBER_WITH_NUMBER = CStr(nl * nr)
Case "/"
CALC_NUMBER_WITH_NUMBER = CStr(nl / nr)
Case "<<"
'CALC_NUMBER_WITH_NUMBER = CStr(nl * nr)
Case ">>"
'OPERATOR_TO_PRECEDENCE = 9.6
Case "%"
CALC_NUMBER_WITH_NUMBER = CStr(nl Mod nr)
Case "^"
'OPERATOR_TO_PRECEDENCE = 9.4
Case "+"
CALC_NUMBER_WITH_NUMBER = CStr(nl + nr)
Case "-"
CALC_NUMBER_WITH_NUMBER = CStr(nl - nr)
Case "|"
CALC_NUMBER_WITH_NUMBER = CStr(nl Or nr)
Case "Xor"
CALC_NUMBER_WITH_NUMBER = CStr(nl Xor nr)
Case "&"
CALC_NUMBER_WITH_NUMBER = CStr(nl And nr)
Case "=="
CALC_NUMBER_WITH_NUMBER = CStr(nl = nr)
Case "<>", "!="
CALC_NUMBER_WITH_NUMBER = CStr(nl <> nr)
Case "<="
CALC_NUMBER_WITH_NUMBER = CStr(nl <= nr)
Case "<"
CALC_NUMBER_WITH_NUMBER = CStr(nl < nr)
Case ">"
CALC_NUMBER_WITH_NUMBER = CStr(nl > nr)
Case ">="
CALC_NUMBER_WITH_NUMBER = CStr(nl >= nr)
Case "="
CALC_NUMBER_WITH_NUMBER = CStr(nl = nr)
End Select
End Function