I have problem with using 2 conditions in while loop at my code.
condition after "or" statment is ignored
while (($log_in -ne $NULL) -or ($log_in -eq "JA99878"))
while loop with or statement
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: while loop with or statement
That kind of statement never needs to be tested for null.
while ($log_in -eq 'JA99878')
No need for null test as it only runs when equal and will quit on not equal or null.
while ($log_in -eq 'JA99878')
No need for null test as it only runs when equal and will quit on not equal or null.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: while loop with or statement
[Topic moved by moderator. Please always post in the forum best suited for your question]
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.