Solved

odd behavior of scriptparameter

Posted on 2006-06-14
4
239 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

20 Experts available now in Live!

Get 1:1 Help Now