Contact | Privacy | Datenschutzerklärung | Impressum

array

Format: array (size [, reserve])

Purpose: Creates an object with size fields. Such an object can be used as an array, using the [] operator with integer arguments. The size and reserve parameters must be positive integers. If the reserve parameter is not given or less than size, it defaults to size. The reserve parameter can be used to increase the efficiency if the array is going to be enlarged. It determines how much memory should be reserved for the array. In cases where the array is enlarged using the resize() function, the reserved space is used if possible.

Return Values: Returns the created array object.

Example:

input:
// Use the array() function to create a multidimensional array
// and assign values to each element.

<let x=array(3);         // Declare the array
 i=0; j=0;               // Initialize sub-array counters
 while j<=2;             // Begin outer loop to assign data fields
    i=0; x[j]=array(3);  // Declare the sub-array
    while i<=2;          // Begin inner loop to assign data fields
       x[j][i]=chr(j+i+65);        // Assign data
       ? "x[";?j;?"][";?i;?"] = "; ? x[j][i]; // Display the data
       ? "\n";           // Carriage return - line feed
       let i=i+1;        // Increment inner loop counter
    /while               // End inner loop
    ? "\n";              // Skip a line between array groupings
    let j=j+1;           // Increment outer loop counter
 /while;                 // End outer loop.
>
resulting output:
x[0][0] = A
x[0][1] = B
x[0][2] = C

x[1][0] = B
x[1][1] = C
x[1][2] = D

x[2][0] = C
x[2][1] = D
x[2][2] = E

Note: An array such as the one above can be used to display rows and columns of data in a Table. A more complex 3-dimensional array could be declared as x[year][month][sales] for Accounting purposes to track sales by period. And, of course, anyone engaged in the analysis of mathematical or statistical data can declare an n-dimensional matrix to suit their individual needs.

See Also: ArAppend(), ArConcat(), ArSearch(), resize().


This page was dynamically generated by the web application development tool RADpage of H.E.I. H.E.I. provides support, tools, and services like Webdesign in Mannheimm, the HTML/CSS 3D WebGL Animation Library taccgl, 3D Webdesign, and 3D Product ConfiguratorDemo (3D Produkt Konfigurator Demo in German).
© 1996-2024 H.E.I. All Rights Reserved.



Homepage
Intro/Features
Component Guide
Programming
  Language Guide
  Language Ref.
    General Design
    Lexical Structure
    Expressions
    Objects
    Methods
    Classes
    heitml Tags
    heitml Functions
      ArAppend
      ArConcat
      ArSearch
      array
      asc
      caltime
      chr
      class
      clone
      contains
      ContainsCase
      copy
      copyfile
      crypt
      _dbcolumns
      _dbforeignkey
      _dbprimarykey
      _dbtables
      _dbtypes
      default
      deletefile
      difftime
      directory
      findex
      flush
      fname
      gmtime
      htmlbool
      http_content_type
      http_empty_document
      http_expires
      http_header
      http_last_modified
      http_location
      http_set_cookie
      http_request_header
      _includefilepreprocessed
      index
      IndexCase
      integer
      isbool
      isdecl
      isempty
      isinteger
      isnull
      isstring
      istuple
      isreal
      left
      len
      localtime
      MD5
      mkdir
      mktime
      movefile
      offstotabcol
      random
      readFileLines
      _readini
      _readodbcdrv
      _readodbcdsn
      real
      resize
      right
      _serverdocroot
      _shelltemp
      srandom
      splitstring
      stat
      strftime
      strptime
      subst
      substall
      substring
      tabcoltooffs
      tolower
      toupper
      trim
      trimleft
      trimright
      TuAppField
      TuAssField
      TuAssign
      TuSlice
      TuDelField
      TuFieldSort
      TuInsField
      TuMerge
      TuName
      TuProject
      utime
      _writeini
    Advanced Functions
    Database Access
    Global Variables
    Form Fields
    Server Variables
    Sessions
    heitml Syntax
  Component Ref.
  Class Library
  User Components
  Tutorial
  New Features
  heitml 1
User Guide
Services
Privacy
Datenschutz
 
Contact / Impressum