Upload
agtishan
View
134
Download
0
Tags:
Embed Size (px)
Citation preview
Qbasic Tutorial 2.1
Variables and Data Types
Variables
● Hold Data in Memory.● Are assigned to a Data Type.● The data can change at any time during the program's
operation.● The data entered must be the same type as the assigned
Data Type.
Qbasic Data Types
● String - Text and Characters● Integer - Non point number between -32,768 to 32,767● Long - Non point number between - 2,147,483,648 to
2,147,483,647
Qbasic Data Types
● Single – Floating Point from -3.37 x 1038 to 3.37 x 1038
● Double – Floating Point from -1.67 x 10308 to 1.67 x 10308
Note: Qbasic has problems with the double data type.This problem is not there in QB64.I will be using QB64 for this tutorial.
The Signs to be added after variables
● String - $● Integer - %● Long - &● Single - !● Double - #
QB 64 Data types
● _Integer64 - &&
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
● _Float - ##
-1.18 x 104932 to 1.18 x 104932
Tutorial 2.1
This tutorial will use:
QB64 running on Windows 7 Ultimate 64 bit
and
Qbasic [running in DOSBox on (W7)] and running normally on WinXP 32 bit.
First, I'll show the data type error....
So, I open this ..... and press F5
And, This is what I get!
So, I got 3.2 and a bunch of other numbers.
Now, To make sure....
But YAY!
Again,
AaaaaaaRgggggHH!
So, I got 3.59999999Insted of 3.6
Now you understand?
Old Method
First, I will teach you the old method of definig variables
Hey I forgot to print the header!
New Method
● This is the new method for variables● Visual BASIC also uses this method.
That is all. Thank you.
Don't forget to download the source codes zip
and
If you like this, please comment and rate accordingly.
Thank you