Stuart Taylor Posted March 15, 2008 Posted March 15, 2008 Am i correct in thinking that you can not pass variables between Files? If so anyone got any great techniques other than global fields in order to get around this? best Stuart
mr_vodka Posted March 15, 2008 Posted March 15, 2008 (edited) Stuart, you can pass data via script parameters to another file. When I need to pass multiple parameters, I usually send a let statment as a STRING. Then I use Evaluate in the other file and voila all the variables from file 1 can now be used in file 2. Most of the time I just use local variables. Here is an example. Its not a realistic situation and its not that pretty but it does its job. parameters.zip Edited March 15, 2008 by Guest Added sample
Stuart Taylor Posted March 15, 2008 Author Posted March 15, 2008 Hey Mr Vodka, That's A really really great technique. I have modified it to be dynamic (so i will only ever need one script) and also to allow it to be applied to multiple tables in file B. Thanks so much, best Stuart PS i am drinking Vodka tonic tonight :beer: parameters.zip
The Shadow Posted March 15, 2008 Posted March 15, 2008 That is a nice technique, but I think it will cause you trouble if the variables you're passing include a double-quote in their data. Changing the passing calculation to: "Let ( [ $var1 = " & Quote($var1) & "; $var2 = " & Quote($var2) & "]; "" )" instead would fix that issue, as this problem is the reason the Quote() function exists.
Søren Dyhr Posted March 15, 2008 Posted March 15, 2008 But nowhere a new discovery! http://www.fmforums.com/forum/showpost.php?post/187787/ --sd
Stuart Taylor Posted March 15, 2008 Author Posted March 15, 2008 (edited) Hey Shadow, Thanks for the refinement. I forgot about the Quote() function. Soren, This was NOT an exercise in originality but a request for anyone who KNEW of ANY techniques for which i thank the contributers as my issue is now resolved. Originality is not the same as functionality, this was a request not an example file post. The post you linked to was an element included in the solution and would not have passed a variable to a second file as Mr Vodka demonstrated. The discussion which includes Comments technique is simply a refinement and will im sure stop me running into further issues in the future. Thanks Mr Vodka, thanks The Shadow. best Stuart Edited March 15, 2008 by Guest
fabriceN Posted March 15, 2008 Posted March 15, 2008 (edited) Sorry, didn't take the time look into this (I will certainly do), but here is the technique we use internally. I think the CFs in the example are not up to date, but can be found on Brian Dunning's web site. VariablesLog : http://www.bh-a.com/downloads_1.1.html#DL03 HTH Edited March 15, 2008 by Guest
Recommended Posts
This topic is 6095 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