The CreatorCon Call for Content is officially open! Get started here.

Script - how to set a constant value for a var script? also some equation questions too.

alberttagle
Tera Contributor

Hi,

I'm not entirely sure where to look on why this script is not working.  I have very limited knowledge on scripting, but will get some education very soon, yet I have a deadline coming up for this.  Hope someone can help.

find_real_file.png

RED BOX: I'm trying to set a constant value for each VAR I created.  Is this done correctly? or it needs some other scripting?

GREEN BOX: The value which will be input manually in a single text field, will always be divided by 1024, so I'm trying to come up with a VAR for it. Can I script it like this?

BLUE BOX: here, I placed the "equation" in the script, so the output will be in the 'price' variable.

Maybe I'm doing the entire script too simple, and apparently wrong.

Please help.

 

Thanks!

19 REPLIES 19

Hi Archana,

Both of them are Multiple Choice variable types.

var env = 'whatenvironmentforpricing' has 4 choices: Development, Test, Pre-production and Production.

var crit = 'criticalitytypeforpricing' has 3 choices: Low, Medium and High.

find_real_file.png

Is the background value of Development the same as the Label? 

Yes, the TEXTs and the VALUEs are the same for all of the choices.

So, you are sure that there is no chance of case sensitive issues. Are you?

If yes, just test the code by inserting Alerts in between. This helps in finding the cause of the issue.

Thanks

Brian O_Donnell
Tera Guru

The green box is not correct.  It should be:

 

var DBSV = ((g_form.getValue('sizeforcomputation')-0)/1024); //the "- 0" is to force is to a numeric value