The functions whose names begin with by act on and return fixed-length strings of bytes. The functions whose names begin with rst and st (except stchar) operate on and return null-terminated strings. The rdownshift() and rupshift() functions also operate on null-terminated strings but do not return values. When you compile your FESQLC program, the FESQLC preprocessor calls on the linker to link these functions to your program.
Returns the number of significant characters in the specified string; does not include trailing blanks
mint byleng(char *s1, mint count);
To copy a fixed-length string into a null-terminated string without trailing blanks
void ldchar(char *from, mint count, char *to);
To convert all the characters in a null-terminated string to lowercase.
void rdownshift(char *s);
s is a pointer to a null-terminated string.
To convert all the characters in a null-terminated string to uppercase.
void rupshift(char *s);
To concatenate one null-terminated string to another (src is added to the end of dst).
void stcat(char *src, char *dst);
To copy a string to another location
void stcopy(char *src, char *dst);
Returns the number of bytes in the specified string
mint stleng(char *src);
Notes:
To compare two strings
mint stcmpr(char *s1, char *s2);
=0 The two strings are identical.
<0 The first string is less than the second string.
>0 The first string is greater than the second string.
To copy a null-terminated string into a fixed-length string
void stchar(char *from, char *to, mint count);
To convert a string to a short integer.
mint rstoi(char *str, mint *val);
=0 The conversion was successful.
!=0 The conversion failed.
To convert a string to a double.
mint rstod(char *str, double *val);
=0 The conversion was successful.
!=0 The conversion failed.
To convert a string to a long integer
mint rstol(char *str, mlong *val);
=0 The conversion was successful.
!=0 The conversion failed.
To convert a double value to a character string having a specified format.
mint rfmtdouble(double dvalue, char *format, char *outbuf);
0 The conversion was successful.
-1211 The program ran out of memory (memory-allocation error).
-1217 The format string is too large.
To convert a long integer to a character string having a specified format
mint rfmtlong(int4 lvalue, char *format, char *outbuf);
0 The conversion was successful.
-1211 The program ran out of memory (memory-allocation error).
-1217 The format string is too large.
A numeric-formatting mask specifies a format to apply to some numeric value. This mask is a combination of the following formatting characters:
Character | Description |
* | This character fills with asterisks any positions in the display field that would otherwise be blank. |
& | This character fills with zeros any positions in the display field that would otherwise be blank. |
# | This character changes leading zeros to blanks. Use this character to specify the maximum leftward extent of a field. |
< | This character left-justifies the numbers in the display field. It changes leading zeros to a null string. |
, |
This character indicates the symbol that separates groups of three digits (counting leftward from the units position) in the whole-number part of the value. By default, this symbol is a comma. You can set the symbol with the DBMONEY environment variable. In a formatted number, this symbol appears only if the whole-number part of the value has four or more digits. |
. |
This character indicates the symbol that separates the whole-number part of a money value from the fractional part. By default, this symbol is a period. You can set the symbol with the DBMONEY environment variable. You can have only one period in a format string. |
- |
This character is a literal. It appears as a minus sign when the expression is less than zero. When you group several minus signs in a row, a single minus sign floats to the rightmost position that it can occupy; it does not interfere with the number and its currency symbol. |
+ |
This character is a literal. It appears as a plus sign when the expression is greater than or equal to zero and as a minus sign when expr1 is less than zero. When you group several plus signs in a row, a single plus or minus sign floats to the rightmost position that it can occupy; it does not interfere with the number and its currency symbol. |
( |
This character is a literal. It appears as a left parenthesis to the left of a negative number. It is one of the pair of accounting parentheses that replace a minus sign for a negative number. When you group several in a row, a single left parenthesis floats to the rightmost position that it can occupy; it does not interfere with the number and its currency symbol. |
) | This is one of the pair of accounting parentheses that replace a minus sign for a negative value. |
$ |
This character displays the currency symbol that appears at the front of the numeric value. By default, the currency symbol is the dollar sign ($). You can set the currency symbol with the DBMONEY environment variable. When you group several dollar signs in a row, a single currency symbol floats to the rightmost position that it can occupy; it does not interfere with the number. |
Any other characters in the formatting mask are reproduced literally in the result.
Mask | Numeric value | Formatted String |
-##,###.## |
-12345.67 12345.67 113.11 |
-12,234.67 b12,345.67 bbbb113.11 |
##,###.## |
-12345.67 12345.67 |
12,345.67 12,345.67 |
--,---.&& | -445.67 | bb-445.67 |
$$,$$$.&& |
2345.67 445.67 |
$2,345.67 bb$445.67 |