Jump to content
Terenz

For loop and True-False

Recommended Posts

Terenz

There is a better way to write this sort of pseudo-code?

Local $aTEST[4] = [True,False,False,True]

For $i = 0 To UBound($aTEST) - 1
    If $aTEST[$i] = True Then
        ConsoleWrite(False & @CRLF)
        ; MyFunc1(False)
        ; MyFunc2(False)
        ; MyFunc3(False)
        ; MyFunc4(False)
        ; MyFunc5(False)
        ; MyFunc6(False)
        ; MyFunc7(False)
        ; MyFunc8(False)
    ElseIf $aTEST[$i] = False Then
        ConsoleWrite(True & @CRLF)
        ; MyFunc1(True)
        ; MyFunc2(True)
        ; MyFunc3(True)
        ; MyFunc4(True)
        ; MyFunc5(True)
        ; MyFunc6(True)
        ; MyFunc7(True)
        ; MyFunc8(True)
    EndIf
Next

Thanks 


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites
Terenz

You have right, "Not" convert True to False e False to True. Thanks


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites
Danyfirex

 

I prefer to do the operation Not inside the function.

 

Saludos

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.