On Aug 9, 2006, at 3:17 PM, [EMAIL PROTECTED] wrote:
On Aug 09, 2006, at 20:01 UTC, Tommy Single wrote:
Is it possible to develop web applications using REALbasic?
Sure. You can either make a command-line app that acts as a CGI
for a standard web server (e.g. Apache), or make your own custom
web server (which could be a command-line or GUI app).
I thought so too, but there are limitations when using Apache.
Charles Boisseau posted a nice RB CGI framework at his site at URL:
http://www.boisseau.co.uk/code/
His simple example works fine, but when trying to expand the features
to a more robust CGI, I ran into a limitation of the Apache-RB CGI
interaction. Charles helped clarify this problem. If RealBasic
spawns a new thread when processing the CGI, Apache drops the
connection and returns an empty document to the user. Any part of
the RB framework that causes a new thread chokes Apache (on a Mac OS
X). Using pragma #disableBackgroundTasks suppresses new threads
until the CGI returns, but is not totally reliable solution.
Also, I have not been able to get the ConsoleApp to read/write disk
files (an essential part of CGI actions). For example, if I want
to read a file from the disk (say to import an <html> template), the
textInputStream returns nil. If your try to create a new text
document to save your <form> elements to disk, the textOutPutStream
is also nil. When I try to get a folderItem for a known file, the
exists flag is false.
Putting this in the Run event of a Console App
#pragma DisableBackgroundTasks
//return valid header
Print "Content-type: text/html"
Print EndOfLine + EndOfLine
dim f as folderItem
f = Volume(0).child("Users").child("MyUserName").child
("Documents").child("TestFile.txt") //valid
folderItem with f.exists=false
dim tos as textOutputStream = f.CreateTextFile
// tos is nil
if tos = nil then Print "nil output stream"
//yes this is what happens.....and is confirmed by stepping
and viewing the variables
Or even simpler....
f = GetFolderItem("TestFile.txt")
dim tos as textOutputStream =
f.CreateTextFile
//tos is nil
if tos = nil then Print "nil output stream"
//yes this is what happens.....and is confirmed by stepping
and viewing the variables
If I try to get a folderItem for a known disk file, f.exists is false
and I cannot read data from it in the Console App
I have not found a workaround for this, but would like to....
Config: MacBookPro, 2 Gigs RAM, Tiger 10.4.3, RB 2006r3 (and all
recent betas)
Mark Levinson
Hutchinson, KS
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>