dbTalk Databases Forums  

Creating script "libraries"

comp.databases.filemaker comp.databases.filemaker


Discuss Creating script "libraries" in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
NScheffey
 
Posts: n/a

Default Creating script "libraries" - 03-07-2007 , 02:51 PM






Hey all-
This question is kind of a stylistic/aesthetic one, rather than a
right/wrong, but here goes. Since the introduction of script
parameters it has become possible to create single script "libraries"
that run different script steps based on the parameter sent to it.
E.g. a Script called "Contact Library" that takes parameters like
"add", "remove", etc., then uses a big If,Else If structure to figure
out what to do.

Now my question: Is this a good practice? Is it making things easier
by centralizing scripts and reducing the total number, or making
things more difficult? What are people's opinions on this?

Thanks,
Nate


Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Creating script "libraries" - 03-07-2007 , 03:14 PM






I did this on one of my projects and, though it makes it easier in the
sense that I only need to go to one script for all my navigational
needs, I have found it more difficult to work within that script because
it is so long and I have to scan through it to find the section I want.
In the end, I think it is easier to have separate scripts for
different functions.

Since you can copy and paste scripts between files, there is little
benefit to having everything in one script versus multiple scripts. And
if FileMaker is ever able to give us the capability to categorize or
otherwise organize script steps, then navigating large collections of
scripts will be made even easier.


NScheffey wrote:
Quote:
Hey all-
This question is kind of a stylistic/aesthetic one, rather than a
right/wrong, but here goes. Since the introduction of script
parameters it has become possible to create single script "libraries"
that run different script steps based on the parameter sent to it.
E.g. a Script called "Contact Library" that takes parameters like
"add", "remove", etc., then uses a big If,Else If structure to figure
out what to do.

Now my question: Is this a good practice? Is it making things easier
by centralizing scripts and reducing the total number, or making
things more difficult? What are people's opinions on this?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc. Los Angeles

FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Creating script "libraries" - 03-07-2007 , 05:49 PM



In article <12uuapbehq9e07b (AT) corp (DOT) supernews.com>, Howard Schlossberg
<howard (AT) antispahm (DOT) fmprosolutions.com> wrote:
Quote:
NScheffey wrote:
Hey all-
This question is kind of a stylistic/aesthetic one, rather than a
right/wrong, but here goes. Since the introduction of script
parameters it has become possible to create single script "libraries"
that run different script steps based on the parameter sent to it.
E.g. a Script called "Contact Library" that takes parameters like
"add", "remove", etc., then uses a big If,Else If structure to figure
out what to do.

Now my question: Is this a good practice? Is it making things easier
by centralizing scripts and reducing the total number, or making
things more difficult? What are people's opinions on this?

I did this on one of my projects and, though it makes it easier in the
sense that I only need to go to one script for all my navigational
needs, I have found it more difficult to work within that script because
it is so long and I have to scan through it to find the section I want.
In the end, I think it is easier to have separate scripts for
different functions.

Since you can copy and paste scripts between files, there is little
benefit to having everything in one script versus multiple scripts. And
if FileMaker is ever able to give us the capability to categorize or
otherwise organize script steps, then navigating large collections of
scripts will be made even easier.
Personally I would stick to separate scripts for separate functions.

A single script with parameters would only really be useful if you have
multiple buttons that run the same basic script.

For example, buttons for "Add", "Delete", etc. are all different
functions so ther's no real point in making them into one script. But
if you've got "letter" buttons that are used to quickly find records
for people with surenames starting with that letter, then having one
script and passing it the appropriate letter makes more sense - at the
very least it's easier then typing and later needing to edit 26
separate scripts.

Technically of course this isn't a new ability. Older versions of
FileMaker may not have parameters / variables, but you can almost as
easily use a Global field for the same purpose, ie. run one script to
set a Global field with the appropriate letter (using the above
example) and then run a secondary script which performs the main Find
function using the letter in the Global field.



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
Grip
 
Posts: n/a

Default Re: Creating script "libraries" - 03-07-2007 , 06:37 PM



On Mar 7, 1:51 pm, "NScheffey" <NSchef... (AT) gmail (DOT) com> wrote:
Quote:
Hey all-
This question is kind of a stylistic/aesthetic one, rather than a
right/wrong, but here goes. Since the introduction of script
parameters it has become possible to create single script "libraries"
that run different script steps based on the parameter sent to it.
E.g. a Script called "Contact Library" that takes parameters like
"add", "remove", etc., then uses a big If,Else If structure to figure
out what to do.

Now my question: Is this a good practice? Is it making things easier
by centralizing scripts and reducing the total number, or making
things more difficult? What are people's opinions on this?

Thanks,
Nate
I don't find Script Parameters very useful and wold never use them in
a situation like this. I do organize my scripts in Scriptmaker using
blank divider and header "scripts" and that keeps me on track.

G



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.