Thanks Ross, Chad and Mikhail,

All great and helpful posts.

Thanks specifically to Ross for confirming that my best practice is not
nuts, but something others do. Also thanks for passing along some good
pointers on doing so.

Thanks to Chad for confirming the reasons why, clearly, the new paradigm is
more robust than FM6 and that to a great extent the right answer to my
little annoyance is "get over it" :-).

And thanks to Mikhail for a really great tip -- grouping scripts by the
table they act on, very good; along with some other excellent best practices
to emulate.

I guess it is just my nature that when I encounter a need for a "best
practice" used by developers I see that as an opportunity to offer a new
enhancement by the folks in corporate.

Heck, probably most of us used to group our scripts by way of one step
"ExitScript()" scripts bracketing our script "groups" and named accordingly
-- I like FM's Script Groups better. Probably most of us used to insert
Left("This is my FileMaker comment",0) in some places -- I like FM's
allowing the use of //line comments or /*block comments*/ better. Or, my
favorite, probably most of us for ten buttons runnng the same logic for ten
different parameters would write 10 scripts named precisely that immediately
placed the Current(ScriptName) in a global and then immediately called the
universal subscript, and  in the universal subscript that global was
immediately parsed for the imbedded parameter(s) --  I like FM's script
parameter assigned on the layout better. Didn't Troi even write a plugin to
create a destroy globals on the fly before $$globalvariables were allowed so
maybe Troi are the only ones that are sad to see that advance? :-) (I am
sure they are great folks that welcomed -- maybe even assisted with -- that
enhancement.)

And I can't resist, from Mikhail's great idea, the Wishlist item that maybe
FM9.next could offer "script tags" as well, allowing a many-to-many tagging
system to augment the node-structured grouping now. So like Mikhails great
idea, you can tag a script by the table it acts on, but where a group of
scripts act together on one feature you can also tag them by that feature
especially since, as Mikhail points out, you often have to work on many
tables for one overall feature so without this tagging it would be
impossible to truly group by table *and* by feature group in all
circumstances.

Thanks again for your great posts, and thanks to all for being patient with
someone such as myself who is belatedly going through the growing pains that
you all went through a long time ago.

All the best,
Brad
On Tue, Jun 24, 2008 at 9:04 AM, Mikhail Edoshin <[EMAIL PROTECTED]> wrote:

> Hi Brad,
>
> I think I understand what you mean. I myself learned to a) never write a
> script that works with two table occurrences at once and b) group scripts by
> the table occurrence they operate with. To work with related records I
> normally establish a found set and then 'ask' as script from the appropriate
> group to do something with that found set. That is if I have Invoice and
> Invoice Lines and want to, say, print an invoice (which I do from Invoice
> Lines), my scripts look like that:
>
> Invoice: print
> --------------
> Perform Script[ - Begin script ]
> #
> Perform Script[ - Invoice: isolate invoice lines ]
> Perform Script[ - Found invoice lines: print as invoice ]
> #
> Perform Script[ - End script ]
>
> - Invoice: isolate invoice lines
> --------------------------------
> Go to Related Record[ Invoice Line, Show, Using layout: Invoice Line ]
> Go to Layout[ original layout ]
>
> Note that this script, which belongs to the Invoice table, temporarily
> leaves whatever Invoice layout it happens to be on, but immediately returns
> back to it. This is the main principle of all inter-table scripts: they
> change layouts as necessary, but when they ready, they return back to the
> original layout. In this case the script purpose is to isolate all related
> records and it's completed with one step, so it returns immediately.
> Sometimes it takes a bit longer:
>
> - Found invoice lines: print as invoice
> ---------------------------------------
> Go to Layout[ Invoice Line: Invoice ]
> #
> Page Setup[ Restore, No dialog ]
> Print[ Restore ]
> #
> Go to Layout[ original layout ]
>
> The idea is that when I write a script and call a subscript, I'm sure that
> after it returns, the main script stays on the same layout. So in most
> scripts I need to get to the correct layout once, maybe in the beginning and
> then no matter how many subscripts I call, I know the layout stays same.
>
> Some scripts are exceptions, of course, e.g. navigation scripts that are
> meant to change layouts, but their actions are mostly evident and they are
> mostly called in the end of the script.
>
> The '- Begin script' subscript includes the Freeze Window[] script step, so
> all the layout changes are not noticeable. Only if I open new windows in the
> process I need to worry about which layout I'm on; otherwise I can do nearly
> everything (including custom dialogs, mode changes, AppleScript, etc.) and
> be sure the only thing the user sees is the original layout.
>
>
> Take care,
> --
> Mikhail Edoshin
> Information Analyst
> Skeleton Key
>
> [EMAIL PROTECTED]
>



-- 
Sincerely,
Brad

Reply via email to