Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_atomacro() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_ATOMACRO()

 DESCRIPTION

 C_ATOMACRO() converts a Clipper array of field names to a character
 string combined by a specified delimiter to be used as a macro
 expression.  This function is most useful for creating macro
 expressions that are used by other functions that require them as
 parameters such as C_SELECT() and Clipper's ACHOICE().  The
 C_ATOMACRO() function will supply the conversion needed in the
 character string to make all fields return character type data so
 the expression can be correctly evaluated.  The optional starting
 and ending elements in the array can also be specified.

 NOTES

 When a macro expression is evaluated (&expr) as a character string,
 the largest string Clipper allows is 450 bytes.  The character
 string containing the macro can be 64,000 bytes, but when the
 expression is evaluated the length can not exceed 450 bytes (
 len(&expr) = 450 ).

 The C_ATOMACRO() will only convert one-dimensional arrays and can
 not convert array elements containing other arrays.

 SYNTAX

 C_ATOMACRO(array [,st_pos] [,end_pos] [,delimiter])

 PARAMETERS

 array (A) is the array to convert.

 st_pos (N) is the optional starting element.  If st_pos is not
 specified, the default of 1 is used.

 end_pos (N) is the optional ending element.  If end_pos is not
 specified, the entire array is used.

 delimiter (C) is the delimiter used to combine each field name in
 the character string.  The delimiter can be any group of characters
 (" + '   ' + ") or a function (" + space(4) + "), but must at least
 contain a plus sign (+) to concatenate the fields for the macro.
 If delimiter is not specified, the default delimiter of (" + ' ' +
 ") is used.

 RETURNS

 C_ATOMACRO() returns a delimited character string containing field
 names to be evaluated as a macro expression.

 EXAMPLES

 use test                 && Open database
 declare a1[fcount()]     && Declare array for all fields in DBF
 afields(a1)              && Load array using the AFIELDS() function

 s1 = c_atomacro(a1)      && Convert array to a macro expression

 ? s1 --> "NAME + ' ' + DTOC(UPD_DATE) + ' ' + STR(SALARY,5,2)"


See Also: C_CHARTOA() C_ATOCHAR() C_DIRTOA() C_FTOMACRO()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson