GOTO Equivalent in Rev?

xavier.bury at clearstream.com xavier.bury at clearstream.com
Wed Feb 15 07:34:57 EST 2006


it's not good practice but for the fun of it...

function myfunction p1, p2, goto
if goto is empty then
 
  else if goto is 10 then
     return myfunction(p1, p2, 20)    <-- oh, a goto statement!
 else if goto is 20 then
.
.
.
.
end myfunction

cheers
Xavier


use-revolution-bounces at lists.runrev.com wrote on 15.02.2006 12:58:16:

> Hi,
> 
> I don't understand why you would want to use GOTO anyway, but no I 
> don't think there is an equivalent in RunRev. Instead take a look at 
> defining a function or two. Functions are much more powerful, less 
> likely to cause problems and they make the code much easier to read. 
> Here is an example
> 
> function myCommonCode
> 
> -- do common code here
> 
> end myCommonCode
> 
> 
> Then in the handlers where you want to perform the common code, do:
> 
> get myCommonCode()
> 
> You can also pass parameters to functions and have functions return a 
> value, they work just like the functions built-in RunRev.
> 
> 
> Hope this helps
> Dave
> 
> 
> On 14 Feb 2006, at 21:24, Garrett Hylltun wrote:
> 
> > Is there a goto equivalent in Rev?
> >
> > I have a popup menu, button bar and menu bar, all of which offer 
> > the same functions, cut, copy, paste etc.  I don't want to have 
> > separate code for each of the related handlers.  I want the copy 
> > button, copy menu entry and copy popup menu entry to all use just 
> > one handler (per say).
> >
> > Thanks,
> > -Garrett
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your 
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution



-----------------------------------------
To make communications with Clearstream easier, Clearstream has
recently changed the email address format to conform with industry
standards. The new format is 'firstname.familyname at clearstream.com'.

Visit us at http://www.clearstream.com

IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER



More information about the use-livecode mailing list