RealBasic codeing help

Orbit

MacMan
hey
how do you use the goto command in rb
i want it so when the login button is clicked it goes to another window

whats the easiest way? :cool:
 
Well, most programmers will tell you to eschew the goto command entirely.

If you're certain that what you want to do can't be done any other way, goto can be checked out in REALbasic's online reference (command-1) by searching for goto

It will tell you this:

Code:
If checkbox1.value then
 GOTO myCode
End If
//Return used to keep RB from executing the labelled statement anyway
Return 
myCode: //label to jump to
MsgBox "Unstructured programming is bad"

Check out the example message at the end. :D

-- Steve
 
This is VB, but RB should have a similar option.
In your handler for the button click:
otherwindow.show

should work.

GOTO's are a sloppy way of programming. Try using the above first if you can.

If the window is already showing there should be something like otherwindow.setfocus
 
Never ever use GOTO. It is not meant to be used in object-oriented programming languages; there is always a better way. They also become cumbersome once you get more than one in the same chunk of code... or worse yet a GOTO that receives another GOTO.

This is simply a suggestion from an old RB hand: learn cocoa. I am and its wonderful. Some concepts are difficult but a free C tutorial and the Hillegass book and you'll be on your way.
 
Back
Top