Every real programming language has some sort of online documentation that spells out each function, what it’s used for and such like that… Where is brightscripts documentation? and before someone says ‘read the manual’… i’ve downloaded the SDK, i’ve read all the PDF’s in the SDK several times – the function list isnt there…
For SDK 2.9 Public/Stable
Built-in functions are in section 6/page 30. Global functions are in section 7, page 33. Global String functions are in section 8, page 36, global math functions are in section 9, page 38. Reserved words are in Appendix C page 56.
For SDK 3.0 Beta
Built-in functions are in section 6/page 34. Global functions are in section 7, page 37. Global String functions are in section 8, page 40, global math functions are in section 9, page 42. Reserved words are in Appendix C page 74.
All of this is in the BrightscriptReferenceManual.pdf which is in the SDK archive in the “Documents” folder.
Edited to add 2.9 firmware revision information.
I’ve gone through them several, it’s of absolutely no help… asking a question to the dev email they direct you here, asking a question here you get directed to read the documentation… so you read the documentation for the 30th time and it still doesn’t help you…
I’m not new to coding by any means, but this documentation (or lack of it) is absolutely idiotic.
The documentation that you listed in your response exists sure, but is it helpful? not in the slightest. such as the first thing on page 34… sw = CreateObject(“roGpioControlPort”)
Okay so CreateObject I get that… but rogpiocontrolport what the hell is that.. do i have to create that? is it a function, or what… what’s the point of using CreateObject? what’s it do? any other ways of doing it? There is absolutely zero information on any of this type of stuff like any REAL documentation should have…
Lets look at PHP for example, http://www.php.net/manual/en/language.b … hpmode.php which is the basic syntax of PHP. There is information and documented code examples about what it does, how it does it and how to use it instead of saying.. there is this function.. then this function.. then this function.. good luck! Where is the indepth documentation for brightscript or has roku decided that even they think brightscript is meaningless?
Roku is a joke.. My boss will be disappointed when I tell him to find a fire and die in it if he thinks im going to go through ‘trial and error’ trying to figure out this piece-meal garbage of a language…
[EDIT: I see the code snippet you referenced now]. You should refer to the ComponentReference.pdf for an explanation of all of the components available to the Roku Streaming Player. The component referenced in that sample is a BrightSign component, which also uses BrightScript, but is not a Streaming Player component, which is why you can’t find it in the Streaming Player SDK.
In the brightscript reference 3.0 I see that on that page for roGPIOPort. It is solely used as an example. ro is for ROKU. GPIOPort is a control used for their Brightsign product, not the roku streaming video player. Brightscript is used for both the Brightsign product line as well as the Roku product line, and as it’s proprietary it would be used for any other product Roku creates. Some controls do not work with Roku, others do not work with Brightsign.
A search on google for Roku GPIO brings up this link - http://www.hms-electronics.com/Roku/roku_hd_gpio.htm
I’d guess without that board available, and without the control rogpioport available in the firmware, you won’t be able to create that object in your roku script.
Could the documentation be better? Of course it could. What I suggest for the best way to grasp how this fits together is to skim over the documentation available, briefly, and then look at some sdk example code like the basic poster screen sample. Get it to install as a package on your roku in developer mode and single step through the debugger to examine the lines that execute. Refer to the component reference for help on specific objects/components, and the brightscript reference for the functions. It took me about a month to grasp the concepts on how roku does things but I’m sure you’ll pick it up quicker than I did. Training should be ‘billable time’ for your boss because once you understand this part you can code whatever he wants quite efficiently and easily (for most things!).
btw - as TheEndless suggested, the Component Reference PDF contains ‘most’ of the common components you will use createobject for in the Roku environment. Some extras are in the brightscript manual PDF if you have 3.0 firmware installed like roScreen. Perhaps they will merge those over to the component reference after public release of 3.0 as it would be easier to have it all in one place.
I must say that I understand jblack99’s frustration.
I have been scripting for several years now, and have trouble understanding how to do things in Brightscript, too.
It seems there needs to be more examples, along with explanations.
Perhaps there is value in someone writing an instructional manual that has guided steps? Could this be a community project?
Bruce
“brucerothwell” wrote:
I must say that I understand jblack99’s frustration.I have been scripting for several years now, and have trouble understanding how to do things in Brightscript, too.
It seems there needs to be more examples, along with explanations.
Perhaps there is value in someone writing an instructional manual that has guided steps? Could this be a community project?
Bruce
Have you seen Roku’s developer blog yet?
http://blog.roku.com/developer/
It’s not a complete instructional manual, but it does at least provide some decent examples with plenty of explanatory text. There’s a “Hello, World” example here with three variations on the theme: http://blog.roku.com/developer/2011/05/ … o-world-2/
How about this… I’ve got some example code, that seems to be based on a videoplayer style example, but I am building a channel based on the MRSS template… quite different. I want to figure out how apply the example code for the Resume functionality, but I can’t seem to get my head around it.
I just haven’t landed on that one thing that turns on the light bulb for me.
In the VideoPlayer sample, the resume functionality is handled mostly in showDetailScreen, by the code that sets the PlayStart time before calling ShowVideoScreen. In the MRSSTemplate example, the similar function is ShowSpringboardScreen. You would just set PlayStart in the same way before calling ShowVideoScreen. You’ll also need to store the playback position in the registry when your video player gets an isPlaybackPosition message, like showVideoScreen in the VideoPlayer example does. (This assumes that you’re storing the playback position in the registry – if you’re storing it in the cloud or on your server, you’ll do that part differently.)
–Mark
I’ve been programming for more than a couple years… Lets try somewhere around near 23 years… I’ve been around the block and know A LOT of different languages.
Brightscript guys say this is based off javascript, but to me it looks a lot more like visual basic and some hints of javascript.. okay fine.. so this is visual basic turned into a scripting language I can dig it…
the reference pdf exists, but it doesn’t go in depth about the functions and what they do exactly. The lack of documentation for this is obsurd and idiotic for roku not to have created a better documentation for developers. Doing so would reduce the amount of crap posts on the forums (such as this thread here), and more developers would be apt to learn the language thus further perpetuating the size of roku.
This simplevideoplayer example, is 254 lines.. it really takes 254 lines of bright script to tell roku ‘hey play this video’? Plus in this example, i see functions that aren’t even listed in the pdf files.. I took a look at the ‘hello world’ example in one of the above posts and I saw exactly what I expected to see… code… some useless text… more code.. and some more useless text.. it didn’t explain what they were doing, why the were doing it or anything like that.. just here this is code.. look at it…
So really the problem here is, whoever created the pdf’s and whoever created brightscript are complete idiots. I could post a lot of code here trying to explain how to do something in PHP, or ASP, or Python, or C#, C++, assembly or numerous other languages. But without documentation, you’d have no clue what you’re looking at and that would be my fault for not explaining it correctly. And that is the problem with the brightscript documentation, it is utterly useless in trying to figure out what the functions do…
like the function CreateObject i can figure that out, it creates an object pretty simple.. but what’s the object? is the object defined by the rofunction you pass into it? and what are these rofunctions? what does each one do? and how bout some comments in the examples.. that might help a bit… ’ ** showSpringboardScreen(); as a comment doesn’t tell me anything.. Sure i guess it shows a spring board i can dig it… but what does the 50 lines between the function declaration and the function end do? i can understand if else elseif, endif while loops in there and such but again it all comes down to the lack of genuine and helpful documentation.. and when online chat refers you to the developers email, the developers email refers you to the forums and the forums refer you to the pdf’s as if one hasn’t read them 100 times already then there is something wrong with everything.
These are just SOME of the questions a new developer to brightscript might have… and if brightscript was my FIRST language – the horrible and idiotic documentation would have put me off to programming completely.. So come on brightscript creators get your heads out of your asses and create a documentation for this crap you call brightscript that would actually help someone…
jblack199, I think you’re being a little harsh. I’ve been programming longer than you and have probably forgotten more languages than most people will ever know. The documentation isn’t great, but it’s adequate. I hate to say it, but I have to wonder what you’ve been doing for 23 years if you can’t get by with the documentation as it is. I could understand it if you were new to programming, but really? 23 years?
It appears you don’t have any specific questions. If you do, there are plenty of helpful people here (and although it doesn’t appear so from this post, I consider myself one of them). And just in case you missed it, most of what you need to know about coding channels is in the Component Reference, not the Brightscript Reference.
-JT
Only 10 years or so for me, for real programming. I don’t count commodore 64 basic, timex sinclair, or H89 CP/M/Z100 to have been ‘real languages’ - but this brightscript stuff is very very easy/simplistic compared to C++. Maybe you’re more like Einstein who could theorize about the entire universe but couldn’t tie his own shoes. In which case perhaps you could pay someone to ‘train you’ hands on with how this little roku programming does what it’s supposed to do. There’s nothing wrong with asking for help, just how you’re doing it tends to distance people from taking time to assist you IMO.
@renojim – what have I been doing the last 23 years? I’ve been learning and using real programming languages that far excel over brightscript.. plain and simple…
I’ve read and re-read the documentation several different times.. I’ve looked at all the examples… I just got the roku unit from work to take home so now I can try and figure out how to do this ‘side-load’ thing that is referenced here.. but since that’s not in the PDF’s either, that will be trial and error I suppose just like everything else associated with the roku
As for not having any specific questions, I’ve asked a few.. such as why there is no REAL documentation… what the hell all these ro functions are and a few others… But it’s okay, I don’t expect anyone here to answer my questions. Go ahead and keep pushing the PDF’s as the ‘higher power’ which just completely suck..
So, the forums will be done with me. Since the roku online chat is run by idiots, the developers are idiots that can’t support their own language (you haven’t seen the emails/responses I’ve sent/received), and the people here on the forums default to ‘read the pdf’s…’ which again makes you all idiots.
I also never said I couldn’t learn from the PDF’s, but it sure would make it a lot easier of the people who made the PDFs actually included all the functions… if they actually explained what each function is and does.. what the basic syntax is.. and even commented the examples… so instead of several weeks of trial and error I could jump in and have a channel built in a mere 2-3 hours if the documentation is worth a damn… But, after having read the PDF’s over 50 times (every single one of them) over the last 2 weeks I haven’t written a single piece of code because the documentation doesn’t document anything.. I’ve said it before, but this documentation is: here is some code… here is more code.. good luck!
So to all of you who praise brightscript and the idiot people who created I’m really sorry that you live in the delusional world that the documentation is even remotely close to ‘adequate’ what with functions missing from it that are shown in examples but aren’t in the PDFs (even with the lack of a description)…
“jblack199” wrote:
I’ve read and re-read the documentation several different times.. I’ve looked at all the examples… I just got the roku unit from work to take home so now I can try and figure out how to do this ‘side-load’ thing that is referenced here.. but since that’s not in the PDF’s either, that will be trial and error I suppose just like everything else associated with the rokuEither you have not read all of the documentation, or you have and you’re being deliberately obtuse. Because side-loading is definitely referenced in the DeveloperGuide.pdf:> 7.2 Application Installer Page
Development applications are loaded onto the device using a standard web browser. When enabled for development mode the device hosts a web page for installing your application. To access the installer page, do the following:
- From your Roku Streaming Player, navigate to “Roku Player Settings”, “player info” to find the IP address of your box.
- From your development workstation, open a standard web browser and type the following URL:
a. http://A simple search across all the pdfs in the documentation folder(Ctrl-Shift-F on Adobe Reader 10 for Windows) turned this up for me in ~5 seconds.
The same technique can be used for ro components:
For example, here’s a part of the table of contents for the 3.0 beta sdk component reference:
4.2 roAppManager 26
4.3 roPosterScreen 34
4.4 roSpringboardScreen 43
4.5 roVideoScreen 51
4.6 roSlideShow 60
4.7 roSearchScreen 63
4.8 roSearchHistory 67
4.9 roParagraphScreen 68
4.10 roMessageDialog 71
4.11 roOneLineDialog 75
4.12 roCodeRegistrationScreen 76
4.13 roKeyboardScreen 80
4.14 roPinEntryDialog 83
4.15 roAudioPlayer 84
4.16 roMessagePort 88
4.17 roDeviceInfo 88
4.18 roDateTime 89
4.19 roEVPCipher 91
4.20 roEVPDigest 92
4.21 roHMAC 93
4.22 roTimespan 94
4.23 roRegistry 95
4.24 roRegistrySection 96
4.25 roUrlTransfer 97
5.0 Components First Introduced in Firmware v2.6 103
5.1 roImageCanvas 103
5.2 roFontRegistry 106
5.3 roFontMetrics 107
5.4 roSystemLog 108
5.5 roRegex 111
5.6 roPath 114
5.7 roFileSystem 114
5.8 roVideoPlayer 116
3 4/20/2011 © 2009 Roku Inc.
6.0 Components First Introduced in Firmware v2.7 120
6.1 roGridScreen 120
7.0 Components First Introduced in Firmware v2.9 127
7.1 roAudioMetadata 127
7.2 roImageMetadata 128
8.0 Components First Introduced in Firmware v3.0 132
8.1 roSocketAddress 132
8.2 roStreamSocket 132
8.3 roDataGramSocketYou found one extremely poor example of a component not available on a Roku, roGPIOPort, which was explained above as being a component only available in the BrightSign product, which uses the same language. This is definitely something that should be fixed in the documentation. There have been plenty of similarly bad examples given in the php docs you’ve referred to as being an example of a ‘good’ reference. That doesn’t make the rest of the documentation invalid or necessarily inadequate.
I’d also like to touch on your numerous ‘idiot’ comments. You’re violating forum policy by flaming(and/or trolling). Most of the people who’ve attempted to help you in this thread are published channel creators, and are earning income from their channels. Everyone here (with the exception, perhaps, of RokuMarkN) started from the same basic set of documentation and examples, and yet they managed to learn the language and interact with other people learning the language without resorting to insulting each other for not having the answers to their questions. Criticize the docs all you want, I agree whole-heartedly, they absolutely could be improved in multiple ways. But insulting the very people trying to help you is clearly a self-defeating way to go about things.
jblack199, please tell me where you work so I can direct your boss to this discussion and he can decide who the real idiot is. You wouldn’t last a day working for me.
-JT
“gonzotek” wrote:
Everyone here (with the exception, perhaps, of RokuMarkN) started from the same basic set of documentation and examples, and yet they managed to learn the language and interact with other people learning the language without resorting to insulting each other for not having the answers to their questions.
Actually I had no special help with it, I learned Brightscript from the examples and docs, same as everyone else here. I do have access to the source so I have on occasion looked up the code to see how it was handling a particular construct, but I’ve only done that maybe a couple of times.
jblack199, I’m not sure if you’re looking for help, as you’ve only (as far as I can see) asked one question in your voluminous rants about the docs. I’ll answer that question and hope that it will get you started. You said “like the function CreateObject i can figure that out, it creates an object pretty simple.. but what’s the object? is the object defined by the rofunction you pass into it? and what are these rofunctions?” The first parameter to CreateObject is not a function but the name of an object, as a string. The list of valid object names, and the parameters that are valid for each object, is found in sections 10 and 11 of the Brightscript Reference, and sections 4 through 8 of the Component Reference.
–Mark
“jblack199” wrote:
My boss will be disappointed when I tell him to find a fire and die in it if he thinks im going to go through ‘trial and error’ trying to figure out this piece-meal garbage of a language…
Humm…looks like your boss may be looking for a new developer…
@renojim i’ve already showed my boss this thread… nothing has come of that, and he actually agrees with the lack of documentation…
@kc8pql the only thing my boss would find a new developer for, would be to make this roku channel… No real harm there…
Now on with the real questions, since now I’ve got my boss’ roku here at my house so that I can try and learn through trial and error but i’m having one little issue with even getting started…
I hooked my roku up via wired internet directly to my router (roku is on my hdtv which doubles as a computer screen)… I run the connection wizard, and it connects just fine… I run to 192.168.1.1 and login and check to ensure it’s coming up.. and it does.. it shows me the address: 192.168.1.128 (same address shown in the roku player itself)
So according to the DeveloperGuide.pdf, section 7.2 if i go to http://192.168.1.128 in my browser it should take me to a page with an upload screen… However all i get is the ‘Firefox can’t establish a connection to the server at 192.168.1.128’ message in the window… So, what would be blocking that from happening?
There are no security settings in roku screens that I can see that could block the incoming connection. Perhaps it’s a port forwarding issue?
edit: figured that one out… didn’t go through the step in 7.1 to enable the development mode.
Wow…
I wouldn’t say that this is the best documentation available, but hey guys…please stop calling each others IDIOTS!!
LOL
I am learning BrightScript (this is my third day :)) and I do have experience in other languages. So far the language sucks, but it’s quite easy to start coding following the examples, docs and forum posts.
Sorry about my English.
