Difference between revisions of "ASTORE()"
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) (→Description) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to fill an array with character strings that are separated with a specified character | Function to fill an array with character strings that are separated with a specified character | ||
− | |||
==Syntax== | ==Syntax== | ||
ASTORE(<array>, <expC1>, <expC2>) | ASTORE(<array>, <expC1>, <expC2>) | ||
− | |||
==See Also== | ==See Also== | ||
− | [[AADD()]], [[AAVERAGE | + | [[AADD()]], [[AAVERAGE()]], [[ACOPY()]], [[ADEL()]], [[ADESC()]], [[ADIR()]], [[AELEMENT()]], [[AFIELDS()]], [[AFILL()]], [[AINS()]], [[ALEN()]], [[ALINES()]], [[AMAX()]], [[AMIN()]], [[APPEND FROM ARRAY]], [[ARRAY()]], [[ASCAN()]], [[ASIZE()]], [[ASORT()]], [[ASTRING()]], [[ASUBSCRIPT()]], [[ASUM()]], [[COPY TO ARRAY]], [[DECLARE]], [[DIMENSION]], [[GATHER]], [[IN_ARRAY()]], [[IS_ARRAY()]], [[LOCAL]], [[PRIVATE]], [[PUBLIC]], [[RELEASE]], [[RESTORE]], [[SAVE]], [[SCATTER]] |
− | + | ||
==Description== | ==Description== | ||
− | The ASTORE() function fills the <array> with character strings from <expC1> which are separated by the character specified in <expC2>. The array will be created if it has not been previously declared. For an existing array | + | The ASTORE() function fills the <array> with character strings from <expC1> which are separated by the character specified in <expC2>. The array will be created if it has not been previously declared. For an existing array - which should be a one dimensional array - the character strings are copied into the array elements and the length of the array is automatically resized. The ASTORE() function returns the number of character strings copied into the array. The ASTORE() function is most commonly used in combination with menu commands where multiple selections can be made. |
+ | Note that if the <array> specified has the same name as an existing memory variable that is not a one dimensional array, the memory variable will not be overwritten and an error will be returned. | ||
==Example== | ==Example== | ||
Line 31: | Line 29: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | |||
[[Category:Array Processing Functions]] | [[Category:Array Processing Functions]] | ||
− | |||
[[Category:String Data Functions]] | [[Category:String Data Functions]] | ||
+ | [[Category:Lianja VFP Extensions]] | ||
+ | [[Category:VFP Function Extensions]] |
Latest revision as of 09:47, 12 October 2020
Contents
Purpose
Function to fill an array with character strings that are separated with a specified character
Syntax
ASTORE(<array>, <expC1>, <expC2>)
See Also
AADD(), AAVERAGE(), ACOPY(), ADEL(), ADESC(), ADIR(), AELEMENT(), AFIELDS(), AFILL(), AINS(), ALEN(), ALINES(), AMAX(), AMIN(), APPEND FROM ARRAY, ARRAY(), ASCAN(), ASIZE(), ASORT(), ASTRING(), ASUBSCRIPT(), ASUM(), COPY TO ARRAY, DECLARE, DIMENSION, GATHER, IN_ARRAY(), IS_ARRAY(), LOCAL, PRIVATE, PUBLIC, RELEASE, RESTORE, SAVE, SCATTER
Description
The ASTORE() function fills the <array> with character strings from <expC1> which are separated by the character specified in <expC2>. The array will be created if it has not been previously declared. For an existing array - which should be a one dimensional array - the character strings are copied into the array elements and the length of the array is automatically resized. The ASTORE() function returns the number of character strings copied into the array. The ASTORE() function is most commonly used in combination with menu commands where multiple selections can be made.
Note that if the <array> specified has the same name as an existing memory variable that is not a one dimensional array, the memory variable will not be overwritten and an error will be returned.
Example
declare aNums[10] ? alen(aNums) 10 nelements = ASTORE(aNums, "one, two, three", ",") ? nelements 3 ? alen(aNums) 3 // Another Example menu fields select "+" declare aMenu[512] nelements = astore(aMenu, menuitem(), "+")