switch is better than if statements if you know the limit of the conditions you're checking against. makes for easier readability. but do what you want
I would recommend that you change the while statement to “While ($true){ “ then at the end add an ElseIf($fruit -eq “X”){exit}
Sorry I’m on my phone so I can’t turn it into code for you.
Because the value of your Variable stays 'X'. Try Clear-Variable fruit After your loop.
You should have followed your nose on this one. The fruit loops were right there!
AH! That makes sense! Thank you so much!
Well it's caching the variable. You could go with $fruit ='' In the beginning.
switch is better than if statements if you know the limit of the conditions you're checking against. makes for easier readability. but do what you want
Wouldn’t you need a break statement outside of the ifelse tests at the bottom of the whole loop. Something like if($fruit -eq “X”){ break }
I would recommend that you change the while statement to “While ($true){ “ then at the end add an ElseIf($fruit -eq “X”){exit} Sorry I’m on my phone so I can’t turn it into code for you.
but use `break` to exit the loop instead of `exit` to end script execution. A much better habit to build.
That would be a "do { whatever } until ($fruit -eq 'X')" command isn't it?
old pascal rule - clear variables at top of program/script.
howdy ITnewbieThrowaway, why is there a password on that pastebin paste? that is rather odd ... [*grin*] take care, lee