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: 
mitchr181
Visitor

String Concatenation

I have this code that builds a URL for doing API requests:
Function buildURL(channel As String, token As String, sig As String) as String
  Return "https://usher.twitch.tv/api/channel/hls/" + channel + ".m3u8?player=twitchweb&token=" + token + "&sig=" + sig "&allow_audio_only=true&allow_source=true&type=any&p=" + "7333049"
end Function

But it won't compile. This is the error I'm getting:
*** ERROR compiling /pkg:/source/main.brs:

Syntax Error. (compile error &h02) in pkg:/source/main.brs(37)

I initially thought that there was something going on with string not being mutable so I changed it to this, but I still get the same syntax error:
Function buildURL(channel, token, sig) as String
  Return "https://usher.twitch.tv/api/channel/hls/" + channel.tostr() + ".m3u8?player=twitchweb&token=" + token.tostr() + "&sig=" + sig.tostr() "&allow_audio_only=true&allow_source=true&type=any&p=" + "7333049"
end Function
0 Kudos
3 REPLIES 3
squirreltown
Roku Guru

Re: String Concatenation

both are  missing a + after the sig variable.
Kinetics Screensavers
0 Kudos
mitchr181
Visitor

Re: String Concatenation

Ah I feel like a real idiot, thank you!
0 Kudos
squirreltown
Roku Guru

Re: String Concatenation

No sweat. I've done it. 😄
Kinetics Screensavers
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.