Array length: Difference between revisions
Content added Content deleted
(Added EchoLisp) |
Walterpachl (talk | contribs) (add REXX) |
||
Line 36: | Line 36: | ||
2 |
2 |
||
>>> </lang> |
>>> </lang> |
||
=={{header|REXX}}== |
|||
<lang rexx>/* REXX ------------------------------------------------ |
|||
* The compond variable a. implements an array |
|||
* By convention, a.0 contains the number of elements |
|||
*---------------------------------------------------*/ |
|||
a.=0 /* initialize the "array" */ |
|||
call store 'apple' |
|||
Call store 'orange' |
|||
Say 'There are' a.0 'elements in the array:' |
|||
Do i=1 To a.0 |
|||
Say 'Element' i':' a.i |
|||
End |
|||
Exit |
|||
store: Procedure Expose a. |
|||
z=a.0+1 |
|||
a.z=arg(1) |
|||
a.0=z |
|||
Return</lang> |
|||
{{out}} |
|||
<pre>E:\>There are 2 elements in the array: |
|||
Element 1: apple |
|||
Element 2: orange</pre> |
|||
=={{header|SQL}}== |
=={{header|SQL}}== |