class being destroyed from edit box


robbudge

Recommended Posts

i have a structured class it consists of the following structure

recipes[20]

Each recipe contains Stages[5]

Each Stage contains pumps[5]

Each pump contains

ID (Pump ID)

pct (Percent of operation)

 

Now heres the funny part

 

I declare the recipe class and after import multiple Json file's to populate the each recipe without problems.

i have a edit box with the set channel to 

recipes[1].stages[1].pumps[1].pct

whenever this is modified my class is destroyed.

 

but from the command line i can

go

recipes[1].stages[1].pumps[1].pct=10.0

followed by

recipes[1].stages[1].pumps[1].pct=9.9

 

without any problems

Link to comment
Share on other sites

Yes, the DAQFactory parser has a problem with nested subsetting.  The funny part is that its not consistent as you've seen.  However, the workaround is pretty simple.  Use parenthesis to separate out each object reference, so instead of :

recipes[1].stages[1].pumps[1].pct

put:

(((recipes[1]).stages[1]).pumps[1]).pct

The parenthesis force the parser to evaluate each section independently.  

I've attached a sample.  Run the testNestedClasses to create the class structure first.

 

nestedClasses.ctl

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.