I am working on a Saga Edition character sheet (this is helpful if you know what that is). I pieced together code from other places and thought it should work - I'm getting a syntax error in the oddest place and I don't know why it isn't working. Basically I have several fields being added together. There are two check boxes that if clicked should have a value of 5, if not a value of 0. There is one check box that if clicked should change the formula from an addition scenario to just using a different value on the sheet - that field is called "UTF". Below is the code. I'm trying really hard to learn as I go by learning from other code I find - but it's slow and I usually can't find my errors.
Ron McLeod wrote:I can't see how that line is going to work if A and b and numbers and the other variables are strings.
It would "work" but perhaps not in the way that Jonathan expects. The 5 + 0 would be operated on first as an integer addition, NOT String concatenation. Then all the other '+' operations are Concatenation because in all cases one of the arguments is a String. So...
"5somethingsomething elseyet something else"
It should be
All variables should be lower case.
I made that change and then the addition worked for the two buttons, but not for C, D, or E - they are NOT being included.
So the first issue is getting the C, D, and E to be added too.
Now the second issue is when the button is pushed that should use Formula Z, it doesn't work. Thanks for the help so far - you guys rock.
It must be Java Syntax - I'm doing everything in Adobe Pro PDF software.
The get field command for UTF is grabbing a number that is also calculated using almost identical java; however it doesn't work correctly - but it does have a value in it for now so I can see that it isn't grabbing that value.
posted 1 month ago
Carey Brown wrote:lines 1-6 generate a value in X but X isn't used until line 10. What if you've done all those calculations and ended up at line 13. All that work would have been for naught. Ditto for Z.
In the game, your skill value is either calculated from a series of numbers or if you have a special ability as a Jedi you can instead use your Use the Force rating INSTEAD of the skill. So basically, I need the regular math to work for most situations and then the "override" button for when you aren't really calculating the skill normally but are instead using a different skill's value instead. So yes, all the beginning work could be for nothing if you have the ability to override the normal skill calculation. For me it's not for nothing because this is the way I need it to work.
posted 1 month ago
I now changed the code to this:
Now everything works!!! I really want to tahank you for your answers and time. This is something I would have struggled with for days and now I know how to do it! I'm just really glad I figured out the pieces you guys hadn't yet and can't think you enough for all the help. I really enjoy learning how to do this kind of stuff, especially when it is a challenge for me.