Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Nested IF's


bKlippert Apr 25, 2014 05:39 AM

Hello,


I need confirmation if the following code will work as expected.


Public StatusLED(8) As Boolean
Public Ignore As Boolean
Public Flag As Boolean

For I = 1 To 8
If StatusLED(I) Then
If NOT Ignore Then Flag = True
EndIf
Next I


But perhaps this is better?

For I = 1 To 8
If StatusLED(I) AND NOT Ignore Then
Flag = True
EndIf
Next I


Thanks in advance!

* Last updated by: bKlippert on 4/24/2014 @ 11:50 PM *


EarlyBird Apr 25, 2014 06:41 AM

As Ignore only needs to be tested once you could use


Public StatusLED(8) As Boolean
Public Ignore As Boolean
Public Flag As Boolean

If NOT Ignore Then
For I = 1 To 8
If StatusLED(I) Then Flag = True
Next I
Endif

Log in or register to post/reply in the forum.