POV-Ray : Newsgroups : povray.off-topic : I'm in the mood for monads : Re: Living in a box Server Time
29 Jul 2024 10:30:19 EDT (-0400)
  Re: Living in a box  
From: Francois Labreque
Date: 26 Apr 2012 08:08:12
Message: <4f993aac$1@news.povray.org>

> Almost every dialect had a strange DATA construct. A DATA statement is
> followed by a comma-separated list of decimal numbers. The READ
> statement fetches the next code into the specified variable. The RESTORE
> command resets to the first DATA statement. If you want to write machine
> code, you invariably have to write a BASIC program such as
>
> 10 FOR X = 1 TO 13
> 20 READ D
> 30 POKE (23874+X), D
> 40 NEXT X
> 50 DATA 45,84,27,45,95,13,75,65,42,84,13,10,59

Think punch cards.

In the case above, you have 4 cards with your program, one line per 
card, and can change the DATA card every time you run the program.  So 
when your warehouse invetory changes, you can still reuse the "Monthly 
report" program deck of cards with this month's deck of DATA cards.

Historical note: this is also the reason for the line numbers.  It 
allowed the deck to be shuffled (ex: after being dropped on the floor) 
and read by the computer without having to bother about the order of the 
cards.

Of course, on a cassette or a floppy diskette, there is little risk of 
dropping your code on the floor and shuffling the data, so eventually 
line numbers disappeared.


-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.