• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Arrays > Using Arrays

Using Arrays

Arrays are easy to use, but like all complex data, they must be created and initialized before they can be accessed. The array function ArrayNew() creates an array and takes one required argument. After you create the array, you must initialize it.

Creating Arrays

The ArrayNew() function creates an array and specifies the number of dimensions the array can hold. Passing an argument of 1 to ArrayNew(), as shown in the following example, creates a one-dimensional array. Multidimensional arrays will be discussed later in this chapter. After you create an array, you can access it by using functions or setting values directly.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint