"Print" appears to be limited to 10 variables

This works for me:

? "mpScrOne() cRyOff" cRyOff ", cRxOff" cRxOff ", cmSOy" cmSOy ", cmSOx" cmSOx ", mSYp" mSYp ", mSXp" mSXp ", mSY" mSY ", mSX" mSX ", x" x ", y" y

But this won’t compile, gives a syntax error:

? "mpScrOne() cRyOff" cRyOff ", cRxOff" cRxOff ", cmSOy" cmSOy ", cmSOx" cmSOx ", mSYp" mSYp ", mSXp" mSXp ", mSY" mSY ", mSX" mSX ", x" x ", y" y ", rm" rm

It’s the 11th variable that kills it. I tried this and it works fine:

? "mpScrOne() cRyOff" cRyOff ", cRxOff" cRxOff ", cmSOy" cmSOy ", cmSOx" cmSOx ", mSXp" mSXp ", mSY" mSY ", mSX" mSX ", x" x ", y" y " rm" rm

That just removes one of the earlier variables so the total is 10 again

This is undocumented as far as I could find

Does it work if you use multiple Print statements, ending each one except the last with a semicolon?

Print is limited to 20 parameters (strings and variables). Your example has indeed reached the limit.

–Mark

Amazing. I mean, any numerical limit besides 0, 1 and (M)ANY has a magical quality to it :slightly_smiling_face:

@belltown already mentioned it but it’s worth repeating - ending PRINT with comma or semicolon does not print a new line:

Brightscript Debugger> ? "blah", : ? "de"; : ? "blah"
blah            deblah

Yeah, thanks for that tip. I just wanted one line of code to compactly give me a lot of telemetry on every direction press for debugging an issue, with the output only taking one line in PurpleBug, so the lines would all stack up neatly and I could visually track the changes as I went. I see that I can simply break up any long print command by ending with a semicolon and then just running another print command, up to 20 parameters each.

I resolved it previously by only including my “x” variants and focusing on that half of the issue first.

I would suggest the Print documentation be updated with this limit:
https://sdkdocs.roku.com/display/sdkdoc … NTitemlist