Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

If Statements

SjVer edited this page Jul 4, 2021 · 6 revisions

3. If-Statments

In this chapter you will learn how to use Tic's if-statements. The variations of said statement, including if-else, if-elseif-else, etc. will also be discussed. Comparisons will too be addressed in this chapter.

The If Keyword

First things first: The If keyword. This keyword is the very foundation of any if-statements you'll be writing! Here's an example:

If true Then
	PrintLine "true!"
EndIf

It's no mystery what this piece of code does. It prints "true!".
Let's move up to a bit of a "higher" level... If-else-statements! (wooooow...)

If false Then
	PrintLine "this won't be printed!"
Else
	PrintLine "but this will..."
EndIf

Again, no mystery what this does.
Since you're probably already familiar with this kind of stuff in other languages I'll just show you the rest.

If 1 == 2 Or 1 == 3 Then
	PrintLine "won't be printed!"
ElseIf 1 == 4 And 1 == 5 Then
	PrintLine "won't be printed!"
Else
	PrintLine "but this will!"
EndIf

No rocket science right? Let's do some control flow stuff!

4. Control Flow

Home

  1. Hello World

  2. Variables

  3. If-Statements

THIS COURSE IS STILL IN DEVELOPMENT. THE NEXT CHAPTERS ARE BEING WORKED ON.

  1. Control Flow

  2. Functions

  3. Advanced Keywords

Clone this wiki locally