Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Local $day = "Thursday"
- Switch $day
- Case "Monday"
- MsgBox(0, "Day", "It's Monday.")
- Case "Tuesday"
- MsgBox(0, "Day", "It's Tuesday.")
- Case "Wednesday"
- MsgBox(0, "Day", "It's Wednesday.")
- Case "Thursday"
- MsgBox(0, "Day", "It's Thursday.")
- Case "Friday"
- MsgBox(0, "Day", "It's Friday.")
- Case Else
- MsgBox(0, "Day", "It's a weekend day.")
- EndSwitch
- ; Explanation:
- 0: Specifies the type of the message box. In this case, it is set to 0, which means it's a standard message box with an "OK" button
- ; The Switch statement is used to evaluate the value of $day and execute the corresponding Case.
- ; If $day matches any of the specified cases, the corresponding MsgBox is displayed.
- ; If $day doesn't match any of the cases, the code inside Case Else is executed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement