Filter: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: refurbished and corrected)
m (→‎Using a control array: fix </syntaxhighlight>)
Line 3,344:
===Using a control array===
This version uses a control array (even.*)
<syntaxhighlight lang="rexx"></syntaxhighlight>*REXX program uses a control array to tell which elements ars even. */
/*REXX program uses a control array to tell which elements ars even. */
Parse Arg n seed . /* obtain optional arguments from CL*/
If n==''|n=="," Then n=50 /* Not specified? use the default */
Line 3,361 ⟶ 3,360:
If even.k Then /* that are even */
Say right('x.'k,20) '=' right(x.k,9)
End</syntaxhighlight>
{{out|output|text=&nbsp; when using the input of: &nbsp; &nbsp; <tt> 20 &nbsp; 1234567 </tt>}}
<pre>
Line 3,372 ⟶ 3,371:
x.19 = 92502
x.20 = 24808</pre>
 
===using one array, destructive===
This version just uses one array to perform the filtering instead of creating a &nbsp; ''new'' &nbsp; array.