Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> write ouput data pp 111</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 WRITE                           Ouput Data                           pp 111

 Syntax:  Write (Var1,Var2,..VarN) ;
          Write (FileVar,Var1,Var2,..VarN) ;

 Type:    All

 Form:    Procedure

 Purpose: Output formatted or un-formatted data.

 Notes:   Write does not output a CR/LF to either standard output or
          a file.  Use WriteLn for CR/LF termination.

 Parms:
          :N    right justify the output in a field N characters wide.

          :N:X  use decimal notation right justified in a field N wide
                with X digits after the decimal point.

 Usage:
       CONST
          Splat   : Char       = '*'       ;
          CharVar : Char       = 'A'       ;
          ByteVar : Byte       = 10        ;
          IntVar  : Integer    = 1234      ;
          NumVar1 : Real       = 12345.67  ;
          NumVar2 : Real       = 0.1234567 ;
          StrVar  : String [3] = 'ABC'     ;


       BEGIN
          Write (Splat,CharVar: 2,Splat)   ;  { '* A*'                }
          Write (Splat,ByteVar: 4,Splat)   ;  { '*  10*'              }
          Write (Splat,IntVar : 3,Splat)   ;  { '*1234*'              }
          Write (Splat,NumVar1:12,Splat)   ;  { '*1.234567+E04*'      }
          Write (Splat,NumVar1:17,Splat)   ;  { '* 1.2345670000+E04*' }
          Write (Splat,NumVar1:8:2,Splat)  ;  { '*12345.67*'          }
          Write (Splat,NumVar2:8:7,Splat)  ;  { '*0.1234567*'         }
          Write (Splat,StrVar : 5,Splat)   ;  { '*  ABC*'             }
       END.

See Also: Form WriteLn

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson