Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make if behavior when using numeric variables consistent with Roku #35

Closed
lvcabral opened this issue Nov 30, 2023 · 1 comment
Closed
Assignees

Comments

@lvcabral
Copy link
Collaborator

sub main()
    a = { bolFalse: false, bolTrue: true, intFalse: 0, intTrue: 1 }
    print a
    print "Positive Test Bool"
    if a.bolFalse then print "True" else print "False"
    if a.bolTrue then print "True" else print "False"
    print "Positive Test Int"
    if a.intFalse then print "True" else print "False"
    if a.intTrue then print "True" else print "False"
    print "Negative Test Bool"
    if not a.bolFalse then print "True" else print "False"
    if not a.bolTrue then print "True" else print "False"
    print "Negative Test Int"
    if not a.intFalse then print "True" else print "False"
    if not a.intTrue then print "True" else print "False"
end sub

The actual ROKU output is:

<Component: roAssociativeArray> =
{
    bolfalse: false
    boltrue: true
    intfalse: 0
    inttrue: 1
}
Positive Test Bool
False
True
Positive Test Int
False
True
Negative Test Bool
True
False
Negative Test Int
True
True

And the current BRS output is:

<Component: roAssociativeArray> =
{
    bolFalse: false
    bolTrue: true
    intFalse: 0
    intTrue: 1
}
Positive Test Bool
False
True
Positive Test Int
False
False
Negative Test Bool
True
False
Negative Test Int
/Users/cabralmb/Repos/brs-emu/test/emulator/if-integer-test.brs(14,7-10): Attempting to NOT non-boolean value.
                            value type: Integer
@lvcabral lvcabral changed the title Make if behavior when using integer variables consistent with Roku Make if behavior when using numeric variables consistent with Roku Nov 30, 2023
@lvcabral lvcabral self-assigned this Mar 30, 2024
@lvcabral
Copy link
Collaborator Author

lvcabral commented Apr 1, 2024

Addressed by #50 and #51

@lvcabral lvcabral closed this as completed Apr 1, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant