07-26-2023, 08:32 PM
Description:
The If statement checks a condition and executes a block of code if the condition is true.
If the condition is false, it can execute an alternative block (Else).
Example:
Sub ExampleIfThenElse()
Dim age As Integer
age = 25
If age >= 18 Then
MsgBox "You are an adult."
Else
MsgBox "You are a minor."
End If
End Sub
The If statement checks a condition and executes a block of code if the condition is true.
If the condition is false, it can execute an alternative block (Else).
Example:
Sub ExampleIfThenElse()
Dim age As Integer
age = 25
If age >= 18 Then
MsgBox "You are an adult."
Else
MsgBox "You are a minor."
End If
End Sub
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos