Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [vtp-dev] Problem with use of array in scripting

Title: Re: [vtp-dev] Problem with use of array in scripting
Laurent,

    I’m not sure what’s happening here.  Since the arrays accessible through the “Variables” _javascript_ global are technically typed, i.e. an array of strings, this could be causing the assignment to fail.  I’ll keep looking into this and let you know what I find.

Trip


On 6/24/08 11:40 AM, "Laurent Dufour" <la.dufour@xxxxxxxxx> wrote:

Hello,

I've a question about the use of script module. When I use an array of string, I was unable to
affect the value of the variable tabtmp to the variable tab. I've declared the variable tab as an array of String.
When I display the value of the variable tabtmpstring, it contains "titi|tutu|toto".
However, when I display the value of the variable tabstring, I've "undefined|undefined|undefined".
This array has the good dimension but didn't contain the value.

Do you have an example to affect a value to this tab ?

---------------------------------------------------------------------------------------------

Variables.tabtmpstring = "";
Variables.tabtring = "";

var tabtmp  = new Array();

tabtmp[0] = "titi";
tabtmp[1] = "tutu";
tabtmp[2] = "toto";

for (var i=0; i<3; i++){
    Variables.tabtmpstring += '|' + tabtmp[i];
}

Variables.tab = tabtmp;

for (var j=0; j<3; j++){
    Variables.tabstring += '|' + Variables.tab [j];
}

---------------------------------------------------------------------------------------------

Regards, Laurent.


_______________________________________________
vtp-dev mailing list
vtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/vtp-dev

Back to the top