dbTalk Databases Forums  

[HLP] New to FM:

comp.databases.filemaker comp.databases.filemaker


Discuss [HLP] New to FM: in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Matt Wills
 
Posts: n/a

Default Re: [HLP] New to FM: - 09-28-2005 , 04:06 AM






Fjordur wrote on (9/28/2005):

Quote:
"Matt Wills" <I'm (AT) Witz (DOT) end> wrote in message
news:53a_e.11242$L15.2580 (AT) trndny01 (DOT) ..
Scripting between files is a simple matter of using the Perform Script
script step, in which you select "External Script", identifying the
other
file and which script to run. The destination script has to be there,
first, though.
OK,I tried that but could'nt find how to pass parameters from one script
to
the other.

Passing parameters doesn't happen natively until FM7.

The workaround: Create global fields as necessary to receive your
parameters using the Set Field script step. With relationships existing
between files, you can have a script in one file set a g.Field value in a
different file. You can do that in either direction (from or to the active
file).

I tried that,and of course it works fine,thanks.

One question: I designed a script to create tickets from a ticketSheet
(these are 2 different files, thus 2 different scripts as you suggested).
The ticket script needs to know the ticketSheetID,of course (1 to many
relationship). Which of the following is best practice:
1) the master script in ticketSheet puts the ticketSheetID into a global
currentTicketSheetID field in ticketSheet before it calls the script in
file
ticket; then the script in ticket goes get the global of file ticketSheet
or
2) the script in ticketSheet puts the ticketSheetID into a global
currentTicketSheetID field in ticket before it calls the script in file
ticket; then the script in ticket gets the global of file ticket
In one word: put the global(s) in master file or in slave file? I can't see
any reason to choose one or the other.
Correct. It doesn't really make any difference where you put the globals,
coming down to a matter of preference for purposes of design clarity. Down
the road, appropriate names may be more important to you down than where
they're located.

Matt


Reply With Quote
  #12  
Old   
Fjordur
 
Posts: n/a

Default Re: New to FM: - 09-29-2005 , 06:16 AM






"FP" <a (AT) pottnerconsulting (DOT) ca> wrote

Quote:
Since your scripts are only transferring data from 1 file to another
you could set a global in the Main file from 1 script and read it from
the second script, this way you can reuse the globals and don't end up
cluttering up your files with globals.
Interesting technique, thanks.

Any good book on FM programming tips of that sort?

Quote:
The only issue here you should be aware of is that if the found count
in the Ticket file is 0 and your trying to read related data from the
Main file through the above mentioned relationship, you won't get any
results because the relationship is not valid until you have some
records.
I see... thanks for warning!
That's the kind of potential bug that'd be time consuming to find!
--
Fjordur




Reply With Quote
  #13  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: New to FM: - 09-29-2005 , 08:25 AM



Not a book, but a site :
www.databasepros.com/
from John Mark Osborne
with thousands of tips.
Remi-Noel


"Fjordur" <Fjordur (AT) free (DOT) fr> a écrit
Quote:
"FP" <a (AT) pottnerconsulting (DOT) ca> wrote in message
....
Since your scripts are only transferring data from 1 file to another
you could set a global in the Main file from 1 script and read it
from
the second script, this way you can reuse the globals and don't end
up
cluttering up your files with globals.
Interesting technique, thanks.

Any good book on FM programming tips of that sort?

The only issue here you should be aware of is that if the found count
in the Ticket file is 0 and your trying to read related data from the
Main file through the above mentioned relationship, you won't get any
results because the relationship is not valid until you have some
records.
I see... thanks for warning!
That's the kind of potential bug that'd be time consuming to find!
--
Fjordur





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.