choobakka Posted March 25, 2006 Share Posted March 25, 2006 is it possible to have an if/else statement within a 'for' statement?if so what is the default syntax becuase i keep getting errors!thanks in advance Link to comment Share on other sites More sharing options...
Webworldx Posted March 25, 2006 Share Posted March 25, 2006 for(i=0;i<array.length;i++){ if(array[i] == "something") { } else { }} Link to comment Share on other sites More sharing options...
SillyBilly Posted March 26, 2006 Share Posted March 26, 2006 is it possible to have an if/else statement within a 'for' statement?if so what is the default syntax becuase i keep getting errors!thanks in advance<{POST_SNAPBACK}> Try this tutorial, especially the link to part of page 5 where you will find a example of a nested loop using for, if, and else. You might want to review page five of the tut as it builds up the Conditional Statements and Loops.Nested Condition Statements and Loops Link to comment Share on other sites More sharing options...
manick Posted March 28, 2006 Share Posted March 28, 2006 Hi Choobakka, You're not doing the OU TT281 course by any chance are you??????Nick T Link to comment Share on other sites More sharing options...
choobakka Posted March 28, 2006 Author Share Posted March 28, 2006 No No. lolwhere r u from?im from london Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now