home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PASSRC.ZIP / ALLVAR.PAS next >
Pascal/Delphi Source File  |  1991-02-04  |  1KB  |  43 lines

  1.                                 (* Chapter 3 - Program 3 *)
  2. program All_Simple_Variable_Types;
  3.  
  4. var  A,B         : integer;
  5.      C,D         : byte;
  6.      Dog_Tail    : real;
  7.      Puppy       : boolean;
  8.      Animal_Cookies : char;
  9.  
  10. begin
  11.    A := 4;
  12.    B := 5;
  13.    C := 212;
  14.    D := C + 3;
  15.    Dog_Tail := 345.12456;
  16.    Puppy := B > A;  (* since B is greater than A, Puppy
  17.                        will be assigned the value TRUE *)
  18.    Animal_Cookies := 'R';  (* this is a single character *)
  19.  
  20.    Writeln('The integers are',A:5,B:5);
  21.    Writeln('The bytes are',   C:5,D:5); (* notice that the spaces
  22.                                            prior to the C will be
  23.                                            ignored on output *)
  24.    Writeln('The real value is',Dog_Tail:12:2,Dog_Tail:12:4);
  25.    Writeln;
  26.    Writeln('The boolean value is ',Puppy,Puppy:13);
  27.    Writeln('The char variable is an ',Animal_Cookies);
  28. end.
  29.  
  30.  
  31.  
  32.  
  33. { Result of execution
  34.  
  35. The integers are    4    5
  36. The bytes are  212  215
  37. The real value is      345.12    345.1246
  38.  
  39. The boolean value is TRUE         TRUE
  40. The char variable is an R
  41.  
  42. }
  43.