tags:

views:

40

answers:

2

How can I make this code into a one line instruction?

var qe : QuestionnaireElement = state.Parameters["demobreak"];

var qid : String = qe.QuestionId;

qid != "q45" 

public class QuestionnaireElement : ParameterValue, IParameterValue, ICloneabl

My real question is:

How can I cast in JScript objects?

  ((QuestionnaireElement)state.Parameters["demobreak"]).QuestionId != "q45"
A: 

I can't test this, but wouldn't

(state.Parameters["demobreak"]:QuestionnaireElement).QuestionId != "q45"

do it?

Joshua
Sorry but I have comiple error:Hide script Line 1 Column 54: Expected ')'Hide script Line 1 Column 25: Type mismatch
SergioKastro
Thank you very much for your help
SergioKastro
if the answer helped you, how about an upvote. If not, it would be great if you shared your solution? :)
Joshua
A: 

Sorry for all of you if I make waste your time. I was kind of desesperate to find out the solution, and like always, once that seen the solution, everything looks easier.

The final answer is (or at least a solution is):

(QuestionnaireElement)(state.Parameters["demobreak"]).ValueId != report.DataSource.GetProject("ds0").CreateQuestionnaireElement("q45").ValueId

SergioKastro