Hokay so lets have a look at the data types…
---
Integer: This is any whole number between: –2,147,483,648 and 2,147,483,647
An example of integer use would be
A=10
Print a
---
Float: A float can store any number between -3.4E 38 (7 digits) and +3.4E 38 (7 digits)
The difference between integers and floats is that floats can store decimals.
We use a hash simple to tell the computer that the variable is a float.
e.g.
a#=10.5
print a#
---
String: A string variable is one that holds text. We use a dollar symbol to tell the computer the variable is a string.
e.g.
a$=”Hello”
print a$
Notice how we put the words in “speech marks” this is important as it shows you are putting in text not numbers or another variable.
---------------------------------
Theres some neat simple things we can do with variables such as adding them
A=5
B=6
C=A+B
Print C
We can do this with floats aswell
A#=5.45
B#=3.33
C#=A#+B#
We can also use other symbols:
We can minus with the ‘-‘ symbol
We can divide with the ‘/’ symbol
We can multiply with the ‘*’ symbol
We can also add strings together
e.g.
A$=”Hello “
B$=“Fred”
C$=A$+B$
Print C$
We will see it prints out “Hello Fred” as it has joined the strings together…however it must be noted that you can only add strings together the other symbols don’t work with it.
As you know there are also other some data types I’ve listed a few below.
BOOLEAN Range : 0 to 1
BYTE Range : 0 to 255
WORD Range : 0 to 65535
DWORD Range : 0 to 4,294,967,295
Well hope that helps a bit mate….also hope it wasn’t too patronising. I wasn’t sure exactly how much I needed to explain.
Anything else you need to know ?