battousai liang wrote:So how do i write an 'If' statement to ask if the value inside each index is within it's parameters.
If it's a small, fixed number of parameters (probably no more than 3 or 4), you can do it as:
Of course "in range" has to be replaced by an appropriate
test, such as
> 0. And if you have more than a single comparison to make, such as "between two numbers," then you'll have to mention each index multiple times.
You can do it for more than that if it's a fixed number, but the code gets unwieldy. For a large or variables number of items to test, you'd use an array or collection, and a loop. If any one of the items fails its test, you set a flag to indicate that, and break out of the loop.