home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 262,219 of 264,096   
   =?UTF-8?Q?Arne_Vajh=C3=B8j?= to All   
   Re: Fun trick   
   08 Jan 25 16:37:21   
   
   From: arne@vajhoej.dk   
      
   On 1/8/2025 4:32 PM, Arne Vajhøj wrote:   
   > On 1/8/2025 3:42 PM, John Reagan wrote:   
   >> And the compiler also supports the Extended Pascal TO BEGIN DO and TO   
   >> END DO statements.  TO BEGIN DO is just the same as [INITIALIZE] but   
   >> allows any statement.  TO END DO is an exit handler (registered with   
   >> an initialization routine).   
   >   
   > $ type prg.pas   
   > program prg(input,output);   
   >   
   > [external]   
   > procedure say; external;   
   >   
   > begin   
   >      writeln('2');   
   >      say;   
   >      writeln('4');   
   > end.   
   > $ type lib.pas   
   > module lib(input, output);   
   >   
   > [global]   
   > procedure say;   
   >   
   > begin   
   >      writeln('3');   
   > end;   
   >   
   > to begin do writeln('1');   
   > to end do writeln('5');   
   >   
   > end.   
   > $ pas lib   
   > $ link/share=libshr lib + sys$library:starlet/lib/incl=lib$initialize +   
   > sys$input/opt   
   > SYMBOL_VECTOR=(say=PROCEDURE)   
   > $   
   > $ define/nolog libshr sys$disk:[]libshr   
   > $ pas prg   
   > $ link prg + sys$input/opt   
   > libshr/share   
   > $   
   > $ run prg   
   > 1   
   > 2   
   > 3   
   > 4   
   > 5   
      
   Or ditching the shareable image that are no longer relevant:   
      
   $ type prg2.pas   
   [inherit('lib2')]   
   program prg2(input,output);   
      
   begin   
        writeln('2');   
        say;   
        writeln('4');   
   end.   
   $ type lib2.pas   
   module lib2(input, output);   
      
   procedure say;   
      
   begin   
        writeln('3');   
   end;   
      
   to begin do writeln('1');   
   to end do writeln('5');   
      
   end.   
   $ pas/env lib2   
   $ pas prg2   
   $ link prg2 + lib2   
   $ run prg2   
   1   
   2   
   3   
   4   
   5   
      
   Arne   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca