»Variables [ Data Types ]
variables are used to store some value or collection of values temporary. When you closing the application all used variables are erased. Variables are splitting to several types as they used to.
Most usable variables
- number: Integer;
- name: String;
- trueNfalse: bool;
- numberWithDecimal: Double;
All variables
- Integer -
- Int : Byte;
- Int : ShortInt;
- Int : Word;
- Int : SmallInt;
- Int : LongWord;
- Int : Cardinal;
- Int : LongInt;
- Int : Integer;
- Int : Int64;
- String -
- Str : Char;
- Str : WideChar;
- Str : AnsiChar;
- Str : ShortString;
- Str : String;
- Str : AnsiString;
- Str : WideString;
- Decimal -
- Dec : Single;
- Dec : Currency;
- Dec : Double;
- Dec : Extended;
Comments are used to human friendly use. Whatever you typed in a comment it's not used to compiling. actually it's only usable to make some places special. Computer skips comment lines when compiling. So comments are for only make coding easy to us.
Single Line Comment [Block Comments]
var number: integer; //this is a comment and type whatever you want here.Multi Line Comment [Line Comments]
var number: integer; {this is a comment and type whatever you want here. but this comment is special because we can type more than one line. :D }
0 on: "Delphi Tutorial Part 2 - Variables and Comments"