Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Strange in functionality of arrays of static controls  (Read 2184 times)

0 Members and 1 Guest are viewing this topic.

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Strange in functionality of arrays of static controls
« on: November 12, 2009, 11:46:51 PM »

Code: [Select]
var someArray = new Array (10);

for (var i = 0; i<10; i=i+1)
{
   someArray[i] = someWindow.CreateStatic();
   someArray[i].X = 10;  // <- Message "Syntax Error" has arrived
}

In case of use temp variable:

Code: [Select]
for (var i = 0; i<10; i=i+1)
{
   someArray[i] = someWindow.CreateStatic();
   var somePlace = someArray[i];
   somePlace.X = 10;  // <-All ОК
}

Where my mistake?
« Last Edit: November 12, 2009, 11:50:03 PM by 2.0 »
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Strange in functionality of arrays of static controls
« Reply #1 on: November 13, 2009, 12:50:07 PM »

WME doesn't support nesting. you must use tmp variable


Code: WME Script
  1.  
  2. for (var i = 0; i<10; i=i+1)
  3. {
  4.    someArray[i] = someWindow.CreateStatic();
  5.    var somePlace = someArray[i];
  6.    somePlace.X = 10// <-All ОК
  7.    someArray[i] = somePlace;
  8. }
  9.  
  10.  
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: Strange in functionality of arrays of static controls
« Reply #2 on: November 13, 2009, 03:09:48 PM »

Thanks!
Logged
 

Page created in 0.036 seconds with 19 queries.