Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/examples/Conditions/Conditions-example1.txt
2968 views
1
REM The flow control statement IF will determine whether or not to execute its block of code based on the evaluation of an expression. One way to interpret an IF statement is to read it as "IF this condition is true, THEN do this".
2
3
REM The IF statement consists of these parts
4
REM - The IF keyword
5
REM - The condition, or expression that evaluates to TRUE or FALSE
6
REM - In most cases, the expression is surrounded by parenthesis ( )
7
REM - The THEN keyword
8
REM - One or more newlines containing the block of code to execute
9
REM - The END_IF keyword
10
11
REM Example IF THEN
12
13
$FOO = 42
14
$BAR = 1337
15
16
IF ( $FOO < $BAR ) THEN
17
STRING 42 is less than 1337
18
END_IF
19
20
REM The expression "Is 42 less than 1337" is evaluated and determined to be TRUE.
21
REM Because the IF condition is TRUE, the code between the keywords THEN and END_IF are executed.
22
REM The string "42 is less than 1337" is typed.
23