Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5325 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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

Posted

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.

Posted

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

)

Posted

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

)

Posted

After that quiz, another:

Can exist this variable: $$$ :

( Try a button with this step: )

SetField [ YourField ; Let( $$$ = Abs ( $$$ - 1 ) ; $$$ ) ]

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.