PDA

View Full Version : Evaluating parameters


ajones
10-05-2004, 11:28 AM
I'm trying to set the text of a text object based on the evaluation of the value of a parameter. for example this object:

<topmenuoption name="c1" header="$once{menu1header}"
subheading="$once{heading_whereyoucanfocus}"
rightcontent="$once{content_revenuegrowth}"
suboptions="$once{menu2opt1}"

When I debug.write out the value of the "rightcontent" attribute I get:
«contentparagraph#0| #content_revenuegrowth»

But when I try to evaluate this.rightcontent against that string it fails to return true. It also fails when evaluating against the string "content_revenuegrowth" and every other combination I can think of.

Is there some trick to the syntax that I'm missing here? I can't get this if statement to return true no matter what I try.

antun
10-05-2004, 12:46 PM
From this:

«contentparagraph#0| #content_revenuegrowth»

... it looks as though rightcontent is set to an instance of contentparagraph called content_revenuegrowth, instead of content_revenuegrowth being a string variable, which is what I think you want.

Is it possible that there's a naming collision going on there?

-Antun

ajones
10-05-2004, 01:19 PM
I don't believe so, all the content_ variables have unique names. Here's the conditional statement I can't make work (attached to the topmenuoption class):

debug.write(this.rightcontent);
if (this.rightcontent == 'content_revenuegrowth') {
yadda yadda...

I can't get this if statement to evaluate as true no matter what I put into the quoted string (even a direct paste of the debug.write value), or whatever syntax or operators I use to evaluate it. I must have tried 50 different combinations by now and nothing lets me execute the code contained in the if statement.

ajones
10-05-2004, 01:22 PM
Nevermind- I think I see what you're saying. The value is being set as an object rather than an evaluatable string. I'll create a new variable to attach to the parent object I can use for evaluation. Thanks!