Solved

odd behavior of scriptparameter

Posted on 2006-06-14
4
238 Views
Last Modified: 2010-04-27
i have fm8. i have a button that executes a script that opens another layout with the scriptparameter of "legal".
then i execute another script to return to the original layout with the command of
if [get(scriptparameter)="legal"
   goto layout["legal"(legal)]
else goto layout["detail"(detail)]
end if
but it does not return to the legal layout. with debug on it shows that the if test is false

if i put a set command on a global field as the last command line in the first script. it sets the global field correctly
but when i put it as the first command line before the if statement in the second script it does not set the global field correctly

what could be my problem
0
Comment
Question by:kauakea
  • 2
4 Comments
 
LVL 19

Assisted Solution

by:billmercer
billmercer earned 200 total points
Comment Utility
When and how are you specifying the script parameter?

When a script calls another one with a parameter, the value of the script parameter is going to be whatever value was passed to the second script by the first one AT THAT TIME, and that value will stay the same until the script ends.

If you're basing the script parameter on the global field, the script parameter will be whatever the value of the global field was at the
moment the script was called. Changing the global field after that won't affect the script parameter. Frankly, it would be pointless if it did, that would defeat the whole purpose of script parameters.

0
 

Author Comment

by:kauakea
Comment Utility
actually i was passing the scriptparameter on to a global field as a type of test. it showed me that the scriptparameter was set correctly as it left the first script but not picked up by the second script
0
 
LVL 28

Accepted Solution

by:
lesouef earned 300 total points
Comment Utility
it is not supposed to be picked up by the sub-script; if you wanna have this, you need to call the second one by specifying again the script parameter of the parent script; that is roughly:
run script (subscriptname ; get (scriptparameter))
this will pass the argument of the current script to the script it spawns.
in other words, script parameters (should be called arguments in fact) are not recursive (when a script calls a script)
0
 

Author Comment

by:kauakea
Comment Utility
i see, i was confused... i have used the scriptparameter before, but always in the script that it was set for. never for a second script. thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now