Multiple variables in a "IF" statement

Code tips and tricks for beginners
Post Reply
Zim
Posts: 88
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 61 times
Been thanked: 44 times

Multiple variables in a "IF" statement

Post by Zim »

Code: [Local Link Removed for Guests]

D1 = 5
D2 = 4
D3 = 0
D4 = 2
txt2$ = "hello"
nums = 2
cnte = 2

' three conditions and four outcomes eq. below

if (D1 = 9) and (D2 = 4) and (txt2$ = "hello") then
  nums = 7                   
  txt2$ = "goodbye"
  cnte = 5
  D4 = 22
endif


I am a beginner too, so if you see an error, please feel free to comment or correct me!

The AND , OR keywords can be used between the expressions as long as they are in parenthesis.

:)
Post Reply