When last we left our hero as he was getting to know REALbasic, he was whining about a number of REALbasic's shortcomings. I'm not going to claim REALbasic doesn't have these shortcomings, but after a few more nights of play and some help from the kind folk at the REALbasic listserver, things aren't quite so ugly as they first were.

REALbasic is still missing several key features that it needs before I can call it "mature", but I've nearly solved two main hurdles.

First, lacking string functions -- For heaven's sake, man, just create a module called mdlVBcompat or something similar. I've done that and started up some replacement subs and functions. Unfortunately REALbasic doesn't seem to let you return arrays from functions, so I'm having to work on parameters "ByRef", so to speak, for things like the Split() function. Either way, creating reusable code, even if I have to drag and drop into new apps, is an okay fix.

The constant "vbNewLine" (a new line, no less) was a particularly tough cookie, as the GUI that allows you to define constants (that's right -- it's a GUI that makes code; you can't write code directly when defining constants) only has a single line for your constant value. Nor does it accept "\n" or Chr(13) or the like. Rather, it does accept them, but reads them literally, not as a new line. The trick was to (again, thanks to the REALbasic list, this time the archives) get a newline in BBEdit Lite and *paste* the danged thing into the REALbasic GUI. Voila. Instant newline. Haven't checked to see if that works xplat (or even on OS 9), but if it doesn't I'll just throw in some more Consts (since I can't #ifdef constants through the GUI *sigh*)

Finally there's the slowly rendering textbox. This is a problem, sure enough. The textbox on REALbasic isn't as good as the one in Visual Basic. It's much slower and is in need of quite a bit of optimization (which, from what I gather, it's getting).

Luckily what I was trying to do shouldn't ever feel this issue. My code was whacked. Here's analogous code in VB:

' The wrong way and the way I was doing it.
Private Sub Command1_Click()
Dim i As Integer

Me.RichTextBox1.Text = "bullheaded" & vbNewLine

For i = 1 To 300
Me.RichTextBox1.Text = Me.RichTextBox1.Text & _
"The quick brown fox is tired of jumping." & vbNewLine
End Sub

' The right way (logically), and what works
' even with REALbasic's slow rendering textbox
Private Sub Command2_Click()
Dim i As Integer

Me.RichTextBox1.Text = "seltext" & vbNewLine

For i = 1 To 300
Me.RichTextBox1.SelText =
"The quick brown fox is tired of jumping." _
& vbNewLine

So I was rewriting the string 300 times instead of appending. Idiot. Though my backwards way of doing things shouldn't crash the app, and still performs acceptably quickly in VB, performance is improved quite a bit once I have my head on straight. In sum, though REALbasic doesn't score any maturity points with its Textbox in OS X, neither did my programming skillz. :^D