Fandom

Colobot Wiki

Type

67pages on
this wiki
Add New Page
Comments0 Share

When you define a variable, you must give two elements:

1) a name 2) a type

Once you defined a variable, you can use it to put information in it. However, the information that a variable can contain must always be of the correct type: a variable of type float can not contain a string, etc.

In a program, the name of a type is always displayed like that: type. If the name of a type is not highlighted, this means that the name is misspelled. Type names are always written with lower case characters. Here is a list of the different types:

intEdit

For a whole number (12, -500, etc.).

floatEdit

For a real number (12, 3.14, 0.2, -99.98, etc.).

boolEdit

For a boolean variable, that can only take the values true or false.

stringEdit

For texts ("Hello!", "No object found", etc.)


See alsoEdit

Programming, types and categories.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.