Caché MultiValue PROC Reference
A
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Copies a field from the input buffer to the output buffer.
Synopsis
A
Annn
A,nnn
Achar[nnn]
Achar(nnn,nnn)
Arguments
nnn Optional — An integer specifying the number of characters in the input buffer to copy, starting from the current buffer pointer position. If nnn is omitted, or if nnn equals the number of characters in the field, the entire field is copied, and the current buffer pointer is advanced to the next parameter.
char Optional — A single character applied as the delimiter character before and after an output data value. Common char values are the ' (single quote) and " (double quote) characters. If no char is specified, the default is to delimit an output data value with blank spaces. Use \ as the char value to specify that no delimiter should be applied. char is applied when copying to the primary output buffer (POB); char is ignored when copying to the secondary output buffer (SOB).
Description
The A PROC command copies the specified nnn number of characters from the input buffer to the active output buffer. In Caché and most emulations, Annn is identical to A,nnn (see below for exceptions). A without nnn copies the entire current field from the active input buffer to the active output buffer.
When the primary output buffer (POB) is active, A copies the specified data from the input buffer to the POB, appending the copied data to the existing data at the current buffer pointer position. It delimits the output value by a separator character before and after the data value. The default separator character is a blank space. This default delimiting with blanks occurs in PQ procs; it does not occur in PQN procs. To output the data value without delimiter characters, use A\.
A with no arguments copies the current field from the active input buffer to the primary output buffer. When copying to the POB, it delimits the output field value with blank spaces. If there is no field value in the input buffer, A outputs a blank space by default.
A recognizes the semicolon (;) in the input buffer as a separator between values.
When the secondary output buffer (SOB) is active, A copies to the secondary output buffer, appending the copied data to the existing data at the current buffer pointer position. It copies the specified data from the input buffer exactly; no delimiting separator characters are added. Use the STON command to activate the secondary output buffer.
The A command maintains an input buffer pointer so that repeated invocations output successive substrings of a field. If nnn is omitted or equals the number of characters in the field, the entire field is returned, and the A pointer is advanced to the next field in the input buffer.
Commonly, the space between the A command name and the first argument is omitted.
The A command is frequently used as a reference for IF and GOTO. The IF command condition clause can take an A reference. The G (GOTO) command can take an A reference to specify retrieval of a label location from the input buffer. When used with IF or G, A cannot contain a char delimiter character.
Emulation
In UniVerse, if the input string already has delimiters, the A command does not add additional delimiters.
In REALITY, the A,nnn syntax uses the comma (,) as the char delimiter character. In all other emulations, the comma is ignored.
In jBASE, if nnn equals the length of the data, A does not advance the input buffer pointer to the next field. In Caché and all other emulations, A does advance the input buffer pointer to the next field.
In jBASE and REALITY, for a PQN proc, the A command does not recognize a semicolon (;) in the input buffer as an element separator.
See Also