Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6163 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (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 by Guest
something daft in the scripting
Posted

It doesnt work. Thats exactly the way I did it.

Changed it to a global field and it works.

Layoff the personal attacks!

Posted (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 by Guest
Posted (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 by Guest
Posted

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.

Posted

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.

Posted

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

Posted

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.

Posted

You have a global variable with repetitions? You don't need that. You can change it to a local variable and remove the repetition.

Posted

Our part numbers have 3 repetitions; each part can have 3 different numbers.

Do I still need the repetitions?

Posted

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

Posted

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

Posted

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.

Posted

Soren:

Sometime the light is slow to turn on! And I am sure you have times when your candle does'nt burn to bright. ;>)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.