Creating an Array: Difference between revisions

m
→‎{{header|Smalltalk}}: creation (move the rest to the other task)
(→‎{{header|Fortran}}: removed initializator (to array initialization), added some details (inspection too; maybe better somewhere else?))
m (→‎{{header|Smalltalk}}: creation (move the rest to the other task))
Line 701:
 
=={{header|Smalltalk}}==
<lang smalltalk>|array|
array := Array withAll: #('an' 'apple' 'a' 'day' 'keeps' 'the' 'doctor' 'away').
"creates an array that holds up to 20 elements"
 
array := Array new: 20 .
"Access the first element of the array"
"access the first elem element:= array at:base is 1."
(array at: 1) displayNl.
 
"put 100 as second value; you can put any object,
"Replace apple with orange"
in particular SmallInteger"
array at: 2 put: 'orange'100.</lang>
 
=={{header|Tcl}}==