Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,11 @@
function f(a, b, c){
if (a != "") print a
if (b != "") print b
if (c != "") print c
}
BEGIN {
print "[1 arg]"; f(1)
print "[2 args]"; f(1, 2)
print "[3 args]"; f(1, 2, 3)
}

View file

@ -0,0 +1,13 @@
function f(a, b, c) {
if (a != "") print a
if (b != "") print b
if (c != "") print c
}
BEGIN {
# Set ary[1] and ary[2] at runtime.
split("Line 1:Line 2", ary, ":")
# Pass to f().
f(ary[1], ary[2], ary[3])
}

View file

@ -0,0 +1,9 @@
function g(len, ary, i) {
for (i = 1; i <= len; i++) print ary[i];
}
BEGIN {
c = split("Line 1:Line 2:Next line is empty::Last line", a, ":")
g(c, a) # Pass a[1] = "Line 1", a[4] = "", ...
}