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,16 +0,0 @@
with Ada.Text_IO; use Ada.Text_IO;
with System;
procedure Array_Length is
Fruits : constant array (Positive range <>) of access constant String
:= (new String'("orange"),
new String'("apple"));
Memory_Size : constant Integer := Fruits'Size / System.Storage_Unit;
begin
Put_Line ("Number of elements : " & Fruits'Length'Image);
Put_Line ("Array memory Size : " & Memory_Size'Image & " bytes" );
Put_Line (" " & Integer'Image (Memory_Size * System.Storage_Unit / System.Word_Size) & " words" );
end Array_Length;

View file

@ -1,9 +0,0 @@
Opt('MustDeclareVars',1) ; 1 = Variables must be pre-declared.
Local $aArray[2] = ["Apple", "Orange"]
Local $Max = UBound($aArray)
ConsoleWrite("Elements in array: " & $Max & @CRLF)
For $i = 0 To $Max - 1
ConsoleWrite("aArray[" & $i & "] = '" & $aArray[$i] & "'" & @CRLF)
Next

View file

@ -1,40 +0,0 @@
identification division.
program-id. array-length.
environment division.
configuration section.
repository.
function all intrinsic.
data division.
working-storage section.
01 table-one.
05 str-field pic x(7) occurs 0 to 5 depending on t1.
77 t1 pic 99.
procedure division.
array-length-main.
perform initialize-table
perform display-table-info
goback.
initialize-table.
move 1 to t1
move "apples" to str-field(t1)
add 1 to t1
move "oranges" to str-field(t1).
*> add an extra element and then retract table size
add 1 to t1
move "bananas" to str-field(t1).
subtract 1 from t1
.
display-table-info.
display "Elements: " t1 ", using " length(table-one) " bytes"
display table-one
.
end program array-length.

View file

@ -1,2 +0,0 @@
(length ["apple" "orange"])
=> 2

View file

@ -1,18 +0,0 @@
sequence s = {"apple","orange",2.95} -- Euphoria doesn't care what you put in a sequence
? length(s)
3 -- three objects
? length(s[1])
5 -- apple has 5 characters
? length(s[1][$])
1 -- 'e' is an atomic value
? length(s[$])
1 -- 2.95 is an atomic value

View file

@ -1,3 +1,34 @@
\\ A is a pointer to array
' A is a pointer to array
A=("Apple", "Orange")
Print Len(A)=2 ' True
Print Type$(A)="tuple"
Dim A(10,2) as Byte=32, B(), C(10,2)
Print Len(A())=20, Len(B())=0, Len(C())=20
C(1,1)="String"
C(2,0)=100, 3
Dim C(6,2)
Print Len(C())=12
Print C(2,0)=100, C(2,1)=3, C(1,1)="String"
B()=A ' this is a copy
A=(,)
Print B(1)="Orange", Len(B())=2, Len(A)=0
Print Type$(B())="mArray", Type$(A)="tuple"
A=B() ' now A point to B()
Print Type$(A)="mArray"
Print A(5,1)=32, Type$(A(5,1))="Byte"
A=A() ' point to A() we address through A as a flat 1d array.
Print Type$(A,0)="Byte", A#val(0)=32, A#sum()=32*20, A()#sum()=32*20
Print Dimension(A())=2 ' Number of dimensions
Print Dimension(A(), 1)=10, Dimension(A(), 2)=2 ' length for each dimension
Print Dimension(A(), 1, 0)=0, Dimension(A(), 1, 1)=9 ' lower and upper bound on 1st Dimension
' RefArray type of Arrays (always 0 lower bound)
Variant D[100]
Print Len(D)=101, Type$(D)="RefArray"
Byte F[9][1]
Print Len(F)=10
F[3][0]=111
F[3][4]=105
D[3]=F[3][] ' copy a row from F[3] to D[3]
F[3][0]++
Print D[3][0]=111, D[3][4]=105, F[3][0]=112

View file

@ -1,3 +0,0 @@
$Array = @( "Apple", "Orange" )
$Array.Count
$Array.Length

View file

@ -1,2 +0,0 @@
>> length? ["apples" "oranges"]
== 2

View file

@ -1,3 +0,0 @@
let fruits = ["apple", "orange"]
Js.log(Js.Array.length(fruits))

View file

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>ReScript: Array.length()</title>
<style rel="stylesheet" type="text/css">
body { color:#EEE; background-color:#888; }
</style>
<script>var exports = {};</script>
<script src="./arrlen.js"></script>
</head>
<body>
</body>
</html>

View file

@ -1,2 +0,0 @@
arr = Array("apple","orange")
WScript.StdOut.WriteLine UBound(arr) - LBound(arr) + 1