Complex Expression and Array with Variable

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
jwm0vmh
Newbie
Posts: 9
Joined: Sun Jul 06, 2003 3:44 pm

Complex Expression and Array with Variable

Post by jwm0vmh » Tue May 08, 2007 11:59 am

I have a script in which I have an array setup that stores range names from an Excel spreadsheet. The array is crit. When I call the array variable from a complex expression I get error messages. I have tried every combination of % signs around the variables I can think of and I still get an error. What is the correct way to format the array variable? I am using MS 9.0.053. The formula is listed below:

if>{(crit[crt_cn]="HR_Criteria") OR (crit[crt_cn]="IP_Criteria")}

I have tried the following variations:
if>{(crit[%crt_cn%]="HR_Criteria") OR (crit[%crt_cn%]="IP_Criteria")}

if>{(%crit%[%crt_cn%]="HR_Criteria") OR (%crit%[%crt_cn%]="IP_Criteria")}

if>{(%crit[crt_cn]%="HR_Criteria") OR (%crit[crt_cn]%="IP_Criteria")}

Thanks,
JWM

User avatar
JRL
Automation Wizard
Posts: 3531
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue May 08, 2007 12:53 pm

Try setting the array value to a variable first:

Let>value=crit[%crt_cn%]

or whatever format it takes to make "value" = "crit[crt_cn]" not knowing exactly how you created the variable leaves me guessing how to retrieve it.

Then use the new variable in the complex expression:

if>{%value%="HR_Criteria") OR (%value%="IP_Criteria")}

Hope this helps,
Dick

jwm0vmh
Newbie
Posts: 9
Joined: Sun Jul 06, 2003 3:44 pm

Post by jwm0vmh » Tue May 08, 2007 1:49 pm

Thanks Dick. Yes, that works. I had already used that method as a workaround. I am just trying to see if it is possible to do use the array variable directly in a complex expression. The way the array was loaded is let>crit[1]=IP_Criteria

Thanks for the reply,
JWM

quote="JRL"]Try setting the array value to a variable first:

Let>value=crit[%crt_cn%]

or whatever format it takes to make "value" = "crit[crt_cn]" not knowing exactly how you created the variable leaves me guessing how to retrieve it.

Then use the new variable in the complex expression:

if>{%value%="HR_Criteria") OR (%value%="IP_Criteria")}

Hope this helps,
Dick[/quote]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts