Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.pascal.borland    |    Borland Pascal was actually pretty neat    |    2,978 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 2,135 of 2,978    |
|    Heinrich Wolf to All    |
|    Re: printing variable problems    |
|    13 Apr 06 18:21:16    |
   
   From: invalid@invalid.invalid   
      
   Hi, see this program:   
      
   program Params;   
      
   var x : Integer;   
      
   procedure p1(const x1 : Integer);   
    begin   
    { x1 := 1; } { throws compiling error }   
    end;   
      
   procedure p2(x2 : Integer);   
    begin   
    writeln('x2 = ', x2);   
    x2 := 1;   
    writeln('x2 = ', x2);   
    end;   
      
   procedure p3(var x3 : Integer);   
    begin   
    writeln('x3 = ', x3);   
    x3 := 1;   
    writeln('x3 = ', x3);   
    end;   
      
   begin   
    x := 0;   
    writeln('x = ', x);   
    p2(x);   
    writeln('x = ', x);   
    p3(x);   
    writeln('x = ', x);   
    readln;   
   end.   
      
   ... and it's output   
   x = 0   
   x2 = 0   
   x2 = 1   
   x = 0   
   x3 = 0   
   x3 = 1   
   x = 1   
      
   Regards   
   Heiner   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca