Referencing variables from outside the loop

Can someone give me some programming help please?

From outside the loop, I want to reference the variable 'x' which sits insde a loop. What are the rules for doing this please? When I try to do it, AB gives me an error that x hasn't been defined.

You really should post up your code!

Initialize variable 'x' at the top of your code (before loop).

x = 0;

Thanks TrendSurfer. I'm getting a new error now! But it did work. cheers

If you get stuck sorting your new error, post up your code and we will take a look for you.

1 Like