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: 
EnTerr
Roku Guru

? ... --- ...

Today's wisecrack: did you know B/S implicitly supports Morse code? 😛

Pop-quiz: "So you think you know BrightScript? Try to guess what the following will output:"
Brightscript Debugger> ? ... --- ...
0 Kudos
3 REPLIES 3
joetesta
Roku Guru

Re: ? ... --- ...

haha same thing this outputs:

? ...


if you end with a hyphen, you get a syntax error.  if you print a dot, it outputs a zero.  fun stuff!
aspiring
0 Kudos
EnTerr
Roku Guru

Re: ? ... --- ...

"joetesta" wrote:
if you end with a hyphen, you get a syntax error.

So we shan't signal messages that end in any of 'AJKMOQTUVWXY' 8-)

if you print a dot, it outputs a zero.  fun stuff!

it's tad more complicated than that. SOS does not output 6 zeros
0 Kudos
joetesta
Roku Guru

Re: ? ... --- ...

"EnTerr" wrote:
it's tad more complicated than that. SOS does not output 6 zeros

Is it?

? ......



Brightscript Debugger> ? ......
 0 0 0 0 0 0

Well something tricky is going on;

Brightscript Debugger> ? -.-.-.-.-.-.
 0

Brightscript Debugger> ? ------......
 0

Brightscript Debugger> ? ------ ......
 0

Brightscript Debugger> ? - .....
 0 0 0 0
 
Brightscript Debugger> ? -- .....
 0 0 0

Brightscript Debugger> ? --- ...
 0

Brightscript Debugger> ? --- ..
 0

Brightscript Debugger> ? --- ........
 0 0 0 0 0

So it seems each leading hyphen will remove one following period, but if there are any following periods it will always output at least one zero no matter how many leading hyphens there are.
hmm - no, these are not simple rules!

Brightscript Debugger> ? .....-----.
 0 0 0 0 0
aspiring
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.