Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/examples/Operators/Operators-example2.txt
2968 views
1
REM The order of operations (order precedence) are a set of rules that define which procedures are performed first in order to evaluate an expression, similar to that of mathematics.
2
REM In DuckyScript, parenthesis ( ) are required to define the precedence conventions.
3
4
5
VAR $FOO = ( 4 * 10 ) + 2
6
7
REM The expression ( 4 * 10 ) evalues to 40.
8
REM The expression 40 + 2 evalues to 42.
9
10
11
REM If multiple pairs of parentheses are required, the parentheses can be nested.
12
13
14
VAR $FOO = 42
15
VAR $BAR = (( 100 * 13 ) + ( $FOO - 5 ))
16
17
REM The expression 42 - 5 evalues to 37
18
REM The expression ( 100 * 13 ) evalues to 1300
19
REM The expression 1300 + 37 evalues to 1337
20