Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
mitchr181
Level 7

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
squirreltown
Level 8

Re: String Concatenation

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

Re: String Concatenation

Ah I feel like a real idiot, thank you!
0 Kudos
squirreltown
Level 8

Re: String Concatenation

No sweat. I've done it. Smiley Very Happy
Kinetics Screensavers
0 Kudos