Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: BUG: Array creation  (Read 3916 times)

0 Members and 1 Guest are viewing this topic.

Banbury

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
  • I'm a llama! Mooh!
    • View Profile
BUG: Array creation
« on: May 03, 2004, 08:32:03 AM »

Hi,
this is not so much a bug as an oddity, but I wasn't able to create an array with a single value with:

arr = new Array(<some value>);

The array stays empty with a length of zero.

You can rightfully ask now, why I would want to create an array with a single value :).

Greetings

Banbury
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: BUG: Array creation
« Reply #1 on: May 03, 2004, 08:44:44 AM »

Hi Banbury, I'm glad to see you again ;)

It's by design actually. If you pass a single parameter to the Array constructor, it is supposed to specify number of items to be created.

e.g.

var ArrayWithTenItems = new Array(10);

You'll have to create an empty array and Push() the item.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Banbury

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
  • I'm a llama! Mooh!
    • View Profile
Re: BUG: Array creation
« Reply #2 on: May 03, 2004, 09:08:29 AM »

Oops! I should have thought of that.

Anyway, thanks for the welcome. I really tried to create something releasable last year, but I had to come to terms with the fact, that I'm no artist.  :D
After I have read the feature list of the latest WME version, I couldn't resist to write a few classes with it. I hope to release some reusable code snippets in the near future.

WME is still the best adventure creation software of them all. And I really wish I could paint  :'(.

Greetings

Banbury
Logged
 

Page created in 0.038 seconds with 19 queries.