Basic work.

I mentioned previously that I’m working on getting up to speed with both VB.Net and REALbasic, and that REALbasic (RB) seems like a more comfortable fit for me. Well, today I was working on actually getting a real program, if a small one, working in RB, and I accomplished that goal. It’s mostly a simplified (if you can believe that) version of my Dice! die-rolling application, without support for custom die types. It’s now working, and able to roll dice and do math and such things. Wooo!

There was actually a lot of work involved, since the application doesn’t just roll dice, but does math as well, so you can add multiple die rolls and bonuses and such all together at once. That meant I spent a lot of time and effort converting my evaluation engine to work in RB. (And that conversion may not be finished; a few places were very clunky because I don’t know how to type cast, of all things; and I haven’t tested all the features.)

I think I’ll continue working on this app to flesh it out more like the VB6 version of Dice!, which will let me work with objects, other windows, and various other things. It’s a nice learning tool, doing this conversion.

There are a number of things that I’m really missing, though:

  • The Debug.Print system of VB, to better follow what’s going on inside the app at times. I don’t know if there’s anything like this yet in RB, or if I’ll end up writing my own to plug into my various future apps. (I cheated around it this time by writing to an extra edit box on my app window.)
  • Being able to do my own indenting. RB does a decent job, but not entirely in my style. I also don’t like not being able to use the Tab key to move my comments one tab-stop off the end of the text I’m commenting next to.
  • Type casting. It has to be possible, but I haven’t figured it out yet. Probably should search through my book.
  • More useful searching in the Help system. (Searching in VB usually brings up tons of utterly useless stuff; in RB it tends to bring up . . . nothing.)
  • More robust If evaluations. Instead of treating anything non-zero as True, I actually have to make sure that I get a valid boolean result, which is annoying.

I’m pretty sure there were some more, but I can’t recall them now.

For the most part, not too bad a day at all.

2 thoughts on “Basic work.

  1. Paul Lefebvre

    1. You’re probably looking for System.DebugLog

    2. The REALbasic code editor does it’s own automatic indenting. There’s no way to turn it off.

    3. Sure, type casting is possible. Just use this syntax: myVar = (myType)origType, which will convert the value origType to the type of myType.

    4. The searching in the language reference is a bit weak. But make sure you are using the 2nd box at the top (which is the search field). The first box is the “lookup” field and it is intended to go directly to an existing help entry: ListBox.Change

    5. REALbasic is very strongly typed, so generally treating any non-zero value as True won’t work. Variants might be a way around that, but you probably shouldn’t try to work around that.

  2. Armin Post author

    Thanks, Paul! I appreciate your taking the time to help me out a bit.

    1. I would prefer something a bit cleaner in output than System.DebugLog and DebugViewer; something capable of indenting levels and multiple line output, with only text I send there. But I will adjust.

    2. Bummer.

    3. Ah, I do actually remember reading something about that somewhere, in my book-reading phase. I should probably find my book and get it onto my desk.

    4. I did figure out the search box thing, after my first few even-more-frustrating searches, and noticing it was set up like the IDE.

    5. I don’t really want to work around the typing (much), but my code tends to be full of things like “If FlagVar AND FlagState then. . .” or “If VarResult then. . .”, and it’s now a bit annoying to have expand on it with an additional comparison and/or parens, after years of doing it the easier way. But, I will adjust.

    On the whole, I’ve had a lot less trouble jumping right into RB than I’ve had with VB.Net.

    Much thanks, again, for the help.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.