dmalone Posted April 18, 2003 Share Posted April 18, 2003 How do you write a script to find all records within a certain range of a value in a field in the current record. Link to comment Share on other sites More sharing options...
Lee Smith Posted April 18, 2003 Share Posted April 18, 2003 Such as? Link to comment Share on other sites More sharing options...
dmalone Posted April 18, 2003 Author Share Posted April 18, 2003 if field (1) in the current record has the value of 4 and field (2) in the current record has the value of 100 i want to find all records that have a value of 2 Link to comment Share on other sites More sharing options...
danjacoby Posted April 18, 2003 Share Posted April 18, 2003 Create two global fields, call 'em gField1 and gField2 SetField (gField1, Field1) SetField (gField2, Field2) Enter Find Mode Set Field (Field1, (gField1 - 2) & "..." " (gField1 + 2) Set Field (Field1, (gField2 - 10) & "..." " (gField2 + 10) Perform Find Additionally, you could create two more global fields, called gRange1 and gRange2, and a layout where these fields exist. Then the script is: SetField (gField1, Field1) SetField (gField2, Field2) GoToLayout[LayoutWithGlobalRangeFields, Pause] Enter Find Mode Set Field (Field1, (gField1 - gRange1) & "..." " (gField1 + gRange1) Set Field (Field1, (gField2 - gRange2) & "..." " (gField2 + gRange2) Perform Find Link to comment Share on other sites More sharing options...
Newbies DonMalone Posted April 19, 2003 Newbies Share Posted April 19, 2003 i cannot make this work Set Field (Field1, (gField1 - 2) & "..." " (gField1 + 2) maybe i don't understand the abreviations it does not accept " Link to comment Share on other sites More sharing options...
cjaeger Posted April 19, 2003 Share Posted April 19, 2003 Change Set Field (Field1, (gField1 - 2) & "..." " (gField1 + 2) to Set Field (Field1, (gField1 - 2) & "..." & (gField1 + 2) If you did this manually, you would enter 2...6 in the field, if valus is 4. This is exactly what Lee's script does. Link to comment Share on other sites More sharing options...
dmalone Posted April 19, 2003 Author Share Posted April 19, 2003 thanx that works Link to comment Share on other sites More sharing options...
danjacoby Posted April 19, 2003 Share Posted April 19, 2003 Wups -- typo on my part. Good catch, cj. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7842 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