Book a Demo

Author Topic: Math calculations within code generation templates  (Read 2300 times)

Physicus

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Math calculations within code generation templates
« on: January 31, 2006, 01:04:35 am »
Is it possible to perform (simple) math calculations with the variables of the code generation templates, like addition or subtraction f.i. ?
e.g. I have two variables:
$var1 = "5"
$var2 = "3"
and I want to fill the (mathematical) difference in a third variable:
$var3 = $var1 - $var2
Now var3 contains "5 - 3", but I want that it contains "2".
Of course it's due to the fact, that these variables are strings - but is there any possibility to perform the desired calculations?

Thanks in advance!
« Last Edit: January 31, 2006, 02:38:00 am by Physicus »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Math calculations within code generation templ
« Reply #1 on: January 31, 2006, 01:05:39 pm »
No.  There isn't any way to do any sort of arithmetic in the code templates.

Well, that's not quite true.  You can be calling an addin.  (Search for EXEC_ADD_IN)

Physicus

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Math calculations within code generation templ
« Reply #2 on: February 01, 2006, 09:00:47 am »
@simonm:

Thank you very much. After a longer try I found out how it works.

Best Regards.