All-
I'm looking to use "if statements" within DOE2. For example, I'm trying to
input a specific LPD based on the type of lighting schedule that is
specified. Ideally, I would like to couple multiple if statements together
but I can't even get this one to work:
{if(#L("LIGHTING-SCHEDULE")=Classroom InstLt Sch)
then 1.2
else 0
endif}
Any ideas on how this could work?
Thanks,
Steve Mignogna
try this:
PEOPLE-SCHEDULE =
{if (#PA("Schedules") == "Title24")
then #SI("T24 DAYTIME
OCC","SPACE","PEOPLE-SCHEDULE")
else #SI("Rink Occ Sch","SPACE","PEOPLE-SCHEDULE")
endif}
Thanks Brian-
aaahhh...I guess DOE2 doesn't read strings without using the 'SymIndex'
keyword and for some reason eQuest only reads the "LIGHTING-SCHEDUL" keyword
not "LIGHTING-SCHEDULE".
Thanks again for your help.
Steve
Brian's suggestion is a good one, but requires the use of global parameters.
This correction however will fit directly into your particular project:
if (#L("LIGHTING-SCHEDUL",0) ==
#SI("Classroom InstLt Sch","SPACE","LIGHTING-SCHEDUL"))
then 1.2
else 0
endif
Things to note:
- DOE-2 keyword names are limited to 16 characters, hence the use of
"LIGHTING-SCHEDUL" in place of your "LIGHTING-SCHEDULE"
- LIGHTING-SCHEDUL is actually an array of 5 individual schedule
assignments, so we specify the optional second #L() argument of "0"
indicating that we are interested in retrieving the first (0-based, not
1-based) element in the list (which is the default).
- Use of the #SI() function so that we are comparing a symbol table
index to another symbol table index.