Jason,
Assuming that the syntax of EPMacros have not changed since it was borrowed from DOE-2 macros, the syntax for what you're trying to do should be:
##set1 X 0
##set1 X #[ X[] + 1 ]
Things to keep in mind are:
(1) I've never used #eval[], always just #[ ... ]
(2) put spaces before and after the operand, i.e., before and after the "+"
(3) use the empty bracket inside the #[ ] so that it knows that's a macro definition
(4) there can only be one operand per bracket, so if there are several operands, use nested brackets
(5) macros always take more time than you'd expect to get them to work.
Joe
Joe Huang White Box Technologies, Inc. 346 Rheem Blvd., Suite 108D Moraga CA 94556 yjhuang@xxxxxxxxxxxxxxxxxxxxxxxx www.whiteboxtechnologies.com (o) (925)388-0265 (c) (510)928-2683 "building energy simulations at your fingertips"
On 12/10/2012 5:21 PM, Jason Kirkpatrick wrote:I am trying to understand the use of the #eval commands in the EP Macro auxiliary program,
I have copied the example directly from the Auxiliary Programs reference (pg 148):
##set1 x 0
##set1 x #eval[ x[]+1]
According the reference, x should be set to 0, and then redefined to 1 by the second command, but when I run this example, I get this error:
# 64 # ##set1 x 0
# 65 # ##set1 x #eval[ x[]+1]
*ERROR*** **************** ===== ***********************************************************macro argument missing
Could anyone help me? I am trying to take two macro definitions and define a third macro with the first two values:
##set1 Width[] 50
##set1 Length[] 40
##set1 Area[] #eval[Width[]*Length[]]
I feel like this should work.
Also any guidance as to combining parametric variables and ep macros would be appreciated (I think you can't combine them) or alternatives to performing calculations on macros....
Thanks,
Jason K
__._,_.___