Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 9:25 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: populating an array - syntax question
PostPosted: April 7th, 2010, 3:19 pm 
Offline

Joined: November 8th, 2004, 5:23 pm
Posts: 279
Opus: Opus Pro 9
OS: Win 10/64
I try to populate an array:

This works:

Code:
var gesObjekte = new Array()
gesObjekte [0] = "apfel"
gesObjekte [1] = "ball"
gesObjekte [2] = "augen"
gesObjekte [3] = "etc"


But this does not:
Code:
var alleObjekte = new Array()
alleObjekte = ["apfel","birne","etc"];


Is there a mistake I make or does the bracket - syntax not work in Opus? I would use the second syntax rather than the first because there are about 200 objects in the array and the bracket-syntax would be more readable.

T.

_________________
Opus Pro 9.75, Win 10/64, 8 GB RAM, Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 CPUs), ~3.4GHz, NVIDIA GeForce GTX 660 Ti, Roland OctaCapture


Top
 Profile Visit website  
 
 Post subject: Re: populating an array - syntax question
PostPosted: April 7th, 2010, 3:57 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Nearly,

Code:
myAnimals = new Array("cat","rat","mouse","snake")


Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: populating an array - syntax question
PostPosted: April 7th, 2010, 4:55 pm 
Offline

Joined: November 8th, 2004, 5:23 pm
Posts: 279
Opus: Opus Pro 9
OS: Win 10/64
mackavi wrote:
Nearly,

Code:
myAnimals = new Array("cat","rat","mouse","snake")


Mack


... great. Thank you very much!

If we would have a thank-you-button I would click it 10 times for you! :D

T.

_________________
Opus Pro 9.75, Win 10/64, 8 GB RAM, Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 CPUs), ~3.4GHz, NVIDIA GeForce GTX 660 Ti, Roland OctaCapture


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group