Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Variables/ALGOL-W/variables-1.alg
Normal file
7
Task/Variables/ALGOL-W/variables-1.alg
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
% declare some variables %
|
||||
integer a1, a2; real b; long real c; complex d; long complex f;
|
||||
logical g; bits h; string(32) j;
|
||||
|
||||
% assign "initial values" %
|
||||
f := d := c := b := a2 := a1 := 0; % multiple assignment %
|
||||
g := false; h := #a0; j := "Hello, World!";
|
||||
2
Task/Variables/ALGOL-W/variables-2.alg
Normal file
2
Task/Variables/ALGOL-W/variables-2.alg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
record R1 ( integer length; string(256) text );
|
||||
reference(R1) ref1, ref2;
|
||||
3
Task/Variables/ALGOL-W/variables-3.alg
Normal file
3
Task/Variables/ALGOL-W/variables-3.alg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
record person( string(32) name; integer age );
|
||||
record date( integer day, month, year );
|
||||
reference(person, date) ref3;
|
||||
1
Task/Variables/ALGOL-W/variables-4.alg
Normal file
1
Task/Variables/ALGOL-W/variables-4.alg
Normal file
|
|
@ -0,0 +1 @@
|
|||
reference(integer) refInt; % an illegal declaration %
|
||||
2
Task/Variables/ALGOL-W/variables-5.alg
Normal file
2
Task/Variables/ALGOL-W/variables-5.alg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
record INT_VALUE ( integer val );
|
||||
reference(INT_VALUE) refInt;
|
||||
7
Task/Variables/ALGOL-W/variables-6.alg
Normal file
7
Task/Variables/ALGOL-W/variables-6.alg
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
% using the person record defined above...%
|
||||
reference (person) someone;
|
||||
someone := person % create a new person structure with uninitialised fields %
|
||||
name(someone) := "Fred"; % initialise the fields %
|
||||
age(someone) := 27;
|
||||
% could also initialise the fields when the record is created: %
|
||||
someone := person( "Harry", 32 );
|
||||
Loading…
Add table
Add a link
Reference in a new issue