fful Posted April 4, 2005 Posted April 4, 2005 Well, I was pretty good with variables in Director, but FMPro has me stumped. After several unfruitful hours, I could use some help. This is a simplified explanation of what I want to do. 1. Go to a record in Browse mode. 2. Set a variable A= to the contents of field "FieldA" 3. Set a variable B =to the contents of field "FieldB" 4. Go into find mode 5. Put variable A into field "FieldC" 6. Put variable B into field "FieldD" 7. Do a find I have tried many possible combinations of Let, Set Field, Evaluate, Get (Script Parameter), Evaluate, but I guess the syntax is just too different from Lingo. The variables can be discarded after the script is run. Can anyone give me a small example script for doing the above? I could probably figure things out from there. Thanks! Frank
RalphL Posted April 4, 2005 Posted April 4, 2005 In FileMaker we use global fields. Define 2 global fields gA & gB 1. Go to a record in Browse mode. 2. Set Field[gA; A] 3. Set Field[gB; B] 4. Go into find mode 5. Set Field[C; gA] 6. Set Field[D; gB] 7. Do a find
fful Posted April 4, 2005 Author Posted April 4, 2005 Thank Ralph, I edited the field names in my little example to make it more clear, but you don't have to retype! I though that FM could use local variables also with Let, ScriptParameter, etc, but I can't make it work. Will try the above, appreciate the assistance. Frank
comment Posted April 4, 2005 Posted April 4, 2005 You could use script parameter for this, with the following limitations: 1. The script parameter is passed to the script when the script is called (by a button or another script). 2. The script parameter cannot be modified by the script itself. 3. There is only one parameter per script - if you need more than one variable, you have to concatenate them and parse them out later.
fful Posted April 4, 2005 Author Posted April 4, 2005 This is for a potentially large database that will be served using FM Server Advanced, with eventual web publishing. I guess the objection I have in this case, from a design standpoint, to global variables is that: 1. If the file is shared, only one client at a time can change the variable, it seems. Not sure what happens when two clients at a time are trying to change this and get it. 2. If you have 10,000 records, it seems that the global is changed for all 10,000. Is there any overhead in this? 3. If the variable is only needed for one local client, for the purpose of structuring a find criteria, why not compute what you need locally, and then send the find request to the server? By using a global variable, you're creating more interaction with the server. I'm coming from Director/Lingo, but the logic seems the same. Please correct me if I'm wrong.... Frank
comment Posted April 4, 2005 Posted April 4, 2005 Some of your issues are discussed here . In general, a global is user-specific, i.e. each user sees his/hers own global values. However, only the host's global values are saved.
RalphL Posted April 4, 2005 Posted April 4, 2005 2. There is little overhead to globals they are not stored in the records. 3. That is what you are doing with the global field. Different progam, different lingo.
fful Posted April 4, 2005 Author Posted April 4, 2005 comment and Ralph, thanks for the quick and useful response and the link to the global discussion, which I have not fully digested yet.... The concensus seems that you don't get a bigger speed hit from using globals than from using multiple parameters, in most client-server environments, so I'll take this route for now. Please correct me if I have misinterpreted this. Thanks, Frank
Recommended Posts
This topic is 7176 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now