langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1,45 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols nobinary
|
||||
|
||||
say 'Using arrays'
|
||||
aa = ['a', 'b', 'c', 'd']
|
||||
bb = ['A', 'B', 'C']
|
||||
cc = [1, 2, 3, 4]
|
||||
|
||||
loop x_ = 0 for aa.length
|
||||
do
|
||||
ax = aa[x_]
|
||||
catch ArrayIndexOutOfBoundsException
|
||||
ax = ' '
|
||||
end
|
||||
do
|
||||
bx = bb[x_]
|
||||
catch ArrayIndexOutOfBoundsException
|
||||
bx = ' '
|
||||
end
|
||||
do
|
||||
cx = cc[x_]
|
||||
catch ArrayIndexOutOfBoundsException
|
||||
cx = ' '
|
||||
end
|
||||
|
||||
say ax || bx || cx
|
||||
end x_
|
||||
|
||||
say 'Using indexed strings (associative arrays)'
|
||||
ai = sampleData('a b c d')
|
||||
bi = sampleData('A B C')
|
||||
ci = sampleData('1 2 3 4')
|
||||
|
||||
loop x_ = 1 to ai[0]
|
||||
say ai[x_] || bi[x_] || ci[x_]
|
||||
end x_
|
||||
|
||||
method sampleData(arg) public static returns Rexx
|
||||
smp = ' '
|
||||
smp[0] = arg.words
|
||||
loop i_ = 1 to smp[0]
|
||||
smp[i_] = arg.word(i_)
|
||||
end i_
|
||||
|
||||
return smp
|
||||
Loading…
Add table
Add a link
Reference in a new issue