Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Stupid problem :)  (Read 2443 times)

0 Members and 1 Guest are viewing this topic.

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Stupid problem :)
« on: July 05, 2012, 11:35:06 PM »

Hi

I know it must be easy but I can't find how :/

tech[1] = "Green Crystals";
tech[2] = "Cyber Scanner";
tech[3] = "Black Ore";

How can I count items in this table? There are 3 items but how can I count them?
Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

hubertMichael

  • Regular poster
  • ***
  • Karma: 3
  • Offline Offline
  • Posts: 155
    • View Profile
    • Shadow Of Nebula - our point'n click adventure game
Re: Stupid problem :)
« Reply #1 on: July 05, 2012, 11:44:06 PM »

Yep, it was stupid :)

tech.Length will count items in my array but it will works if you first initialize variable by var tech = new Array()

Logged
Shadow Of Nebula fan page:

https://www.facebook.com/shadowofnebula

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Stupid problem :)
« Reply #2 on: July 10, 2012, 01:36:34 AM »

Dont forget to start your array with a 0
Logged
 

Page created in 0.04 seconds with 24 queries.