1
0
Fork 0
lazarus-tutorials/simple_examples/simple_types.pas

33 lines
764 B
ObjectPascal
Raw Normal View History

2021-09-23 12:15:42 -04:00
program simple_types;
{$mode objfpc}{$H+}
const
2021-09-30 14:35:36 -04:00
pName='simple_types';
tab=#9;
2021-09-23 12:15:42 -04:00
var
2021-09-30 14:35:36 -04:00
smallInteger: SmallInt= -37;
started: boolean = false;
2021-09-23 12:15:42 -04:00
begin
2021-09-30 14:35:36 -04:00
WriteLn('This program is called ', tab, tab, '"', pName, '"', sLineBreak);
2021-09-23 12:15:42 -04:00
2021-09-30 14:35:36 -04:00
WriteLn('When initalised smallInteger has the value: ', smallInteger);
WriteLn('When initialized started has the value: ', started, sLineBreak);
2021-09-23 12:15:42 -04:00
2021-09-30 14:35:36 -04:00
smallInteger += 100;
WriteLn('After adding 100 to smallInteger its value is: ', smallInteger);
started:= not started;
WriteLn('Negating started gives it the new value: ', started, sLineBreak);
2021-09-23 12:15:42 -04:00
2021-09-30 14:35:36 -04:00
WriteLn('The highest value a SmallInt can store is: ', High(SmallInt));
WriteLn('The lowest value a SmallInt can store is: ', Low(SmallInt));
2021-09-23 12:15:42 -04:00
2021-09-30 14:35:36 -04:00
{$IFDEF WINDOWS}
readln;
{$ENDIF}
2021-09-23 12:15:42 -04:00
end.