sjbarag / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
113 stars 43 forks source link

AppendString() not working #513

Closed adheus closed 4 years ago

adheus commented 4 years ago

The following function generates a 22 digits string on Roku native brightscript:

function generateSessionId()
    MAX_SIZE = 22
    index = 0
    sessionId = box("")
    while index <= MAX_SIZE
        index = index + 1
        sessionId.appendString(Rnd(9).toStr(), 1)
    end while
    return sessionId
end function

On brs, it generates an empty string.

NOTE: The box()function is not available but I'm using a mock that just returns the same value passed as argument. See Box(x as Dynamic) as Object

alimnios72 commented 4 years ago

@adheus I used the wrong keyword but this should be fixed now