How to Create Global Variables
-
So I would like to use the result from the equation below to create a global variable and use that variable in other forms. I understand there is a FAQ here but it is still confusing to me. I am not too savvy with javascript and I understand I must make the result it’s own unique name but that’s all I know. I apologize for my poor java terminology.
(function(){
if(fieldname9==1 && fieldname7==1 && fieldname8==1){
return ROUND((66+fieldname5*13.7+fieldname4*5-fieldname3*6.8)*1.2);
}
if(fieldname9==1 && fieldname7==1 && fieldname8==2){
return ROUND((66+fieldname5*13.7+fieldname4*5-fieldname3*6.8)*1.375);
}
if(fieldname9==1 && fieldname7==1 && fieldname8==3){
return ROUND((66+fieldname5*13.7+fieldname4*5-fieldname3*6.8)*1.55);
}
if(fieldname9==1 && fieldname7==1 && fieldname8==4){
return ROUND((66+fieldname5*13.7+fieldname4*5-fieldname3*6.8)*1.725);
}
if(fieldname9==1 && fieldname7==1 && fieldname8==5){
return ROUND((66+fieldname5*13.7+fieldname4*5-fieldname3*6.8)*1.9);
}
if(fieldname9==1 && fieldname7==2 && fieldname8==1){
return ROUND((655+fieldname5*9.6+fieldname4*1.8-fieldname3*4.7)*1.2);
}
if(fieldname9==1 && fieldname7==2 && fieldname8==2){
return ROUND((655+fieldname5*9.6+fieldname4*1.8-fieldname3*4.7)*1.375);
}
if(fieldname9==1 && fieldname7==2 && fieldname8==3){
return ROUND((655+fieldname5*9.6+fieldname4*1.8-fieldname3*4.7)*1.55);
}
if(fieldname9==1 && fieldname7==2 && fieldname8==4){
return ROUND((655+fieldname5*9.6+fieldname4*1.8-fieldname3*4.7)*1.725);
}
if(fieldname9==1 && fieldname7==2 && fieldname8==5){
return ROUND((655+fieldname5*9.6+fieldname4*1.8-fieldname3*4.7)*1.9);
}
if(fieldname9==2 && fieldname8==1){
return ROUND((370+(21.6*(fieldname5-(fieldname5*(fieldname10/100)))))*1.2);
}
if(fieldname9==2 && fieldname8==2){
return ROUND((370+(21.6*(fieldname5-(fieldname5*(fieldname10/100)))))*1.375);
}
if(fieldname9==2 && fieldname8==3){
return ROUND((370+(21.6*(fieldname5-(fieldname5*(fieldname10/100)))))*1.55);
}
if(fieldname9==2 && fieldname8==4){
return ROUND((370+(21.6*(fieldname5-(fieldname5*(fieldname10/100)))))*1.725);
}
if(fieldname9==2 && fieldname8==5){
return ROUND((370+(21.6*(fieldname5-(fieldname5*(fieldname10/100)))))*1.9);
}
})()
- The topic ‘How to Create Global Variables’ is closed to new replies.