LaRetta Posted August 16, 2006 Posted August 16, 2006 (edited) Hello everyone I have a Custom Value List checkbox with numbers. I am producing a number range according to which values are checked so the range will always produce 1..5 (sorted). This will be used in global variable for searching number ranges (in find script) and not (necessarily) as a field calc. And it may be used for things I haven't even thought of yet. But I wonder if I have over-complicated the calculation or approach? I doubt that I've thought of all possibilities and potential problems with it and would appreciate your ideas. It is a very small file with only one simple calc and checkboxes. Oh. I realize it will break if my VL contained double numbers. This was a concept test only. I would like to consider this approach for other things (as well as double-numbers) etc. I might consider a different delimiter, or Substitution() or ?? But if variables can hold the entire find value, it will save adding a variable (at the least). And I think there are other things it can be used for. Maybe. UPDATE: Okay, I've been taking it further. Of course it breaks on 2-digit but the alpha works a treat as well. But I feel like I'm missing something very simple here. I've replaced the file with the new one ... but only look at the top left first example and toggle the checkboxes to see what I'm talking about. Bottom center is alpha one. Oh, also ... you can see I've done nothing with the double (or using word delimiter) yet. I won't get a chance to work on it again until tomorrow. I hope I get other ideas! LaRetta ValueRange.zip Edited August 16, 2006 by Guest Added Update and then Oh ...
comment Posted August 16, 2006 Posted August 16, 2006 I believe this should work on any value list: Let ( [ sortChecked = FilterValues ( ValueListItems ( Get(FileName) ; "yourValueList" ) ; yourCheckboxField ) ] ; Substitute ( LeftValues ( sortChecked ; 1 ) & ".." & RightValues ( sortChecked ; 1 ) ; ¶ ; "" ) ) Note that the sorting is done by the order of values in "yourValueList". Therefore, if using a custom value list, the values in the list should be sorted (the checkbox fields look pretty weird when they are not, so this benefits the user as well).
LaRetta Posted August 16, 2006 Author Posted August 16, 2006 Thank you! EXACTLY what I was looking for! :yep:
Recommended Posts
This topic is 6736 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