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
Complex Expression and Array with Variable
Moderators: JRL, Dorian (MJT support)
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
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
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]
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]