Solved

odd behavior of scriptparameter

Posted on 2006-06-14
4
242 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
ID: 16906091
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
ID: 16906130
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
ID: 16907119
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
ID: 16907243
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…

735 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