NASutils Knowledge BaseUnofficialPolski

Pascal · lesson 3 of 30 · First stepsDeclare variables

var lists each name with its type: string, Integer, Real or Boolean. := sets the value.

Programming on the NAS › Pascal in 30 lessons

03-variables.pas Download 03-variables.pas

program Variables;
var
  Name: string;
  Size: Integer;
  Used: Real;
  Mounted: Boolean;
begin
  Name := 'Archive';
  Size := 8;
  Used := 5.5;
  Mounted := True;
  WriteLn('Volume: ', Name);
  WriteLn('Free: ', Size - Used:0:1, ' TB');
  WriteLn('Mounted: ', Mounted);
end.

Terminal

$ ./03-variables
Volume: Archive
Free: 2.5 TB
Mounted: TRUE

Exercise

Add the model of a disk and print it.