Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,3 +0,0 @@
type T is array (Positive range <>) of Integer;
X : T := (1, 2, 3);
Y : T := X & (4, 5, 6); -- Concatenate X and (4, 5, 6)

View file

@ -1,18 +0,0 @@
_ArrayConcatenate($avArray, $avArray2)
Func _ArrayConcatenate(ByRef $avArrayTarget, Const ByRef $avArraySource, $iStart = 0)
If Not IsArray($avArrayTarget) Then Return SetError(1, 0, 0)
If Not IsArray($avArraySource) Then Return SetError(2, 0, 0)
If UBound($avArrayTarget, 0) <> 1 Then
If UBound($avArraySource, 0) <> 1 Then Return SetError(5, 0, 0)
Return SetError(3, 0, 0)
EndIf
If UBound($avArraySource, 0) <> 1 Then Return SetError(4, 0, 0)
Local $iUBoundTarget = UBound($avArrayTarget) - $iStart, $iUBoundSource = UBound($avArraySource)
ReDim $avArrayTarget[$iUBoundTarget + $iUBoundSource]
For $i = $iStart To $iUBoundSource - 1
$avArrayTarget[$iUBoundTarget + $i] = $avArraySource[$i]
Next
Return $iUBoundTarget + $iUBoundSource
EndFunc ;==>_ArrayConcatenate

View file

@ -1,47 +0,0 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. array-concat.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 table-one.
05 int-field PIC 999 OCCURS 0 TO 5 TIMES DEPENDING ON t1.
01 table-two.
05 int-field PIC 9(4) OCCURS 0 TO 10 TIMES DEPENDING ON t2.
77 tally USAGE IS INDEX.
77 t1 PIC 99.
77 t2 PIC 99.
77 show PIC Z(4) USAGE IS DISPLAY.
PROCEDURE DIVISION.
array-concat-main.
PERFORM initialize-tables
PERFORM concatenate-tables
PERFORM display-result
GOBACK.
initialize-tables.
MOVE 4 TO t1
PERFORM VARYING tally FROM 1 BY 1 UNTIL tally > t1
COMPUTE int-field OF table-one(tally) = tally * 3
END-PERFORM
MOVE 3 TO t2
PERFORM VARYING tally FROM 1 BY 1 UNTIL tally > t2
COMPUTE int-field OF table-two(tally) = tally * 6
END-PERFORM.
concatenate-tables.
PERFORM VARYING tally FROM 1 BY 1 UNTIL tally > t1
ADD 1 TO t2
MOVE int-field OF table-one(tally)
TO int-field OF table-two(t2)
END-PERFORM.
display-result.
PERFORM VARYING tally FROM 1 BY 1 UNTIL tally = t2
MOVE int-field OF table-two(tally) TO show
DISPLAY FUNCTION TRIM(show) ", " WITH NO ADVANCING
END-PERFORM
MOVE int-field OF table-two(tally) TO show
DISPLAY FUNCTION TRIM(show).
END PROGRAM array-concat.

View file

@ -1,9 +1,9 @@
import extensions;
public program()
public Program()
{
var a := new int[]{1,2,3};
var b := new int[]{4,5};
auto a := new int[]{1,2,3};
auto b := new int[]{4,5};
Console.printLine(
"(",a.asEnumerable(),") + (",b.asEnumerable(),

View file

@ -1,2 +0,0 @@
(vconcat '[1 2 3] '[4 5] '[6 7 8 9])
=> [1 2 3 4 5 6 7 8 9]

View file

@ -1,5 +0,0 @@
sequence s1,s2,s3
s1 = {1,2,3}
s2 = {4,5,6}
s3 = s1 & s2
? s3

View file

@ -1,5 +0,0 @@
$a = 1,2,3
$b = 4,5,6
$c = $a + $b
Write-Host $c

View file

@ -1,7 +0,0 @@
a1: [1 2 3]
a2: [4 5 6]
a3: [7 8 9]
append a1 a2 ; -> [1 2 3 4 5 6]
append/only a1 a3 ; -> [1 2 3 4 5 6 [7 8 9]]

View file

@ -1,5 +1,5 @@
-- 1 Jun 2025
include Settings
-- 23 Aug 2025
include Setting
say 'ARRAY CONCATENATION'
say version
@ -16,6 +16,8 @@ a.0=j
do i = 1 to a.0
say i a.i
end
say
call DumpVariables
exit
include Abend
include Math

View file

@ -1 +0,0 @@
Js.Array2.concat(["a", "b"], ["c", "d", "e"]) == ["a", "b", "c", "d", "e"]

View file

@ -1,18 +0,0 @@
Function ArrayConcat(arr1, arr2)
ReDim ret(UBound(arr1) + UBound(arr2) + 1)
For i = 0 To UBound(arr1)
ret(i) = arr1(i)
Next
offset = Ubound(arr1) + 1
For i = 0 To UBound(arr2)
ret(i + offset) = arr2(i)
Next
ArrayConcat = ret
End Function
arr1 = array(10,20,30)
arr2 = array(40,50,60)
WScript.Echo "arr1 = array(" & Join(arr1,", ") & ")"
WScript.Echo "arr2 = array(" & Join(arr2,", ") & ")"
arr3 = ArrayConcat(arr1, arr2)
WScript.Echo "arr1 + arr2 = array(" & Join(arr3,", ") & ")"