G-GDK / Data Types, Variables

Saturday 12 February 2022, by AmiDARK // Principles

Data Types
There are many types of data you can use, including integer numbers, floating numbers and string. Each type of data holds a slightly different type of value.

Integer Numbers
An integer number can hold a whole number, but no fraction. For the value to be negative, you must place a minus symbol (-) before the value. Examples of integer numbers:

20
50189
-1254
-9

Floating Numbers
A floating number can hold a whole number or a fractional number that uses a decimal point. For the value to be negative, you must place a minus symbol (-) before the value. Examples of real numbers:

10.9
5.007
-894.5945
-1.189819
0.0000098

Strings
String data is non-numerical, and is used to store characters and words. All strings consist of characters enclosed within < > and double quotation marks. The string data can include numbers and other numerical symbols but will be treated as text. Examples of strings are:

<"O">
<"Here is a string">
<"SMART ENOUGH">
<"I have 5 Amigas at home">
<"125.658">

Variables
The best way to demonstrate what a variable does is by way of an example. Take the variable creation/editing :

SetInteger varInteger,3
SetFloat varFloat,<"3.45">
SetFloat varFloat2,"3.1415927"
SetString varString,<"New String">