Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro arrays vs. Clipper arrays
Message
From
21/08/2001 07:33:47
Ing. T.R.M. Pluym
Pluym Elektronics Bv
Hulst, Netherlands
 
 
To
21/08/2001 07:19:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00546619
Message ID:
00546635
Views:
19
Correct,

But Clipper has additional functions like AADD() here is the discription:

===========================================================================
Syntax

AADD(, ) --> Value

Arguments

is the array to add a new element to.

is the value assigned to the new element.

Returns

AADD() evaluates and returns its value. If is not
specified, AADD() returns NIL.

Description

AADD() is an array function that increases the actual length of the
target array by one. The newly created array element is assigned the
value specified by .

AADD() is used to dynamically grow an array. It is useful for building
dynamic lists or queues. A good example of this is the GetList array
used by the GET system to hold Get objects. After a READ or CLEAR GETS,
GetList becomes an empty array. Each time you execute an @...GET
command, the GET system uses AADD() to add a new element to the end of
the GetList array, and then assigns a new Get object to the new element.

AADD() is similar to ASIZE() but only adds one element at a time;
ASIZE() can grow or shrink an array to a specified size. AADD(),
however, has the advantage that it can assign a value to the new
element, while ASIZE() cannot. AADD() may also seem similar to AINS(),
but they are different: AINS() moves elements within an array, but it
does not change the array's length.

Note: If is another array, the new element in the target
array will contain a reference to the array specified by .

Examples

þ These examples demonstrate the effects of multiple invocations
of AADD() to an array:

aArray := {} // Result: aArray is an empty array
AADD(aArray, 5) // Result: aArray is { 5 }
AADD(aArray, 10) // Result: aArray is { 5, 10 }
AADD(aArray, { 12, 10 }) // Result: aArray is
// { 5, 10, { 12, 10 } }


===========================================================================
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform