Quick Tips

  This section is designed to give you super-quick insights as to how to improve the way you use RB. Unlike the Tips section, these tips are super-short, and don't come with lots of screenshots and a tutorial.

1
   Remember, pressing Option-Tab when a window is selected in the project window opens up the code editor for it—without you having to open the actual window. Pressing Option-Tab when nothing in a window is selected makes the code editor open without anything expanded (often a useful tool).

2

  When making a control array, always make the first item in the array, give it a descriptive name, and an index of zero. Then, copy and paste for new items in the array. Don't option-drag, as this will create controls that aren't in the array.

3

  If you have an variable of type object, and you know that it's a control, you still can't access the properties of that variable that are specific to the control. This is because the variable is an object, and not a control. However, you can make it a control (for this example, it's a PushButton) using typecasting. If the variable is obj, then this changes its caption: PushButton(obj).caption="Hello!"

4

  If you have a multiple column listbox, and you're adding rows, you probably endlessly type listbox.listcount-1. However, a listbox's LastIndex property always returns the last item's actual index. I never knew about this, and I suspect that I'm not the only one...

5

  When you make an application, always remember to add an Application class to it. Be sure to put code in the NewDocument, and OpenDocument sections, or your application won't meet Apple's requirements (the required AppleScript suite). Also, don't forget to give your app a creator code before compiling.