Configurator if statement issues

We’ve finally taken the plunge and are moving to E10 :S.

I’m currently converting configurators and although I am making progress I’m getting some problems on my “on Leave” If statements. It looks ok to me but doesn’t seem to work. if there are any examples of similar some kind person can point to I would be very obliged.

My attempt:

If (Inputs.dcl_DPRes.Value != 0 && Inputs.NoOfRolls.Value == 1 && Inputs.dcl_DPRes.Value >= Inputs.Dcl_LCL.Value && Inputs.dcl_DPRes.Value <= Inputs.dcl_UCL.Value)

{
	inputs.chr_PF.value = "PASS";
}

Numeric inputs in the configurator typically store decimals, have you tried adding the “m” prefix to the numbers?

If (Inputs.dcl_DPRes.Value != 0m && Inputs.NoOfRolls.Value == 1m && Inputs.dcl_DPRes.Value >= Inputs.Dcl_LCL.Value && Inputs.dcl_DPRes.Value <= Inputs.dcl_UCL.Value)
{
	inputs.chr_PF.value = "PASS";
}

Thanks - I hadn’t tried that, but just have. It didn’t solve the issue and I still get the “- ; expected” Error message

Is that and exact copy of your code? Is there any other lines?

I see “If” is capitalized and the “inputs” inside the brackets is not, I think those should give you errors as well.

One trouble shooting step you could do is remove conditions until the error goes away, then you will know which is causing it.

1 Like

I think it auto capitilised. the actual code is:

if (Inputs.dcl_DPRes.Value != 0m && Inputs.NoOfRolls.Value == 1m && Inputs.dcl_DPRes.Value >= Inputs.Dcl_LCL.Value && Inputs.dcl_DPRes.Value <= Inputs.dcl_UCL.Value)

{

Inputs.chr_PF.value = "PASS";

}

I’ve remove each of the 4 criteria and I still get issues . However the error is slightly different:

“erp.sharedlib.configurator.inputcontrolvaluebound<ice.lib.framework.epi.textbox.string> does not contain a definition for ‘Value’ and no extension method ‘value’…”
The dcl fields are definitely decimals so I’m not sure why it is referring to a string. This Configurator has been converted over from E9 so do you think it may be a error in the conversion process?

Inputs.chr_PF.value = "PASS";

Value should be capitalized as well I think?

2 Likes

I hold my head in shame. Can’t see the wood for the trees!!

Thanks Very Much :smiley:

1 Like

Your welcome! I see this is your first thread, remember to mark a post as the solution if your problem is addressed so people know that your problem is solved :slightly_smiling_face:

(It also helps for people who use the search function and select only threads with solutions)

2 Likes