This tutorial and more can be found at DarkDev.
--------------------------------------------------------------
-Part 1-
Introducing the variables
--------------------------------------------------------------
Some variables can contain numbers, and some contain other things.
The limit as to how high and low numbers in a variable can go is from..
-2147483617 to 2147483617
There are three common types of variables in the DBPro language.
1. Integers
2. Reals/Floats
3. Strings
Each one of those variables can be used differently, and store different things.
It is important you know the difference between those three variables, for it will come in handy in the future.
--------------------------------------------------------------
-Part 2-
The Integer
--------------------------------------------------------------
Integers are a type of variable that store whole numbers.
They can be positive or negative.
Negative number example: -56
Positive number example: 1097
Integers can not contain decimal points or decimal values. They can only be whole numbers.
Integer: 125
Not an Integer: 125.36
Storing integers in DBPro is easy. All you have to do is assign them to an integer variable like so:
MyInteger = 55
OtherInteger = -768
You can also create an integer variable from other variables
MyInteger = 55
HisInteger = 98
OurInteger = MyInteger + HisInteger
Now you know what an integer is, how to store it, and how to use it.
--------------------------------------------------------------
-Part 3-
The Real/Float
--------------------------------------------------------------
Reals and floats are the same thing, but people more commonly use 'float' instead of 'real'.
Floats and reals are exactly like Integers, except that they can have decimal points and decimal values...
Real: 427
Real: 427.0234
Storing reals in DBPro is just like storing integers.
The only difference is that in front of the variable name, you place a number sign '#'...
MyReal# = 801.987
OtherReal# = -768.99
You can also create a real or float variable from other variables
MyReal# = 801.987
HisReal# = -768.99
OurReal# = MyReal# + HisReal#
Now you know what a real/float is, how to store it, and how to use it.
--------------------------------------------------------------
-Part 4-
The String
--------------------------------------------------------------
String variables are different than Integers and Reals.
Strings contain words and letters and numbers in the form of a sentence.
You can store a string variable like this...
MyString$ = "Hello World, I am 58 years old."
Notice that I placed a money sign '$' in front of the variable name to make it a string.
Also notice that when storing the sentence of the string, I surrounded it with quotation marks. This shows that it is string information.
You can also create a string variable from other variables
MyString$ = "Hello World, "
HisString$ = "I am 58 years old."
OurString$ = MyString$ + HisString$
Now you know what a string is, how to store it, and how to use it.
--------------------------------------------------------------
-Part 5-
Declaring variables (without '$' or '#')
--------------------------------------------------------------
As you now understand, to create a string you use '$', and for Reals/Floats you use '#'.
There is a method used commonly that you can use to avoid adding those symbols.
All you have to do is add 'as string' or 'as float' or 'as integer' in front of the variable name.
Say your string is called 'MyString$', and this is your code...
MyString$ = "Hello everyone!"
Here is an example of declaring without symbols...
MyString as string
MyString = "Hello Everyone"
The same goes with Reals/Floats and Integers.
The only problem is, you cant say 'as real', you can only use 'as float'...
MyString as string
MyString = "Hello Everyone"
MyReal as float
MyReal = 17.68
MyInteger as integer
MyInteger = 9786
Now, you understand how to declare variables without signs.
But, there is more!
In another tutorial, you will learn about something called a 'function'.
When you want to use a variable in a function, you put 'Global' before you declare it, like this...
Global MyInteger as integer
MyInteger = 5
--------------------------------------------------------------
-Part 6-
Conclusion&Extras
--------------------------------------------------------------
Now that you know the three common variables used in DBPro, you can be on your way to the next tutorials or continue your project.
There is more, though.
Some functions in DBPro allow you to convert an integer to a string, and a string to an integer...
Converting an integer to a string: STR$(MyInteger)
Converting a string to an integer: VAL(MyString$)
An example of converting an integer to a string...
MyInteger = 55
MyString$ = STR$(MyInteger)
The variable 'MyString$' now contains "55".
An example of converting a string to an integer...
MyString$ = "98"
MyInteger = VAL(MyString$)
The variable 'MyInteger' now contains 98.
Now, the tutorial is over.