evilmax17
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2011
05:27 PM
Code that spans multiple lines?
Does BrightScript support something like the following syntax format?
I've tried a few different things, and I can't get it to compile unless it's all on one line.
Thanks!
result = myFunction( "Parameter 1",
"Parameter 2",
"Parameter 3" )
I've tried a few different things, and I can't get it to compile unless it's all on one line.
Thanks!
My Roku Channels:
Viddler - viddler.com
Tested Fan - tested.com | Jamie & Adam
This is my next - theverge.com
1080p Showcase - RIP
Whiskey Media - RIP
======================
http://www.binarymoustache.com
Viddler - viddler.com
Tested Fan - tested.com | Jamie & Adam
This is my next - theverge.com
1080p Showcase - RIP
Whiskey Media - RIP
======================
http://www.binarymoustache.com
3 REPLIES 3
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2011
06:05 PM
Re: Code that spans multiple lines?
The sdk makes this work with something similar to
result = myFunction( {"Parameter 1",
"Parameter 2",
"Parameter 3"} )
result = myFunction( {"Parameter 1",
"Parameter 2",
"Parameter 3"} )
kbenson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2011
08:12 PM
Re: Code that spans multiple lines?
"destruk" wrote:
The sdk makes this work with something similar to
result = myFunction( {"Parameter 1",
"Parameter 2",
"Parameter 3"} )
Data structure definitions (in this case you are passing an associative array as the single parameter) can span multiple lines, and if so the comma is optional. As far as I know, there's no way to span a statement across multiple lines, since there is no end of statement marker (such as semicolon).
-- GandK Labs
Check out Reversi! in the channel store!
Check out Reversi! in the channel store!

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2011
09:48 AM
Re: Code that spans multiple lines?
The end of line is a statement terminator, so it is meaningful much like a ';' in some other languages. Therefore you can't use the end of line as regular whitespace as you would in some other languages.
The associative array literal uses the line terminator as a field separator so it appears that the end of line is treated as normal whitespace in this case (because it doesn't end the statement), but it is not. It just has a different meaning.
--Kevin
The associative array literal uses the line terminator as a field separator so it appears that the end of line is treated as normal whitespace in this case (because it doesn't end the statement), but it is not. It just has a different meaning.
--Kevin