A point of clarification please - when to use SUB-SCRIPT parameter

6 messages Options
Embed this post
Permalink
Arnold Palmer

A point of clarification please - when to use SUB-SCRIPT parameter

Reply Threaded More More options
Print post
Permalink
All,

Using FM v6 and Mac OS 10.3.9.

If I may, I need a point of clarification. When should I use the SUB-SCRIPT
parameter within the PERFORM SCRIPT function? (The on-board help is all but
useless.) A simple example of its usage (one with and one without) would be
most appreciated. TIA.

Arnold
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Ibrahim Bittar Torres

Re: A point of clarification please - when to use SUB-SCRIPT parameter

Reply Threaded More More options
Print post
Permalink
Hi Arnold

A sub-script is a script that you run from another script. It's not a  
parameter, although FM6 shows it in a parameter-like way.

Hope this helps.

Saludos

Ibrahim Bittar Torres
Director General
Eikonsys
FileMaker 10 Certified Developer
http://www.eikonsys.com
FileMaker Business Alliance




On 18/10/2009, at 12:20, Arnold Palmer wrote:

> All,
>
> Using FM v6 and Mac OS 10.3.9.
>
> If I may, I need a point of clarification. When should I use the SUB-
> SCRIPT
> parameter within the PERFORM SCRIPT function? (The on-board help is  
> all but
> useless.) A simple example of its usage (one with and one without)  
> would be
> most appreciated. TIA.
>
> Arnold
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Tom Fitch-3

Re: A point of clarification please - when to use SUB-SCRIPT parameter

Reply Threaded More More options
Print post
Permalink
In reply to this post by Arnold Palmer
Picture that you have a Print script that also calls a Log script. But
for some reason you want to call the Print script and not log it --
e.g. you only log when you print confidential info. So you Perform
Script (Print) and uncheck the checkbox so it doesn't call the Log
script. Not a great example, but you get the idea. Anyway, it would be
easier to maintain if you took the Log script out of the Print script
and just called the Log script from the same parent script as the
Print script.

You generally always leave the Perform Sub-script option ON unless you
have a compelling reason not to. Most developers apparently found the
checkbox so confusing that it was removed in versions of FileMaker
after 6. That being the case, you will also create a potential bug if
you have unchecked the checkbox and migrate the solution to a newer
version of FileMaker.

Tom Fitch
FileMaker Certified Developer
Portland, Oregon

On Sun, Oct 18, 2009 at 10:20 AM, Arnold Palmer
<[hidden email]> wrote:
> All,
>
> Using FM v6 and Mac OS 10.3.9.
>
> If I may, I need a point of clarification. When should I use the SUB-SCRIPT
> parameter within the PERFORM SCRIPT function? (The on-board help is all but
> useless.) A simple example of its usage (one with and one without) would be
> most appreciated. TIA.
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Mark Rubenstein

Re: A point of clarification please - when to use SUB-SCRIPT parameter

Reply Threaded More More options
Print post
Permalink
In reply to this post by Arnold Palmer

On Oct 18, 2009, at 12:20 PM, Arnold Palmer wrote:

> All,
>
> Using FM v6 and Mac OS 10.3.9.
>
> If I may, I need a point of clarification. When should I use the SUB-
> SCRIPT
> parameter within the PERFORM SCRIPT function? (The on-board help is  
> all but
> useless.) A simple example of its usage (one with and one without)  
> would be
> most appreciated. TIA.


Arnold;

For what it's worth, I have always used it.
In other words, I have always left it on, which it is by default.
I cannot think of any reason to ever turn it off.
All it means is this:
If the script you are calling calls any other scripts, do you want  
those other scripts to run?
I cannot think of an example where I wouldn't want them to.


Mark Rubenstein
[hidden email]
www.easyaspi.com

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Bob Patin

Re: A point of clarification please - when to use SUB-SCRIPT parameter

Reply Threaded More More options
Print post
Permalink
Several things I consider when deciding whether to create a 2nd script  
or to include steps in the current script:

1) Is there even a remote possibility I'll use the same set of steps  
again in another context?
2) For future mods or repairs, would it make it easier for the  
programmer if a chunk of scripts were placed in their own script?
3) Most importantly, can I write the script using script parameters so  
that it's reusable?

I've seen examples of scripts that seem to use sub-scripts for no  
apparent reason; in my opinion, that makes future edits more difficult  
rather than less.

On the other hand, if you can reuse the same script throughout your  
solution, you'll have tighter code, less chance of error, and easier  
expandability.

One of the first things I would recommend to anyone wanting to write  
more reusable code would be to consider a multiple-parameter function  
or set of functions. It allows your code to be more modular, less hard-
coded, and as a result much more portable.

Bob Patin
Longterm Solutions LLC
P.O. Box 3408
Brentwood, TN 37024
[hidden email]
615-333-6858
http://www.longtermsolutions.com
iChat: bobpatin
Twitter: bobpatin
FileMaker 10 Certified Developer
FileMaker 9 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting

On Oct 18, 2009, at 3:29 PM, Mark Rubenstein wrote:

>> If I may, I need a point of clarification. When should I use the  
>> SUB-SCRIPT
>> parameter within the PERFORM SCRIPT function? (The on-board help is  
>> all but
>> useless.) A simple example of its usage (one with and one without)  
>> would be
>> most appreciated. TIA.
>

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Arnold Palmer

Re: A point of clarification please - when to use SUB-SCRIPT parameter

Reply Threaded More More options
Print post
Permalink
On 18/10/2009 5:07 PM, "Bob Patin" <[hidden email]> wrote:

> Several things I consider when deciding whether to create a 2nd script
> or to include steps in the current script:
>
> 1) Is there even a remote possibility I'll use the same set of steps
> again in another context?
> 2) For future mods or repairs, would it make it easier for the
> programmer if a chunk of scripts were placed in their own script?
> 3) Most importantly, can I write the script using script parameters so
> that it's reusable?
>
> I've seen examples of scripts that seem to use sub-scripts for no
> apparent reason; in my opinion, that makes future edits more difficult
> rather than less.
>
> On the other hand, if you can reuse the same script throughout your
> solution, you'll have tighter code, less chance of error, and easier
> expandability.
>
> One of the first things I would recommend to anyone wanting to write
> more reusable code would be to consider a multiple-parameter function
> or set of functions. It allows your code to be more modular, less hard-
> coded, and as a result much more portable.
>
> Bob Patin


Being an OLD programmer (starting back in the early 70s with BASIC and
FORTRAN) I fully understand the concept of subroutines. I fully agree with
the basic premise of making modules and I use the technique frequently. My
question is really about the use of the SUB-SCRIPT switch. Should it be ON
or OFF when calling the subroutine.


As for confusing code, one of my college classmates never bothered to remove
ANY lines from her programs, she simply put in a GOTO statement I and jumped
to a new section. What a mess!

AND

On 18/10/2009 4:29 PM, "Mark Rubenstein" <[hidden email]> wrote:

>
> Arnold;
>
> For what it's worth, I have always used it.
> In other words, I have always left it on, which it is by default.
> I cannot think of any reason to ever turn it off.
> All it means is this:
> If the script you are calling calls any other scripts, do you want
> those other scripts to run?
> I cannot think of an example where I wouldn't want them to.
>
>
> Mark Rubenstein
> [hidden email]
> www.easyaspi.com

It makes sense to leave the flag on. But then, why in heavens name
would anyone want to call a subscript if you are not going to use it? THAT
is what got me to wondering! Oh, well, our task is to do or die trying!

Arnold


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au