You might create a "range".
[ myvalue = 100 // this could be supplied as a parameter in a custom function, perhaps
; mypercent = .50 // this is 50% & the percent could also be passed
; lower = myvalue * mypercent
; upper = myvalue * ( 1+ mypercent )
; result = lower & "..." & upper
]; result // values to be returned as TEXT
Then use the result in a scripted find.
Use the range operator, e.g. in a script:
Enter Find Mode [ no pause ]
# [ yourGlobalField contains a number ]
Set Field [ YourTable::yourNumberField ; Let ( n = YourTable::yourGlobalField ; n * .5 & ".." & n * 1.5 ]
Set Error Capture [ on ]
Perform Find [ no restore ]
Manually it works the same, except you don't use quotes and must calculate the bounds yourself …
Thanks very much beverly,
Please bear with me, not having any experience in the product and the last time I did any coding was in 1976 in Ditran.
Where would I be entering the information? Is this in a script and if so is there a tutorial I could look at so as not to waste your time in getting this set up?
I would script a find.
Where are you getting the 'mid-value'? where are you getting the percent? I might use global fields to enter those values (which would be session/user specific)
Then I would take those values, and put into a script.
Enter Find mode
Set field ( myField ; ... here is where the Let() is used ) // instead of the values hard coded, you can use the global fields
(and I believe erolst had similar answer)