Filter: Difference between revisions
→{{header|QBASIC}}
No edit summary |
|||
Line 2,990:
<syntaxhighlight lang="q">x where 0=x mod 2</syntaxhighlight>
==={{header|QBASIC}}===
{{works with|QuickBasic|4.x}}
{{works with|Visual Basic for DOS|1.0}}
Line 2,999:
' Filter
' This program selects certain elements from an array into a new array in a generic way
' Extra points: Destroys the original values in the array
' SUBs
Line 3,008 ⟶ 3,009:
CONST Uneven = 1
DIM t AS INTEGER
Dim t2 AS INTEGER
DIM i AS INTEGER
DIM iArray%(1 TO 1)
' Register
Line 3,034 ⟶ 3,035:
' Shows the result
IF
PRINT "Selected items from the array (total:";
FOR i = 1 TO
PRINT
NEXT i
END IF
Line 3,055 ⟶ 3,056:
DIM rSub AS regSub
SHARED iArray%()
CONST aName$ = "DUMMY$$$.$$$"
CONST False = 0, True = NOT False
Line 3,082:
' Redims the 2nd array
t = LOF(f) / LEN(rSub)
REDIM
FOR i = 1 TO t
GET #f, i, rSub
NEXT i
|