Possibility of creating global variables on the script form

Idea created by Duarte.Sousa on Nov 13, 2014
    Not planned
    Score9

    Hello everyone,

     

    Wouldn't be nice if it was possible to create global variables on the script form, on Catalog?

    Let me try to be more clear, when you want to make some scripts, you need to do something like this:

    {

        myFunctionA : function (){

             var getSomething=ca_fdGetTextFieldValue('formid','texfield');

             if(getSomething=="a"){

                   alert("a");

             }

        },

    //Now, on this function I'll need the value of getSomething again... but for that, I'll need to declared it again on this other function.

        myFunctionB : function (){

              var getSomething=ca_fdGetTextFieldValue('formid','texfield');

              var getThat=ca_fdGetTextFieldValue('formid','texfieldthat');

              if(getSomething=="a" && getThat=="spam"){

                   alert("a and spam,huehuehue");

             }

        }

    }

    _________________________________________________________________________________________________________________________

    Wouldn't be better if we could have something like this(?):

    {

    var getSomething=ca_fdGetTextFieldValue('formid','texfield');

    var getThat=ca_fdGetTextFieldValue('formid','texfieldthat');

     

        myFunctionA : function (){     

             if(getSomething=="a"){

                   alert("a");

             }

        },

        myFunctionB : function (){       

              if(getSomething=="a" && getThat=="spam"){

                   alert("a and spam,huehuehue");

             }

        }

    }

     

    In the cases where you need to use the value of a variable in more than 1 function, you could declare it at once 8pt; padding: 0px;"> 

    Thanks and regards,

    Duarte Sousa