This is why I love the forums, always good for a challenge! So the key here is Aliases:
This will allow you to set the weights of each check box. I used variables Check1, Check2, ..., Check5 with the weights 1,2,3,4,5. So for the total box I used the input formula:
$Add($Add($Add($Add(%Check1(1=1, 0=0)%,%Check2(1=2, 0=0)%),%Check3(1=3, 0=0)%),%Check4(1=4, 0=0)%),%Check5(1=5, 0=0)%)
And for the max formula I had to get a bit tricky. I used the string function $Left to take the first character in a string composed of weights, but instead of 0 for unchecked boxes I used the empty string. This will work as long as weights don't exceed 1 character.
$Left(%check5(1=5, 0=)%%check4(1=4, 0=)%%check3(1=3, 0=)%%check2(1=2, 0=)%%check1(1=1, 0=)%,1)
If you need 2 characters (we'll say there's a check10 for example) you can add that like so:
$Left(%check10(1=10, 0=)%$Left(%check5(1=5, 0=)%%check4(1=4, 0=)%%check3(1=3, 0=)%%check2(1=2, 0=)%%check1(1=1, 0=)%,1),2)
I've attached an example card
CheckSumCard.cex.zip 1.1 KB
Charley you're on fire - that's the second question you helped me solve today!
Using the left function with aliases is a pretty elegant solution.
Not bad at all. I thought for sure I was going to have to turn to VB for this one.
Haha thanks, I've been at this for a while so it's nice when I see something I haven't thought of before
In that case, maybe you can help me out with the next stumbling block I just ran into.
The input formula works great when it's used to populate a variable in an edit box on a file card.
I'm trying to use this on a template card - the score will be used to populate a different field on the file card for new file created.
I don't want the user to see the score, so I was thinking I would just construct the score using an input formula for a template variable, but it seems input formula is not an option for template variables. I think the next best option would be to make the edit box invisible, but I don't see how to do that either.
Got any suggestions for that?
Charley, you've been a ton of help.
However, looks like my original idea of using a template at all may be a total bust.
There doesn't seem to be any way to copy a variable from the template card to the new file's card.
e.g. I have an editbox on the template card tied to variable "ScoreMax" that is populated by your very handy MAX value input formula.
In the template editor, I have no way to tell it to copy this value. I can only copy values to the new file's data card from template variables.
However on the template variable there doesn't seem to be any way to set it's value to anything from the card. Only environmental variables or prompt the user. I'm going to start a new question on this, as you've already answered my original question here.
I DON'T RECOMMEND DOING THIS.
Scroll down through the rest of thread for reasons why.
Just to follow up on this, I found an even better way to completely hide the control without leaving an empty tab on the screen.
I just used control logic and set it up to hide the control based on for Text contains <anything> OR Text does not contain <anything>.
Be careful when using this with input formulas, I've seen them not work in the past when the field is hidden using control logic.
I hate EPDM so much some times.
There is always some caveat to every single function in this stupid poorly written software.
Workaround after workaround after workaround - and then your workarounds need workarounds. And then those workarounds will only work if the stars are aligned just right and you spin around in the mirror 3 times and say the right incantations to the EPDM gods.
I've said it before and I'll say it again - I've used BETA versions of software that worked more consistently and predictably than this. For the cost of this software, it is infuriating how buggy it is. Totally unacceptable.
I don't mean to ramble and complain, I just hope when people are shopping around for this software they might come across these posts and it might sway them away from it.
What I've done in the past to hide controls without using control logic is to make their height 0. Of course, you have to remember where it is if you need to edit it.
Also, I've occasionally gotten done editing something else on a card and found that the height had magically increased. Just have to check that when saving the card.