EngoTom
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
09:16 AM
Quick Brightscript questions
Question 1, How do I cast a string to an int?
if "1" > 2
'do something
end if
Question 2, how do I pass a reference to a variable?
From my poster screen I pass an roArray to the scringboard when I create it. If modified on the springboard I want the poster screen roArray to represent the changes.
THX
if "1" > 2
'do something
end if
Question 2, how do I pass a reference to a variable?
From my poster screen I pass an roArray to the scringboard when I create it. If modified on the springboard I want the poster screen roArray to represent the changes.
THX
3 REPLIES 3

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
09:29 AM
Re: Quick Brightscript questions
myString = "1"
If myString.ToInt() > 2 Then...
or you can use the Int() function...
myString = "1"
If Int( myString ) > 2 Then...
All objects are passed by reference, but as far as my testing has gone, it seems the data used for display is a copy, so you'll need to call SetContent and/or SetContentList again with the updated data to get the Poster and Springboard screens to update.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
kbenson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:37 AM
Re: Quick Brightscript questions
"TheEndless" wrote:
All objects are passed by reference, but as far as my testing has gone, it seems the data used for display is a copy, so you'll need to call SetContent and/or SetContentList again with the updated data to get the Poster and Springboard screens to update.
I imagine since components are supposed to be implemented in C/C++ that they are converting the data structures to a native format for the component, copying implicitly.
We routinely use shortcuts like so in KidPaint for purely brightscript constructs:
config = {
ui: {
tools: {
shape: { img: "file_path", size: "size_data", handler: "handler_routine" }
stamps: { img: "file_path", size: "size_data", handler: "handler_routine" }
}
}
}
shapeMeta = config.ui.tools.shape
shapeMeta.handler = "new_handler_routine"
print config.ui.tools.shape.handler ' prints "new_handler_routine"
-- GandK Labs
Check out Reversi! in the channel store!
Check out Reversi! in the channel store!
EngoTom
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
01:54 PM
Re: Quick Brightscript questions
Thanks Guys...