Solved

odd behavior of scriptparameter

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FM Exporting Images and ask for destination folder 1 176
FileMaker Pro Table Relationships Issue 7 278
Filemaker import xml 3 169
change filemaker server web direct port 1 153
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…
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 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