4 Replies Latest reply on Jun 4, 2015 12:06 PM by rtolliver

    Set Field Operators



      Set Field Operators


      Question to the Forum: Can operators be used in a script that finds a range of numbers? 

      SetField [ExampleTable::GlobalFirstNum;">=90"]
      SetField [ExampleTable::GlobalSecondNum;"<=108"]

      Go to Layout ["Layout A"]
      Enter Find Mode [ ]
      Set Field [ANumField ; ExampleTable::GlobalFirstNum & "..." & ExampleTable::GlobalSecondNum]
      Perform Find [ ]


      Set Field [ANumField ; ">="& ExampleTable::GlobalFirstNum & "..." & "<="& ExampleTable::GlobalSecondNum]




        • 1. Re: Set Field Operators

          you can use the inequality operators or the ... ellipsis, but not both in the same find criteria. (The rules for what you can specify manually  and what you can put into a request using set field are the same.)

          What you specify doesn't really make sense to me.

          What do you expect to find with that criteria?

          Do you want to find all records where the field's value is less than or equal to the first number or greater than or equal to the second?

          That can be done, but not with the criteria shown.

          See this thread for series of scripted find examples using Set FIeld: Scripted Find Examples

          • 2. Re: Set Field Operators

            I'm searching for a range of Lengths in a found set. In my post I gave a single example, >=90" and <=108".

            • 3. Re: Set Field Operators

              Which can be done but not with the criteria specified in your example. And apologies, I looked this one over in a hurry and didn't notice that you'd specified values for the global fields.

              There are two basic approaches that will find the records without listing all possible values from 90 - 108 (which even then wouldn't work if you have possible values that are not integers such as 95.6.)

              Method 1. Use two find requests

              Specify >= Minimum value in the first request

              Specify > maximum value in the second request

              Make the second request an "omit" request.

              This can be a scripted or manual find.

              Method 2: Perform a find and then constrain the found set.

              Perform a find with the >= minimum value criteria

              return to find mode, specify <= the max value but then use Constrain Found Set instead of Perform find.

              • 4. Re: Set Field Operators

                Thanks PhilModJunk