BBC BASIC for Windows
Programming >> BBC BASIC language >> The array value duplication protection tool http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1459221170 The array value duplication protection tool
Post by michael on Mar 29th, 2016, 03:12am
Lets say you have an array and you want to make sure all your array information doesn't have duplicated values.
Well here is the tool that does just that. (Of course your array must match the array in the tool) Code:
DEF PROC_comparray(n)
cond$="cleared"
nex=1
FOR cou=1 TO n
FOR co=nex TO n
IF cou<>co THEN IF x%(cou)=x%(co) THEN cond$="duplicate"
NEXT co
nex=nex+1
NEXT cou
ENDPROC