On Aug 07, 2006, at 9:59 PM, Robert Poland wrote:

Hi,

RB 5.5.4. Forgive me but I feel the need for a goto statement.

I have a calculate, Clear and a Send pushbuttonn. I want to have a gosub at the start of the send routine and a goto at the end of the clear routine to be sure that calculate has been done. One work around would be to trap this with an error message box but that seems like the hard way.

After a lot of looking I have added to the end of the "Clear" routine the command "goto calculatecode". And at the start of the "Send routine" I have added the line gosub calculatecode. And at the start of the Calculate routine I have added the line "calculatecode: // label to jump to".

Now when I run the formally working program I get the error
"Internal compiler error in window1.Clear_Button: Dim Me As Pushbutton".

Trying gosub in place of goto gets the error "This method or property does not exist".

I've looked all over the web and my book "REALbasic Cross Platform Application Development". Obviously I'm missing something here.

Where else can I go to find the correct way to do this?

Skip the GOSUB and GOTO

In send make sure Calculate has been done by writing

        Calculate

which causes that routine (Calculate) to run (assuming Calculate requires no parameters)

Same at the end of Clear

GOSUB is not used any more, you just use the name of the method.

GOTO is mostly never required and should be avoided in 99.9% of all cases where you think you need it.
_______________________________________________
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>

Reply via email to