Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Arrays/REXX/arrays-1.rexx
Normal file
9
Task/Arrays/REXX/arrays-1.rexx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/*REXX program demonstrates a simple array usage. */
|
||||
a.='not found' /*value for all a.xxx (so far).*/
|
||||
do j=1 to 100 /*start at 1, define 100 elements*/
|
||||
a.j=-j*1000 /*define as negative J thousand. */
|
||||
end /*j*/ /*the above defines 100 elements.*/
|
||||
|
||||
say 'element 50 is:' a.50
|
||||
say 'element 3000 is:' a.3000
|
||||
/*stick a fork in it, we're done.*/
|
||||
11
Task/Arrays/REXX/arrays-2.rexx
Normal file
11
Task/Arrays/REXX/arrays-2.rexx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*REXX program demonstrates array usage with mimicry. */
|
||||
a. = 'not found' /*value for all a.xxx (so far). */
|
||||
do j=1 to 100 /*start at 1, define 100 elements*/
|
||||
a.j = -j * 100 /*define element as -J hundred. */
|
||||
end /*j*/ /*the above defines 100 elements.*/
|
||||
|
||||
say 'element 50 is:' a(50)
|
||||
say 'element 3000 is:' a(3000)
|
||||
exit /*stick a fork in it, we're done.*/
|
||||
/*──────────────────────────────────A subroutine────────────────────────*/
|
||||
a: _a_ = arg(1); return a._a_
|
||||
11
Task/Arrays/REXX/arrays-3.rexx
Normal file
11
Task/Arrays/REXX/arrays-3.rexx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*REXX program demonstrates array usage with mimicry. */
|
||||
a. = 00 /*value for all a.xxx (so far). */
|
||||
do j=1 to 100 /*start at 1, define 100 elements*/
|
||||
a.j = -j * 100 /*define element as -J hundred. */
|
||||
end /*j*/ /*the above defines 100 elements.*/
|
||||
|
||||
say 'element 50 is:' a(50)
|
||||
say 'element 3000 is:' a(3000)
|
||||
exit /*stick a fork in it, we're done.*/
|
||||
/*──────────────────────────────────A subroutine────────────────────────*/
|
||||
a: _a_ = arg(1); return a._a_
|
||||
10
Task/Arrays/REXX/arrays-4.rexx
Normal file
10
Task/Arrays/REXX/arrays-4.rexx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/*REXX program demonstrates array usage (with elements out-of-range).*/
|
||||
array. = 'out of range' /*define ALL elements to this. */
|
||||
|
||||
do j=-3000 to 3000 /*start at -3k, going up to +3k.*/
|
||||
array.j=j**2 /*define element as its square. */
|
||||
end /*j*/ /* [↑] defines 6,001 elements. */
|
||||
g=-7
|
||||
say g "squared is:" array.g
|
||||
say 7000 "squared is:" array.7000
|
||||
/*stick a fork in it, we're done.*/
|
||||
17
Task/Arrays/REXX/arrays-5.rexx
Normal file
17
Task/Arrays/REXX/arrays-5.rexx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*REXX program demonstrates disjointed array usage. */
|
||||
yr. = 'year not supported' /*value for all yr.xxx (so far).*/
|
||||
|
||||
do k=600 to 1100 /*a bunch of years prior to 1800.*/
|
||||
yr.k=k "AD" /*Kth element as the year itself.*/
|
||||
end /*k*/ /* [↑] defines 501 elements.*/
|
||||
|
||||
do j=1800 to 2100 /*start at 1800, define a bunch. */
|
||||
yr.j=j 'AD' /*Jth element as the year itself.*/
|
||||
end /*j*/ /* [↑] defines 301 elements.*/
|
||||
|
||||
year=1946
|
||||
say 'DOB' year "is:" yr.year
|
||||
|
||||
year=1744
|
||||
say 'DOB' year "is:" yr.year
|
||||
/*stick a fork in it, we're done.*/
|
||||
27
Task/Arrays/REXX/arrays-6.rexx
Normal file
27
Task/Arrays/REXX/arrays-6.rexx
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*REXX program demonstrates array usage: sparse and disjointed. */
|
||||
yyy = -55 /*REXX must use this mechanism···*/
|
||||
a.yyy = 1e9 /*··· when assigning neg indices.*/
|
||||
|
||||
a.1 = 1000
|
||||
a.2 = 2000.0001
|
||||
a.7 = 7000
|
||||
a.2012 = 'out here in left field.'
|
||||
a.cat = 'civet, but not a true cat ─── belonging to the family Viverridae'
|
||||
a.civet = "A.K.A.: toddycats"
|
||||
/*┌────────────────────────────────────────────────────────────────────┐
|
||||
│ Array elements need not be continuous (nor even defined). They │
|
||||
│ can hold any manner of numbers, or strings (which can include any │
|
||||
│ characters, including null or '00'x characters). │
|
||||
│ │
|
||||
│ Array elements need not be numeric, as the above code demonstrates.│
|
||||
│ Indeed, the element "name" can be ANYTHING, even non-displayable │
|
||||
│ characters. To illustrate [↓]: │
|
||||
└────────────────────────────────────────────────────────────────────┘*/
|
||||
stuff=')g.u.t.s( or ½ of an intestine!'
|
||||
a.stuff=44
|
||||
/*┌────────────────────────────────────────────────────────────────────┐
|
||||
│ where the element name has special characters: blanks, and the │
|
||||
│ glyph of one-half (½), as well as the symbol used in REXX to │
|
||||
│ identify stemmed arrays (the period). │
|
||||
└────────────────────────────────────────────────────────────────────┘*/
|
||||
/*stick a fork in it, we're done.*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue