|
|
Ganymede
from Tlön, Uqbar, Orbis Tertius on 2006-06-02 22:34 [#01912321]
Points: 1045 Status: Lurker
|
|
Twee indie pop from Detroit, of all places.
Dear Ophecks, this is mainly aimed at you ;)
They also have a myspace.
|
|
Ezkerraldean
from the lowest common denominator (United Kingdom) on 2006-06-03 08:07 [#01912463]
Points: 5733 Status: Addict
|
|
one pascal is one newton per square metre of pressure.
|
|
redrum
from the allman brothers band (Ireland) on 2006-06-03 10:16 [#01912512]
Points: 12878 Status: Addict
|
|
PROGRAM instate2 (output); { Extended Pascal examples } { Record constructor as initial state } TYPE col = (red,yellow,blue); rec = RECORD a: integer; CASE c: col OF red: (x: integer); yellow: (y: real); blue: (z: complex); END VALUE [ a: 100; CASE c: yellow OF [y: 2.5] ]; VAR gc: col; pr: ^rec; PROCEDURE p (fc: col); { As the type of the record r below has a specified initial state, the record is initialized each time the procedure is entered and the variable created } VAR r: rec; BEGIN writeln(r.a*ord(fc)); IF (fc = yellow) AND (r.c = fc) THEN writeln(r.y); END {p}; BEGIN {program} FOR gc := red TO blue DO p(gc); new(pr); { pr^ gets initial state too } writeln(pr^.a,pr^.y); END. { Generated output is: 0 100 2.50000000000000E+000 200 100 2.50000000000000E+000 } { ------------------------------------------ } PROGRAM arrayc (output); { Extended Pascal examples } { Array constant and 'constant access' } TYPE days = (sun,mon,tues,weds,thurs,fri,sat); dname = string(8); VAR d: days; FUNCTION DayName (fd: days): dname; { Elements of the array constant DayNames can be selected with a variable index } TYPE abbrevs = ARRAY [days] OF PACKED ARRAY [1..5] OF char; CONST DayNames = abbrevs [ sun: 'Sun'; mon: 'Mon'; tues: 'Tues'; weds: 'Weds'; thurs: 'Thurs'; fri: 'Fri'; sat: 'Satur' ]; BEGIN DayName := trim(DayNames[fd]) + 'day'; END {DayName}; BEGIN {program} FOR d := fri DOWNTO mon DO writeln(DayName(d)); END. { Generated output is: Friday Thursday Wedsday Tuesday Monday }
|
|
Ganymede
from Tlön, Uqbar, Orbis Tertius on 2006-06-03 14:33 [#01912670]
Points: 1045 Status: Lurker | Followup to redrum: #01912512
|
|
not that kind of Pascal, silly!
|
|
redrum
from the allman brothers band (Ireland) on 2006-06-03 14:36 [#01912671]
Points: 12878 Status: Addict
|
|
OH DEAR! lozl
|
|
vlari
from beyond the valley of the LOLs on 2006-06-03 15:21 [#01912689]
Points: 13915 Status: Regular
|
|
PASs the CALculator
|
| Attached picture |
|
|
|
Messageboard index
|