Sign in to follow this  
Followers 0
Orca

Creating array

7 posts in this topic

#1 ·  Posted (edited)

nvm figured it out.... this is what im doing and it seems kinda lengthy

Dim $X_Array[7]
$X_Array[1] = 11
$X_Array[2] = 22
$X_Array[3] = 33
$X_Array[4] = 44
$X_Array[5] = 55
$X_Array[6] = 66

is there an easier or faster way of asigning the variables in the array?

Edited by SiC_Goat

I AM ORCA!! A VERY POWERFUL WHALE!!!

Share this post


Link to post
Share on other sites



It depends on whether or not the data is ordered, delimited, known at compile time or generated at run-time and several other factors as to which way is the best way to popuplate an array.

Share this post


Link to post
Share on other sites

$num = 7
Dim $X_Array[$num}
for $i = 1 to $num - 1
   $X_Array[$num] = $num * 11
next


Who else would I be?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Umm I have a silly question, not worth making a new post for.

What is an array?

No seriously, I can't find a description. Help file keeps mentioning array all over the place and many times how to use it but how can I use it if I don't know what it is lol. Everyone in the forum, even those having problems with it, seem to know what it is. Yeah I know I feel dumb, I think I'm the only one who doesn't know what an array is lol.

Can someone just give me an example of something that is an array?

Edited by valkk

Share this post


Link to post
Share on other sites

Main Entry: 2array

Function: noun

1 a : a regular and imposing grouping or arrangement : ORDER <lined up ... in soldierly array -- Donald Barthelme> b : an orderly listing of jurors impaneled

2 a : CLOTHING, ATTIRE b : rich or beautiful apparel : FINERY

3 : a body of soldiers : MILITIA <the baron and his feudal array>

4 : an imposing group : large number <faced a whole array of problems>

5 a (1) : a number of mathematical elements arranged in rows and columns (2) : a data structure in which similar elements of data are arranged in a table b : a series of statistical data arranged in classes in order of magnitude

6 : a group of elements forming a complete unit <an antenna array>

Share this post


Link to post
Share on other sites

Basically it is a single variable that houses more than one element.

You could say $var1 = 1 $var2 = 2, etc or you could say $var[number] instead. It is a good way to have one reference point for many related objects


Who else would I be?

Share this post


Link to post
Share on other sites

An excellent explanation is provided in a c++ tutorial at cplusplus.com. Download the tutorial and you'll find an entire section on arrays. The tutorial should also give you a good base to start building simple programs, like Hello world and interesting mathematical operations.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0