Søren Dyhr Posted January 9, 2008 Posted January 9, 2008 What do you wish to do with the variable, store the results or...?? --sd
Søren Dyhr Posted January 9, 2008 Posted January 9, 2008 (edited) I'm utterly puzzled here, a developer calling his/her skill level Advanced should be abel to think the following up: Set Variable [ $what; Value:Invoices::CustID ] Enter Find Mode [ ] Set Field [ Invoices::CustID; $what ] Perform Find [ ] If this script is executed in a record will the found set after the run, be all the customers invoices. The result of over generalized is too often stabs in the dark, please descripe the context as well as purpose, next time asking! --sd Edited January 9, 2008 by Guest something daft in the scripting
AudioFreak Posted January 9, 2008 Posted January 9, 2008 Why the go to related step Soren? Seems it's not really needed unless I just need more coffee....lol
IEW Posted January 9, 2008 Author Posted January 9, 2008 It doesnt work. Thats exactly the way I did it. Changed it to a global field and it works. Layoff the personal attacks!
AudioFreak Posted January 9, 2008 Posted January 9, 2008 (edited) How does it not work? What does it do? You could use Script Debugger since you have advanced so you can see what is happening. Edit: I missed the comment about you changing it to a global. Did you change the field to a global or the Variable? Michael Edited January 9, 2008 by Guest
Søren Dyhr Posted January 9, 2008 Posted January 9, 2008 (edited) It doesnt work. Thats exactly the way I did it. Changed it to a global field and it works. The variables are case sensitive so $myVar isn't the same as $Myvar ... similar are $$var different from $var, where the former are global, and the later stops working when the script terminates. Finally can't variables be transfered between files, for this use scriptparameters, and make them survive passing the boundaries by utilizing this technique: http://www.fmforums.com/forum/showpost.php?post/187787/ --sd Edited January 9, 2008 by Guest
IEW Posted January 9, 2008 Author Posted January 9, 2008 Changed it to field global and it works. When it was a $variable I stepped it through and watched it in the the Data Viewer. It never showed up in the watch window; always showed up in the current window. This is what is causing me trouble. Very strange.
bcooney Posted January 9, 2008 Posted January 9, 2008 I'm sure Soren did not mean to attack you personally. He was, as I often do, trying to interpret what your goal was and why you were stumbling given the few details of the original post. If you are an advanced FM dev, finding with a variable is fairly routine, and so he dismissed that as the problem, given your rank. Soren's method works.
David Jondreau Posted January 9, 2008 Posted January 9, 2008 The variables are case sensitive so $myVar isn't the same as $Myvar That's not my experience.
Søren Dyhr Posted January 9, 2008 Posted January 9, 2008 Ahh! Once again David! you are Fermat'ting me again! http://www.fmforums.com/forum/showpost.php?post/277029/ I wonder why I've picked that up, have the DV changed behaviour when we upgraded to fm9 or... So this leaves back the scope to which a variable can survive, the bounderies are script for a single $ and the file for a double ($$), going beyond that, is largely considered bad habit by people drilled with object oriented designs: http://www.fmforums.com/forum/showtopic.php?tid/188219/fromsearch/1/hl/tokerud/tp/0/all/1/ At least something which needs to be approached with restraints, and repairing it with a genuine global field is IMHO even worse! --sd
IEW Posted January 9, 2008 Author Posted January 9, 2008 Just figured it out! Set Variable[$$Find[3]; Value:css::part number] Go To Layout ["List" (css)] Enter Find Mode[] Set Field [css::part number: $$Find[3]] Perform Find[] Line 4 $$Find needed the [3]; you have to add this in in the Specify Calculation. Good old FM! Thanks for all your help.
bcooney Posted January 9, 2008 Posted January 9, 2008 You have a global variable with repetitions? You don't need that. You can change it to a local variable and remove the repetition.
IEW Posted January 9, 2008 Author Posted January 9, 2008 Our part numbers have 3 repetitions; each part can have 3 different numbers. Do I still need the repetitions?
Raybaudi Posted January 9, 2008 Posted January 9, 2008 Thanks for all your help. I think that it was your skill to solve your problem, not the Forum's members
AudioFreak Posted January 9, 2008 Posted January 9, 2008 You have opened up a whole new can of worms. It's generally bad practice to use repeating fields. Without knowing your whole structure it's tough to say how you should have it set up though. In my experience I have found that repeating fields will only make you work more to achieve your goal. For example as soon as you decide you want to sort the repeating field you are stuck. Michael
Søren Dyhr Posted January 9, 2008 Posted January 9, 2008 Do I still need the repetitions? If the partnumber field is a repeating field, couldn't a single request distinguise each of the repeaters from the other, you're doing yourself a favour by having tree different fields, you can always modify 3 request, by the use of: http://www.filemaker.com/help/Script-Steps36.html See the technique here: http://www.filemakermagazine.com/videos/faster-or-search-script.html --sd
comment Posted January 9, 2008 Posted January 9, 2008 Your question is not clear. In general, a repeating FIELD is a single field as far as finding in it. So if you are searching for a value in any repetition of a repeating field, you can enter the value into any repetition in Find mode. I don't see what repetitions of a VARIABLE have to do with this. Perhaps you should elaborate a bit more when posting a question and save us the need to guess.
Søren Dyhr Posted January 10, 2008 Posted January 10, 2008 Barbara and I tried to say the same, apparently without much luck? -sd
IEW Posted January 10, 2008 Author Posted January 10, 2008 Soren: Sometime the light is slow to turn on! And I am sure you have times when your candle does'nt burn to bright. ;>)
Recommended Posts
This topic is 6163 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