1. I don't understand what I would use for OTHERARRAY?
2. The if compares to a single element in OTHERARRAY right? How would I get at the single element unless I use another for loop to cycle through it? | [reply] |
1. I don't understand what I would use for OTHERARRAY?
Something like
@OTHERARRAY or @SOMETHING, @POOPS, @MCGEE, @FOO, @BAR, @BAZ, @MOO, @SHOO, @GCTAYLOR1, @ELEMENTSSEENALREADY... :)
understand? ARRAY is one name, OTHERARRAY is another.
2. The if compares to a single element in OTHERARRAY right? How would I get at the single element unless I use another for loop to cycle through it?
Almost, it compares to every single element in OTHERARRAY, and you use another loop for that. Loops are the basis for computers (everything is a loop, from RAM to CPU). Its one of those fundamental you must master, so
stick to it and it will stick to you :)
foreach
String comparison
After you've got that loop version working,
next step is to do it without an explicit loop.
You'll be using index and
join :)
| [reply] |