Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
|
|
@ -1,9 +0,0 @@
|
|||
/*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.*/
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
/*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_
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
/*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_
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
/*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.*/
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
/*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.*/
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
/*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.*/
|
||||
67
Task/Arrays/REXX/arrays.rexx
Normal file
67
Task/Arrays/REXX/arrays.rexx
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
-- 1 Jun 2025
|
||||
include Settings
|
||||
|
||||
say 'ARRAYS'
|
||||
say version
|
||||
say
|
||||
say 'A simple array...'
|
||||
do i = 1 to 100
|
||||
a.i=i*i
|
||||
end
|
||||
say 'Square of' 5 'is' a.5
|
||||
say 'Square of' 55 'is' a.55
|
||||
say
|
||||
say 'Mimic indexing...'
|
||||
say 'Square of' 5 'is' a(5)
|
||||
say 'Square of' 55 'is' a(55)
|
||||
say
|
||||
say 'A default value...'
|
||||
b. = 'Out of range'
|
||||
do i = 1 to 100
|
||||
b.i=1/i
|
||||
end
|
||||
say 'Inverse of' 5 'is' b.5
|
||||
say 'Inverse of' 55 'is' b.55
|
||||
say 'Inverse of' 555 'is' b.555
|
||||
say
|
||||
say 'An other index range...'
|
||||
do i = -100 to 100
|
||||
c.i=i*i*i
|
||||
end
|
||||
j=-55; say 'Cube of' j 'is' c.j
|
||||
j=-5; say 'Cube of' j 'is' c.j
|
||||
j=5; say 'Cube of' j 'is' c.j
|
||||
j=55; say 'Cube of' j 'is' c.j
|
||||
say
|
||||
say 'A sparse array...'
|
||||
d.='Not calculated'
|
||||
do i = 2 by 2 to 100
|
||||
d.i=-i
|
||||
end
|
||||
say 'Negative of' 55 'is' d.55
|
||||
say 'Negative of' 56 'is' d.56
|
||||
say
|
||||
say 'Special indices...'
|
||||
e.cat='civet'; say 'e.cat =' e.cat
|
||||
a1='dog'; e.a1='pitbull'
|
||||
a2=a1; say 'e.'a2 '=' e.a2
|
||||
a1='x.y.z'; e.a1='periods'
|
||||
a2=a1; say 'e.'a2 '=' e.a2
|
||||
a1='x y z'; e.a1='spaces'
|
||||
a2=a1; say 'e.'a2 '=' e.a2
|
||||
a1='└┴┬├─┼'; e.a1='specials'
|
||||
a2=a1; say 'e.'a2 '=' e.a2
|
||||
say
|
||||
say 'Element has no value...'
|
||||
signal off novalue
|
||||
say 'f.notassigned =' f.notassigned
|
||||
signal on novalue name Abend
|
||||
say 'f.notassigned =' f.notassigned
|
||||
exit
|
||||
|
||||
A:
|
||||
procedure expose a.
|
||||
arg xx
|
||||
return a.xx
|
||||
|
||||
include Abend
|
||||
Loading…
Add table
Add a link
Reference in a new issue