CalcBuilder Forum

Strange result

User moon_1727 2014-07-18 14:33:33

I've got a strange difference in the calculations.

Depending on the selected measurement (Deukformaat) each value entered in the fields below are given a certain response.

The fields I've programmed are working perfectly.
Except for the first one (Motorkap)
When the value is not entered and remains 0
The result should be 0 as well.

Other fields are responding accordingly.

Below the code i'm using for the fields.

$MotorkapAE=0;
$OpendakAE=0;
$DakAE=0;
$KofferdekselAE=0;
$SpatbordLVAE=0;
$SpatbordRVAE=0;
$SpatbordLAAE=0;
$SpatbordRAAE=0;
$DeurLVAE=0;
$DeurRVAE=0;
$DeurLAAE=0;
$DeurRAAE=0;
$StijlLAE=0;
$StijlRAE=0;
$DrempelLAE=0;
$DrempelRAE=0;


switch($Deukformaat){
case 10:
switch($Motorkap){
case $Motorkap==1:
$MotorkapAE=$MotorkapAE+5;
break;
case $Motorkap==2:
$MotorkapAE=$MotorkapAE+6;
break;
case $Motorkap==3:
$MotorkapAE=$MotorkapAE+7;
break;
case $Motorkap==4:
$MotorkapAE=$MotorkapAE+7;
break;
case $Motorkap==5:
$MotorkapAE=$MotorkapAE+8;
break;
case $Motorkap==6:
$MotorkapAE=$MotorkapAE+9;
break;
case $Motorkap==7:
$MotorkapAE=$MotorkapAE+10;
break;
case $Motorkap==8:
$MotorkapAE=$MotorkapAE+10;
break;
case $Motorkap==9:
$MotorkapAE=$MotorkapAE+11;
break;
case $Motorkap>9&&$Motorkap12&&$Motorkap15&&$Motorkap18&&$Motorkap21&&$Motorkap24&&$Motorkap27&&$Motorkap30&&$Motorkap33&&$Motorkap36&&$Motorkap39&&$Motorkap44&&$Motorkap49&&$Motorkap54&&$Motorkap59&&$Motorkap64&&$Motorkap69&&$Motorkap74&&$Motorkap79&&$Motorkap84&&$Motorkap89&&$Motorkap94&&$Motorkap99&&$Motorkap109&&$Motorkap119&&$Motorkap129&&$Motorkap139&&$Motorkap149&&$Motorkap159&&$Motorkap169&&$Motorkap179&&$Motorkap189&&$Motorkap199&&$Motorkap209&&$Motorkap219&&$Motorkap229&&$Motorkap239&&$Motorkap9&&$Motorkap12&&$Motorkap15&&$Motorkap18&&$Motorkap21&&$Motorkap24&&$Motorkap27&&$Motorkap30&&$Motorkap33&&$Motorkap36&&$Motorkap39&&$Motorkap44&&$Motorkap49&&$Motorkap54&&$Motorkap59&&$Motorkap64&&$Motorkap69&&$Motorkap74&&$Motorkap79&&$Motorkap84&&$Motorkap89&&$Motorkap94&&$Motorkap99&&$Motorkap109&&$Motorkap119&&$Motorkap129&&$Motorkap139&&$Motorkap149&&$Motorkap159&&$Motorkap169&&$Motorkap179&&$Motorkap189&&$Motorkap199&&$Motorkap209&&$Motorkap219&&$Motorkap229&&$Motorkap239&&$Motorkap9&&$Motorkap12&&$Motorkap15&&$Motorkap18&&$Motorkap21&&$Motorkap24&&$Motorkap27&&$Motorkap30&&$Motorkap33&&$Motorkap36&&$Motorkap39&&$Motorkap44&&$Motorkap49&&$Motorkap54&&$Motorkap59&&$Motorkap64&&$Motorkap69&&$Motorkap74&&$Motorkap79&&$Motorkap84&&$Motorkap89&&$Motorkap94&&$Motorkap99&&$Motorkap109&&$Motorkap119&&$Motorkap129&&$Motorkap139&&$Motorkap149&&$Motorkap159&&$Motorkap169&&$Motorkap179&&$Motorkap189&&$Motorkap199&&$Motorkap209&&$Motorkap219&&$Motorkap229&&$Motorkap239&&$Motorkap9&&$Motorkap12&&$Motorkap15&&$Motorkap18&&$Motorkap21&&$Motorkap24&&$Motorkap27&&$Motorkap30&&$Motorkap33&&$Motorkap36&&$Motorkap39&&$Motorkap44&&$Motorkap49&&$Motorkap54&&$Motorkap59&&$Motorkap64&&$Motorkap69&&$Motorkap74&&$Motorkap79&&$Motorkap84&&$Motorkap89&&$Motorkap94&&$Motorkap99&&$Motorkap109&&$Motorkap119&&$Motorkap129&&$Motorkap139&&$Motorkap149&&$Motorkap159&&$Motorkap169&&$Motorkap179&&$Motorkap189&&$Motorkap199&&$Motorkap209&&$Motorkap219&&$Motorkap229&&$Motorkap239&&$Motorkap9&&$Opendak12&&$Opendak15&&$Opendak18&&$Opendak21&&$Opendak24&&$Opendak27&&$Opendak30&&$Opendak33&&$Opendak36&&$Opendak39&&$Opendak44&&$Opendak49&&$Opendak54&&$Opendak59&&$Opendak64&&$Opendak69&&$Opendak74&&$Opendak79&&$Opendak84&&$Opendak89&&$Opendak94&&$Opendak99&&$Opendak109&&$Opendak119&&$Opendak129&&$Opendak139&&$Opendak149&&$Opendak159&&$Opendak169&&$Opendak179&&$Opendak189&&$Opendak199&&$Opendak209&&$Opendak219&&$Opendak229&&$Opendak239&&$Opendak9&&$Opendak12&&$Opendak15&&$Opendak18&&$Opendak21&&$Opendak24&&$Opendak27&&$Opendak30&&$Opendak33&&$Opendak36&&$Opendak39&&$Opendak44&&$Opendak49&&$Opendak54&&$Opendak59&&$Opendak64&&$Opendak69&&$Opendak74&&$Opendak79&&$Opendak84&&$Opendak89&&$Opendak94&&$Opendak99&&$Opendak109&&$Opendak119&&$Opendak129&&$Opendak139&&$Opendak149&&$Opendak159&&$Opendak169&&$Opendak179&&$Opendak189&&$Opendak199&&$Opendak209&&$Opendak219&&$Opendak229&&$Opendak239&&$Opendak9&&$Opendak12&&$Opendak15&&$Opendak18&&$Opendak21&&$Opendak24&&$Opendak27&&$Opendak30&&$Opendak33&&$Opendak36&&$Opendak39&&$Opendak44&&$Opendak49&&$Opendak54&&$Opendak59&&$Opendak64&&$Opendak69&&$Opendak74&&$Opendak79&&$Opendak84&&$Opendak89&&$Opendak94&&$Opendak99&&$Opendak109&&$Opendak119&&$Opendak129&&$Opendak139&&$Opendak149&&$Opendak159&&$Opendak169&&$Opendak179&&$Opendak189&&$Opendak199&&$Opendak209&&$Opendak219&&$Opendak229&&$Opendak239&&$Opendak9&&$Opendak12&&$Opendak15&&$Opendak18&&$Opendak21&&$Opendak24&&$Opendak27&&$Opendak30&&$Opendak33&&$Opendak36&&$Opendak39&&$Opendak44&&$Opendak49&&$Opendak54&&$Opendak59&&$Opendak64&&$Opendak69&&$Opendak74&&$Opendak79&&$Opendak84&&$Opendak89&&$Opendak94&&$Opendak99&&$Opendak109&&$Opendak119&&$Opendak129&&$Opendak139&&$Opendak149&&$Opendak159&&$Opendak169&&$Opendak179&&$Opendak189&&$Opendak199&&$Opendak209&&$Opendak219&&$Opendak229&&$Opendak239&&$Opendak9&&$Dak12&&$Dak15&&$Dak18&&$Dak21&&$Dak24&&$Dak27&&$Dak30&&$Dak33&&$Dak36&&$Dak39&&$Dak44&&$Dak49&&$Dak54&&$Dak59&&$Dak64&&$Dak69&&$Dak74&&$Dak79&&$Dak84&&$Dak89&&$Dak94&&$Dak99&&$Dak109&&$Dak119&&$Dak129&&$Dak139&&$Dak149&&$Dak159&&$Dak169&&$Dak179&&$Dak189&&$Dak199&&$Dak209&&$Dak219&&$Dak229&&$Dak239&&$Dak9&&$Dak12&&$Dak15&&$Dak18&&$Dak21&&$Dak24&&$Dak27&&$Dak30&&$Dak33&&$Dak36&&$Dak39&&$Dak44&&$Dak49&&$Dak54&&$Dak59&&$Dak64&&$Dak69&&$Dak74&&$Dak79&&$Dak84&&$Dak89&&$Dak94&&$Dak99&&$Dak109&&$Dak119&&$Dak129&&$Dak139&&$Dak149&&$Dak159&&$Dak169&&$Dak179&&$Dak189&&$Dak199&&$Dak209&&$Dak219&&$Dak229&&$Dak239&&$Dak9&&$Dak12&&$Dak15&&$Dak18&&$Dak21&&$Dak24&&$Dak27&&$Dak30&&$Dak33&&$Dak36&&$Dak39&&$Dak44&&$Dak49&&$Dak54&&$Dak59&&$Dak64&&$Dak69&&$Dak74&&$Dak79&&$Dak84&&$Dak89&&$Dak94&&$Dak99&&$Dak109&&$Dak119&&$Dak129&&$Dak139&&$Dak149&&$Dak159&&$Dak169&&$Dak179&&$Dak189&&$Dak199&&$Dak209&&$Dak219&&$Dak229&&$Dak239&&$Dak9&&$Dak12&&$Dak15&&$Dak18&&$Dak21&&$Dak24&&$Dak27&&$Dak30&&$Dak33&&$Dak36&&$Dak39&&$Dak44&&$Dak49&&$Dak54&&$Dak59&&$Dak64&&$Dak69&&$Dak74&&$Dak79&&$Dak84&&$Dak89&&$Dak94&&$Dak99&&$Dak109&&$Dak119&&$Dak129&&$Dak139&&$Dak149&&$Dak159&&$Dak169&&$Dak179&&$Dak189&&$Dak199&&$Dak209&&$Dak219&&$Dak229&&$Dak239&&$Dak9&&$Kofferdeksel12&&$Kofferdeksel15&&$Kofferdeksel18&&$Kofferdeksel21&&$Kofferdeksel24&&$Kofferdeksel27&&$Kofferdeksel30&&$Kofferdeksel33&&$Kofferdeksel36&&$Kofferdeksel39&&$Kofferdeksel44&&$Kofferdeksel49&&$Kofferdeksel54&&$Kofferdeksel59&&$Kofferdeksel64&&$Kofferdeksel69&&$Kofferdeksel74&&$Kofferdeksel79&&$Kofferdeksel84&&$Kofferdeksel89&&$Kofferdeksel94&&$Kofferdeksel99&&$Kofferdeksel109&&$Kofferdeksel119&&$Kofferdeksel129&&$Kofferdeksel139&&$Kofferdeksel149&&$Kofferdeksel159&&$Kofferdeksel169&&$Kofferdeksel179&&$Kofferdeksel189&&$Kofferdeksel199&&$Kofferdeksel209&&$Kofferdeksel219&&$Kofferdeksel229&&$Kofferdeksel239&&$Kofferdeksel9&&$Kofferdeksel12&&$Kofferdeksel15&&$Kofferdeksel18&&$Kofferdeksel21&&$Kofferdeksel24&&$Kofferdeksel27&&$Kofferdeksel30&&$Kofferdeksel33&&$Kofferdeksel36&&$Kofferdeksel39&&$Kofferdeksel44&&$Kofferdeksel49&&$Kofferdeksel54&&$Kofferdeksel59&&$Kofferdeksel64&&$Kofferdeksel69&&$Kofferdeksel74&&$Kofferdeksel79&&$Kofferdeksel84&&$Kofferdeksel89&&$Kofferdeksel94&&$Kofferdeksel99&&$Kofferdeksel109&&$Kofferdeksel119&&$Kofferdeksel129&&$Kofferdeksel139&&$Kofferdeksel149&&$Kofferdeksel159&&$Kofferdeksel169&&$Kofferdeksel179&&$Kofferdeksel189&&$Kofferdeksel199&&$Kofferdeksel209&&$Kofferdeksel219&&$Kofferdeksel229&&$Kofferdeksel239&&$Kofferdeksel9&&$Kofferdeksel12&&$Kofferdeksel15&&$Kofferdeksel18&&$Kofferdeksel21&&$Kofferdeksel24&&$Kofferdeksel27&&$Kofferdeksel30&&$Kofferdeksel33&&$Kofferdeksel36&&$Kofferdeksel39&&$Kofferdeksel44&&$Kofferdeksel49&&$Kofferdeksel54&&$Kofferdeksel59&&$Kofferdeksel64&&$Kofferdeksel69&&$Kofferdeksel74&&$Kofferdeksel79&&$Kofferdeksel84&&$Kofferdeksel89&&$Kofferdeksel94&&$Kofferdeksel99&&$Kofferdeksel109&&$Kofferdeksel119&&$Kofferdeksel129&&$Kofferdeksel139&&$Kofferdeksel149&&$Kofferdeksel159&&$Kofferdeksel169&&$Kofferdeksel179&&$Kofferdeksel189&&$Kofferdeksel199&&$Kofferdeksel209&&$Kofferdeksel219&&$Kofferdeksel229&&$Kofferdeksel239&&$Kofferdeksel9&&$Kofferdeksel12&&$Kofferdeksel15&&$Kofferdeksel18&&$Kofferdeksel21&&$Kofferdeksel24&&$Kofferdeksel27&&$Kofferdeksel30&&$Kofferdeksel33&&$Kofferdeksel36&&$Kofferdeksel39&&$Kofferdeksel44&&$Kofferdeksel49&&$Kofferdeksel54&&$Kofferdeksel59&&$Kofferdeksel64&&$Kofferdeksel69&&$Kofferdeksel74&&$Kofferdeksel79&&$Kofferdeksel84&&$Kofferdeksel89&&$Kofferdeksel94&&$Kofferdeksel99&&$Kofferdeksel109&&$Kofferdeksel119&&$Kofferdeksel129&&$Kofferdeksel139&&$Kofferdeksel149&&$Kofferdeksel159&&$Kofferdeksel169&&$Kofferdeksel179&&$Kofferdeksel189&&$Kofferdeksel199&&$Kofferdeksel209&&$Kofferdeksel219&&$Kofferdeksel229&&$Kofferdeksel239&&$KofferdekselselAE=$KofferdekselAE+190;
break;
case $Kofferdeksel==250:
$KofferdekselAE=$KofferdekselAE+197;
break;
}
;
break;
}
;

Edited by moon_1727 - 18.07.2014 14:34

Moonsoft support 2014-07-18 14:37:47

Hi,
sorry but due to security reasons this forum doesn't get on well with code. Please open a new ticket at the helpdesk with this issue, there the code will be parsed properly and we'll take a look.

Thanks, regards

...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!
...
CalcBuilder

Create dynamic calculators

Buy now!