qp.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
LOCAL.PAS
  Example Contents Index                                    Back
 
PROGRAM local_variables;
 
{ LOCAL.PAS : Demonstrates local variables. }
 
VAR
    num : Byte;
 
PROCEDURE factor( value : Byte );
 
VAR
    factorial : Real;
    count     : Byte;
 
BEGIN
    factorial := 1.0;
    FOR count := 1 TO value DO
        factorial := factorial * count;
    Write( 'Factorial of ', value, ' is ' );
    Writeln( factorial );
END; { procedure factor }
 
BEGIN
 
    Write( 'Enter a number smaller than 34: ' );
    Readln( num );
    factor( num )
 
END.