--- Alan wrote:

> Is there a more efficient way of implementing subroutines better
> than what I described?

Personally I also use labels and the method you have described for use
as subroutines.

It is possible to call a subroutine without knowing the name of the
script, using this syntax:

[EMAIL PROTECTED]

The absence of a script name between the . and the @ tells PowerPro to
look in the currently running script for that label.

If there is information that I would like to pass to the subroutine
but I do not wish to store it in a static variable, then I will pass
it as an argument:

[EMAIL PROTECTED]("Argument 1", "Argument 2")

which then becomes available to my subroutine in the form of Arg(1),
Arg(2), etc.

Subroutines are particularly useful when for example, you wish to
perform an action on a file through File.AllFiles() that is more
complex than one command, like filtering or conditional inclusion.

In an instance like this, a call to a subroutine is fantastic:

File.AllFiles("*.jpg", "[EMAIL PROTECTED](\"|\")")
Quit

@MySubroutine
Static ListOfSpecialJPEGs
Local File = Arg(1)
Local SpecialInformation = MyPlugin.SomeAttribute(File)
If(SpecialInformation = "Ooh")
    ListOfSpecialJPEGs = ListOfSpecialJPEGs ++ File ++ "\n"
Quit

My personal belief is that with subroutines in the picture, no one
need ever use GoSub/Return type functionality again�� indeed, I
believe that subroutine functionality was designed to supersede it.

-- 

Alex Peters / Melbourne, Australia
PowerPro v3.8.21 / Windows XP



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to