Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Komag
Roku Guru

"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
0 Kudos
4 REPLIES 4
belltown
Roku Guru

Re: "Print" appears to be limited to 10 variables

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

Re: "Print" appears to be limited to 10 variables

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

--Mark
0 Kudos
EnTerr
Roku Guru

Re: "Print" appears to be limited to 10 variables

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

@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
0 Kudos
Komag
Roku Guru

Re: "Print" appears to be limited to 10 variables

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
0 Kudos