|
Post by turbov21 on Oct 11, 2007 13:06:31 GMT -5
There are a couple of steps to this, so it's not completely working just yet, but I think this is a first step toward offering a hosting service for Run BASIC programs using Run BASIC... Uh, anyway! For the program Stargirl: 1. Go to your Run BASIC Personal directory (C:\rbp) and create a directory called "Stargirl_project" -- this has to be done manually, because mkdir() has a bug. 2. Paste the following code into a new project and run it: open "C:\rbp\Stargirl_project\Stargirl.bas" for output as #1
print #1, "for x = 1 to 5" print #1, "print ""Stargirl rocks!""" print #1, "next x"
close #1
print "Created: Stargirl.bas"
open "C:\rbp\Stargirl_project\workingversion.xml" for output as #2
print #2, "<projectWorkingVersion>" print #2, "<name>Stargirl</name>" print #2, "<version>unversioned</version>" print #2, "<fromVersion>unversioned</fromVersion>" print #2, "<comment></comment>" print #2, "<hasChanges>false</hasChanges>" print #2, "<iconFullPath></iconFullPath>" print #2, "<resources>" print #2, "</resources>" print #2, "<deployPath></deployPath>" print #2, "</projectWorkingVersion>"
close #2
print "Created: workingversion.xml" 3. Go and Publish the "Stargirl" program, you may or may not need to log out for it to show up. 4. Go to: http://localhost:8008/seaside/go/runbasicpersonal?app=StargirlYou should see "Stargirl rocks!" printed five times. Once mkdir() works all we'd need is a programmatic way to set a project as published or not, and it'd be pretty simple to write a RB Hosting interface.
|
|
Chris Iverson
Junior Member
There are many worlds, but they all share the same sky. One sky, one destiny.
Posts: 73
|
Post by Chris Iverson on Oct 11, 2007 17:26:39 GMT -5
Well, to Publish an app, you just add it to the prefs.xml file. The problem is that RB doesn't recognize this change as it has loaded all the data from the file already, so you need to restart it. Publishing works from within the RB Interface because it automatically reloads the file, I think.
|
|
|
Post by turbov21 on Oct 11, 2007 17:33:21 GMT -5
Well, to Publish an app, you just add it to the prefs.xml file. The problem is that RB doesn't recognize this change as it has loaded all the data from the file already, so you need to restart it. Publishing works from within the RB Interface because it automatically reloads the file, I think. Interestingly enough, you can call subprograms that aren't published. So, in theory, once mkdir() works, it would be possible to let outside people create modules, but they would then need an interface (input works) to call them. I'm thinking it might also be possible to build a Perl script that could login and navigate to the Publish page, that way you could fix the RB hosting program to call the script whenever someone added a new program, and it would go publish it.
|
|
Chris Iverson
Junior Member
There are many worlds, but they all share the same sky. One sky, one destiny.
Posts: 73
|
Post by Chris Iverson on Oct 11, 2007 17:35:08 GMT -5
Of course, you'd have to find a way to run the script server-side, as it probably wouldn't be a good idea to show the general public how to get into your control panel
|
|
|
Post by carlgundel on Oct 11, 2007 17:36:37 GMT -5
Well, to Publish an app, you just add it to the prefs.xml file. The problem is that RB doesn't recognize this change as it has loaded all the data from the file already, so you need to restart it. That bug is already fixed for the next release. -Carl
|
|
Chris Iverson
Junior Member
There are many worlds, but they all share the same sky. One sky, one destiny.
Posts: 73
|
Post by Chris Iverson on Oct 11, 2007 18:01:52 GMT -5
That bug is already fixed for the next release. -Carl Sweet! Guess we will be able to dynamically create RB programs.
|
|