Colin Keefe Posted June 18, 2010 Posted June 18, 2010 Okay, Robin, one of my colleagues, pointed this one out to me. I’ve never run across it before, because…because I’m perfect, and never mistype in the calc engine! Yeah…yeah, that’s it. Anyway, to reproduce: 1.open up the calc engine (Data Viewer will do) 2. Add an expression to the Watch pane, and copy/paste this into the calc dialog: $test $test $test $test $test $test $test 3. Click on Monitor 4. Scratch your head in befuddlement. You’d think FM would bark once you try to commit this expression, since there aren’t any operators…but no. I’ve monkeyed with the contents of the variable to see if anything useful can be done with this (i.e. there’s an obscure reason for it), but nope - tried “1 +”, “test &” etc, putting operators in the string to see if something interesting might come of it. Anyway. Odd. Any ideas or thoughts about this? Am I missing something obvious?
Raybaudi Posted June 18, 2010 Posted June 18, 2010 Hi Colin I think that there is no error because an $var ( and an $$var ) can be named with multiple words. So: $test this test <-- legal variable $test $ test <-- legal variable $test $test <-- legal variable Note that the last two variables can be definited in many ways but NOT with Set Variable [ ] So in your example there is [color:red]ONLY ONE variable and you can SET it for example with a Set Field [ ] script step using the Let ( ) function, something like: Set Field [ YourTable::YourField ; Let ( [color:red]$$test $test $test = $$test $test $test + 1 ; "" ) ] Note that I used an [color:red]$$var so you can see easily the result
Colin Keefe Posted June 18, 2010 Author Posted June 18, 2010 Interesting. Yeah, that works if you use a Let statement in a Set Field script step. Note that trying to Set Variable "$test $test” to some value in a script step doesn’t work, because it reads the second $ as an illegal character. This is a bit inconsistent, obviously. Why should the behavior be illegal in one circumstance, and generate NO error in another (and, moreover, WORK)? Moreover, I find it a bit odd that the calc engine interprets return characters as part of the variable name as well. I have a feeling something would break somewhere if you were to choose to declare variables with illegal characters through Set Field. I just don’t know where.
Raybaudi Posted June 18, 2010 Posted June 18, 2010 Note that trying to Set Variable "$test $test” to some value in a script step doesn’t work, because it reads the second $ as an illegal character Isn't it the same as: Note that the last two variables can be definited in many ways but NOT with Set Variable [ ] Moreover, I find it a bit odd that the calc engine interprets return characters as part of the variable name as well Try this: Let([ a = 1 ; b a = 2 + a ]; b a )
Colin Keefe Posted June 18, 2010 Author Posted June 18, 2010 Ow. And this is helpful to my brain at 5 o’clock on a Friday...how? ;-) And now I have Abacab in my head, and will have to purge it.
Colin Keefe Posted June 18, 2010 Author Posted June 18, 2010 (edited) Yep, I just missed that part of your post. Edited June 18, 2010 by Guest
Raybaudi Posted June 19, 2010 Posted June 19, 2010 And now I have Abacab in my head, and will have to purge it. Try with solving this quiz: What is the result of this calculation ? ( "mission impossible" - "0" - "1" ) Let([ $test $test = 1 ; $test $test = $test $test - 1 ]; $test $test + $test $test )
Raybaudi Posted June 19, 2010 Posted June 19, 2010 After that quiz, another: Can exist this variable: $$$ : ( Try a button with this step: ) SetField [ YourField ; Let( $$$ = Abs ( $$$ - 1 ) ; $$$ ) ]
Colin Keefe Posted June 23, 2010 Author Posted June 23, 2010 This is eerily like those dreams I was having the night before my 11 certification exam.
Recommended Posts
This topic is 5325 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