Array length: Difference between revisions
Content deleted Content added
Added BaCon version. |
|||
Line 456:
String length: apple 5
</pre>
=={{header|BaCon}}==
BaCon knows three types of arrays, the UBOUND function can query all.
<lang bacon>' Static arrays
DECLARE fruit$[] = { "apple", "orange" }
PRINT UBOUND(fruit$)
' Dynamic arrays
DECLARE vegetable$ ARRAY 2
vegetable$[0] = "cabbage"
vegetable$[0] = "spinach"
PRINT UBOUND(vegetable$)
' Associative arrays
DECLARE meat$ ASSOC STRING
meat$("first") = "chicken"
meat$("second") = "pork"
PRINT UBOUND(meat$)</lang>
=={{header|BASIC}}==
|