29-06-2009, 01:10 PM
I'm gonna post some basic tutorials / guides for the new users. If you see any errors or if you have any ideas please let me know.
Basics 1 - Variables.
Byte
8-bit: Values from 0 to 255. Whole numbers only.
Integer
16-bit: Values from -32768 to 32767. Whole numbers only. Takes 2 bytes in memory.
Long
32-bit: Values from -2,147,483,648 to 2,147,483,647. Whole numbers only. Takes 4 bytes in memory. (This is 'int' in c++ and c#)
Single
32-bit: Values from -3.402823e38 to -1.401298e-45 for negative values. Values from 1.401298e-45 to 3.402823e38 for positive values. Takes 4 bytes in memory.
Double
64-bit Values from -1.79769313486232e308 to -4.94065645841247e-324 for negative values. Values from 4.94065645841247e-324 to 1.79769313486232e308 for positive values. Takes 8 bytes in memory.
String
The String data type is usually used as a variable-length type of variable. A variable-length string can contain up to approximately 2 billion characters. Each character has a value ranging from 0 to 255 based on the ASCII character set. Strings are used when Text is involved.
In VB6, you declare variable in the following manner:
Example - declaring 'b' as a byte:
Project
Our first project will be a basic form application that will add 2 values together. The data types can be whatever you want. Display the output.
Overview
Notes
Basics 1 - Variables.
Byte
8-bit: Values from 0 to 255. Whole numbers only.
Integer
16-bit: Values from -32768 to 32767. Whole numbers only. Takes 2 bytes in memory.
Long
32-bit: Values from -2,147,483,648 to 2,147,483,647. Whole numbers only. Takes 4 bytes in memory. (This is 'int' in c++ and c#)
Single
32-bit: Values from -3.402823e38 to -1.401298e-45 for negative values. Values from 1.401298e-45 to 3.402823e38 for positive values. Takes 4 bytes in memory.
Double
64-bit Values from -1.79769313486232e308 to -4.94065645841247e-324 for negative values. Values from 4.94065645841247e-324 to 1.79769313486232e308 for positive values. Takes 8 bytes in memory.
String
The String data type is usually used as a variable-length type of variable. A variable-length string can contain up to approximately 2 billion characters. Each character has a value ranging from 0 to 255 based on the ASCII character set. Strings are used when Text is involved.
In VB6, you declare variable in the following manner:
Code:
Dim [name of variable] as [Data Type]
Code:
Dim b as Byte
Project
Our first project will be a basic form application that will add 2 values together. The data types can be whatever you want. Display the output.
Overview
- Declare variables.
- Add 2 values together and display the new value.
Notes
- Please provide the source when submitting a project.
- Make sure to comment your code.