The Character Service Class
The service class
Character processes character strings in various ways. Internally, this class assumes that all character strings are sequences of 8-bit unsigned bytes -- i.e. with values in the range 0-255.
Note that the ANSI-C char type is a signed value, so care must be taken. The field Character_ErrorCode
gmCL: int Character_ErrorCode; The field Character_ErrorCode is used to record errors that occur doing "character processing" operations. The method Character_ApplyTemplate
gmCL: int Character_ApplyTemplate(char* format,char* ident,int nIdent,char* buffer);gmNI: int String_ApplyTemplate(char* format,char* ident,int nIdent,char* buffer); The method Character_ApplyTemplate applies a template string to an identifier to form a new identifier. The template string uses the embedded "%1d" notation to mark the position where the identifier is to be inserted. A template like "%1d_RowIndex" when applied to an identifier "myRecord" would produce "myRecord_RowIndex". Note the use of the %nd notation. These templates are compatible with the language surface form strings in their simple form at least. The parameter format contains the patterned template as described above. It must be null-terminated. The parameter ident contains the identifier to be used with the template. It need not be null-terminated and its length must be specified in the parameter nIdent. The parameter buffer returns the newly formed identifier and the method returns the length of the identifier. The method Character_Compare
gmCL: int Character_Compare(CONST char* string1,CONST char* string2,int nCompare);gmNI: int String_Compare(CONST char* string1,CONST char* string2,int nCompare);gmSL: string Character.Compare(string string1, string string2, int nCompare); The method Character_Compare does a case-insensitive comparison between two character vectors. This is a bounded comparison. The null-character is treated exactly like any other special character. If all characters within the specified range are identical, up to case distinctions, then the method returns a zero. If two characters within the specified range disagree, then the value of the character in the first vector minus that in the second vector is returned. The parameter string1 is the first character vector in the comparison. The parameter string2 is the second character vector in the comparison. The parameter nCompare specifies the number of characters to be compared. Note that though the vectors are declared as "char*", making them signed (-127 to +127) they are retrieved here and compared as unsigned bytes. (0 to 255);
The method Character_CompareStrings
gmCL: int Character_CompareStrings(char *string1,char *string2);gmNI: int String_CompareStrings(char *string1,char *string2); The method Character_CompareStrings does a case-insensitive comparison between two character character strings. If all characters within the twp strings are identical, up to case distinctions, then the method returns a zero. If two characters within the specified strings disagree, then the value of the character in the first string minus that in the second string is returned. The parameter string1 is the first character string in the comparison. The parameter string2 is the second character string in the comparison. Note that though the vectors are declared as "char*", making them signed (-127 to +127) they are retrieved here and compared as unsigned bytes. (0 to 255);
The method Character_ConvertCase
gmCL: void Character_ConvertCase(char* String,int ns,int upper);gmNI: void String_ConvertCase(char* String,int ns,int upper);gmSL: string Character.Tolower(string strValue, int start, int length);gmSL: string Character.Toupper(string strValue, int start, int length); The method Character_ConvertCase forces the case of any alphabetic characters contained in the specified string to either upper-case or lower-case depending upon what is requested. Characters that are not alphabetic or that already have the requested case are not changed. The parameter String is the string to be converted. The string is not assumed to be null-terminated. The parameter ns is the number of characters to be considered for conversion. If the parameter upper is non-zero, then upper-case is to be enforced. If it is zero, then lower-case is enforced. The method Character_DigitValue
gmCL: int Character_DigitValue(int charValue); The method Character_DigitValue returns the value of a character digit. For the actual numeric digits this is the value of that digit. For lowercase alphabetic characters it is the sequence number of the letter in the letter in the alphabet. For uppercase alphabetic characters it is the value of the corresponding lowercase letter. For some special characters if is a token type value for that character. For all other characters it is zero. The parameter charValue is the value of the character being tested. It should be between 0 and 255. The method Character_DoubleDisplay
gmCL: int Character_DoubleDisplay(char* fiocrec,double value); The method Character_DoubleDisplay converts a double precision value to free-form display form without any additional direction from the caller. Based on the value being displayed it selects the most appropriate display for it. The parameter fiocrec returns display form of value and the parameter value is the value to be displayed. The method returns the width in characters of the formed display. The method Character_EditString
gmCL: int Character_EditString(CONST char* pattern,int nPattern,char* buffer,char* params,int patChar);gmNI: int String_Edit(CONST char* pattern,int nPattern,char* buffer,char* params,int patChar); The method Character_EditString forms a character string based on an input pattern string that specifies how the target string is to be formed. The editing pattern consists of characters that are simply copied into the result string and directive identifiers. These directives identifiers are marked by a leading pattern character -- a percent sign(%) or dollar sign($). The following are identifiers that are recognized (this assumes % is the pattern character): Directive | Meaning |
%% | Enter a percent sign |
%USR_VERSION% | Platform specified user version identifier |
%PRM_VERSION% | Platform specified system version identifier |
%PRM_BUILDID% | Platform build signature string |
%DATE% | Current date using currently selected formatting options |
%TIME% | Current time using currently selected formatting options |
%nd | Enter the nth (1-based) parameter string |
Note the use of the %nd notation. These patterns are compatible with the language surface form strings in their simple form at least. The parameter pattern contains the patterned editing specification as described above. It must be null-terminated only if the nPattern property below is zero. The parameter nPattern specifies the length of the editing string. If it is zero, then the editing string is assumed to be null-terminated and its length is computed accordingly. The parameter buffer returns the edited string. It is null-terminated. This method does not check to make certain that the buffer is large enough to contain the result. The parameter params is an optional semicolon-delimited character string containing the parameter strings to be used. If the edit strings contains no references to parameter strings then this parameter may be NULL. If a given reference parameter is missing, then no entry is made for it. The parameter patChar specifies the character used to mark the directive identifiers. It is typically % or $. The method returns the number of characters entered into the character result buffer not counting the terminating null.
The method Character_FindFirst
gmCL: int Character_FindFirst(char* source,int length,CONST char* substr);gmNI: int String_FindFirst(char* source,int length,CONST char* substr);gmSL: int Character.FindFirst(string source,int iStart,string subStr); The method Character_FindFirst finds the first occurrence of substring in a string starting at the front of the string. All character comparisons are case insensitive. The method returns when it finds a first occurrence or when it reaches the end of the string. The parameter source is the string which is being searched. The parameter length is the length of the search range or zero, which indicates that the entire string is to be searched. The parameter substr is the substring which is being searched for. If all characters within the substring are identical to a sequence of characters within the string, up to case distinctions, then the method returns the position, relative to one, of the start of the matching sequence in the string. If no matching sequence can be located in the string, then a zero is returned. The method Character_FindLast
gmCL: int Character_FindLast(char* String,int nString,CONST char* Substring); The method Character_FindLast attempts to find a substring within a string starting at the back Though not required all current implementations of this class use ASCII or UTF-8 variable length encoding and the descriptions of the methods assume that encoding. Internally the character values have character type flags associated with them as follows: Flag | Description |
UpperCaseFlag | The character is an upper case letter. This flag is normally restricted to the non extended ASCII characters. |
LowerCaseFlag | The character is a lower case letter. This flag is normally restricted to the non extended ASCII characters. |
IdentFlag | The character may begin and/or be within identifiers in the source language. Characters like the percent sign or dollar sign are often included as well as alphabetic-like characters in the 128-255 extended range. |
NumberFlag | This flag applies only to the 10 digit characters 0 - 9. |
SpecialFlag | This flag is used to mark those characters that make up the special character set of the source language. These characters will typically have token values associated with them as well. |
WhiteSpace | This flag marks the white space characters, normally blank and tab. |
QuoteFlag | This flag marks those characters used by the target language to enclose quoted strings. It may well include both the single and double quote and might as well include quotes in the 128-255 extended range. |
The field Character_ErrorCode
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
extern int Character_ErrorCode;
extern int Character_Ihist;
extern int Character_Ndec;
|
The Character_ErrorCode field is used to record errors that occur doing character processing operations. In addition there are two additional fields that supply support information. The Character_Ihist specifies the particular position with a string that contains a bad character which string conversion operations are being performed. The Character_Ndec specifies the number of explicit decimal digits used when a string is being converted to a decimal value. The actual error codes are as follows: ErrorCode | Description |
CharacterError_WrongDec | A string had the wrong number of decimal places |
CharacterError_BadDigits | A string contained a bad character relative to a conversion |
CharacterError_MissingValue | A string was missing a value during a date/time conversion |
CharacterError_BadMonth | A string contained an illegal month value |
CharacterError_BadDay | A string contained an illegal day value |
CharacterError_BadYear | A string contained an illegal year value |
CharacterError_BadTimeSeparator | A string contained an illegal time separation character |
The field Character_Separator
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
extern int Character_Separator
|
The Character_Separator field specifies the character use to separate the parameter substrings used by the editing methods. Its default value is a semi-colon. The method Character_ApplyTemplate
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_ApplyTemplate(char* format,char* ident,int nIdent,char* buffer);
|
The Character_ApplyTemplate method applies a template string to an identifier to form a new identifier. The template string uses the embedded "%1d" notation to mark the position where the identifier is to be inserted. A template like "%1d_RowIndex" when applied to an identifier "myRecord" would produce "myRecord_RowIndex". Note that the use of the %nd notation makes these templates compatible with the language surface form strings. The parameters are: Parameter | Description |
format | Contains the patterned template as described above. It must be null-terminated. |
ident | Contains the identifier used with the template. It need not be null-terminated and its length must be specified. |
nIdent | Specifies the length of the identifier. |
buffer | Receives the newly formed identifier. |
The method returns the length of the identifier. The method Character_Compare
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_Compare(CONST char* string1,CONST char* string2,int nCompare);
|
The Character_Compare method does a case-insensitive comparison between two character vectors. This is a bounded comparison. The null-character is treated exactly like any other special character. If all characters within the specified range are identical, up to case distinctions, then the method returns a zero. If two characters within the specified range disagree, then the value of the character in the first vector minus that in the second vector is returned. The parameters are: Parameter | Description |
string1 | Contains the first character vector in the comparison. |
string2 | Contains the second character vector in the comparison. |
nCompare | Specifies the number of characters to be compared. |
Note that the characters within the strings are retrieved and compared as byte values in the range 0 to 255. The method Character_CompareStrings
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_CompareStrings(char *string1,char *string2);
|
The Character_CompareStrings method does a case-insensitive comparison between two character strings. If all characters within the two strings are identical, up to case distinctions, then the method returns a zero. If two characters within the specified strings disagree, then the value of the character in the first string minus that in the second string is returned. The parameters are: Parameter | Description |
string1 | Contains the first character string in the comparison. |
string2 | Contains the second character string in the comparison. |
Note the string characters are retrieved here and compared as byte values (0 to 255). The method Character_DigitValue
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_DigitValue(int charValue);
|
The Character_DigitValue method returns the value of a character digit. For the actual numeric digits this is the value of that digit. For lowercase alphabetic characters it is the sequence number of the letter in the alphabet. For uppercase alphabetic characters it is the value of the corresponding lowercase letter. For some special characters if is a token type value for that character. For all other characters it is zero. The parameter is: Parameter | Description |
charValue | specifies the value of the character being tested. It must be between 0 and 255. |
The method Character_DoubleDisplay
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_DoubleDisplay(char* fiocrec,double value);
|
The Character_DoubleDisplay method converts a double precision value into a free-form display without any additional direction from the caller. Based on the value being displayed it selects the most appropriate display format for it. The parameters are: Parameter | Description |
fiocrec | Receives display form of the value. |
value | Specifies the value to be displayed. |
The method returns the length in characters of the formed display. The method Character_EditString
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_EditString(CONST char* pattern,int nPattern,char* buffer,char* params,int patChar);
|
The Character_EditString method forms a character string based on an input pattern string that specifies how the target string is to be formed. The editing pattern consists of characters that are simply copied into the result string and directive identifiers. These directive identifiers are marked by a leading pattern character -- usually a percent sign(%) or dollar sign($). The following are identifiers that are recognized (this assumes % is the pattern character): Directive | Meaning |
%% | Enter a percent sign |
%PRM_VERSION% | Platform specified system version identifier |
%PRM_BUILDID% | Platform build signature string |
%DATE% | Current date using currently selected formatting options |
%TIME% | Current time using currently selected formatting options |
%nd | Enter the nth (1-based) parameter string |
Note that the use of the %nd notation makes these patterns compatible with the language surface form strings. Its parameters are: Parameter | Description |
pattern | Contains the patterned editing specification as described above. It must be null-terminated only if the nPattern parameter is zero. |
nPattern | Specifies the length of the editing string. If it is zero, then the editing string is assumed to be null-terminated and its length is computed accordingly. |
buffer | Receives the edited string. It is null-terminated. This method does not check to make certain that the buffer is large enough to contain the result. |
params | Contains an optional Character_Separator-delimited character string specifying the parameter strings to be used. If the edit strings contains no references to parameter strings then this parameter may be NULL. If a given reference parameter is missing, then no entry is made for it. Note that Character_Separator is normally a semicolon. |
patChar | Specifies the character used to mark the directive identifiers. It is typically % or $. |
The method returns the number of characters entered into the character result buffer not counting the terminating null. The method Character_FindFirst
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_FindFirst(char* source,int length,CONST char* substr);
|
The Character_FindFirst method finds the first occurrence of substring in a string starting at the front of the string. All character comparisons are case insensitive. The method It returns when it finds a
last first occurrence or when it reaches the
front end of the string.
The parameter String is the string being searched. The parameter nString is Its parameters are:
Parameter | Description |
source | Contains the string which is being searched. |
length | Specifies the length of the |
string if , which indicates that the entire string is |
null-terminated. The parameter Substring is the substring to be searched. |
substr | Contains the substring which is being searched for. |
It must be null-terminated. If all characters within the substring are identical to a sequence of characters within the string, up to case distinctions, then the method returns the position, relative to one, of the start of the matching sequence in the string. If no matching sequence can be located in the string, then a zero is returned.
The method Character_
FromDategmCL: int Character_FromDate(int date,char* String); The method Character_FromDate converts a date value into a string. The format used is is mm/dd/yy. The parameter date contains the relative julian date value to be displayed. The parameter String returns the display form of the date in null terminated form. The method returns the length of the date display. The method Character_FromDateTime
gmCL: int Character_FromDateTime(longlong datetime,char* String); The method Character_FromDateTime converts a date/time value into a string by simply displaying the date component followed by the time component. The parameter datetime is the actual date/time value to be displayed. The parameter String returns the display form of the datetime value. The method returns the length of the date/time display. The method Character_FromDouble
gmCL: void Character_FromDouble(double val,int ndig,int* pdecpt,int* psign, char* dspdig); The method Character_FromDouble converts a double precision floating point value into a raw character form. ANSI C expects that all conversions of floating point values to string be performed via the "sprintf" service. Though this can be done, most generalize applications, prefer to perform their own editing operations, and require only a raw conversion be performed. The parameter val is the value to be converted to character form. The parameter ndig is the number of digits to produce. Precisely this many digits are produced. The parameter pdecpt returns the position of decimal point with respect to the beginning of the string. The parameter psign returns zero if the value was non-negative; else it returns one if the value was negative. The parameter dspdig returns the string produced. It contains precisely ndig digits followed by a null-byte. If the number of digits in val exceeds ndig then the last digit is rounded. If the number of digits is less that ndig then it is padded with zeros. The method Character_FromLong
gmCL: int Character_FromLong(longlong Value,char* String,int nDecimal); The method Character_FromLong converts an a long integer 8-byte value into a character string. The parameter Value contains the value to be converted and the parameter String returns the character representation of the value in null-terminated string form. The parameter nDecimal is the number of assumed decimal places in the value. The method returns the length of the character representation, not counting the null. The method Character_FromShort
gmCL: int Character_FromShort(int Value,char* String,int nDecimal);gmNI: int String_FromShort(int Value,char* String,int nDecimal); The method Character_FromShort converts an a short integer 4-byte value into a character string. The parameter Value is the value to be converted. The parameter String returns FindLast
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_FindLast(char* String,int nString,CONST char* Substring);
|
The Character_FindLast method attempts to find a substring within a string starting at the back of the string. All character comparisons are case insensitive. The method returns when it finds a last occurrence or when it reaches the front of the string. Its parameters are: Parameter | Description |
String | Contains the string being searched. |
nString | Specifies the length of the string or zero if the string is null-terminated. |
Substring | contains the substring being searched for. It must be null-terminated. |
If all characters within the substring are identical to a sequence of characters within the string, up to case distinctions, then the method returns the position, relative to one, of the start of the matching sequence in the string. If no matching sequence can be located in the string, then a zero is returned. The method Character_FromDate
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_FromDate(int date,char* String);
|
The Character_FromDate method converts a date value into a string. The format used is either mm/dd/yy or yyyy/mm/dd depending upon the YearMonthDay display flag. Its parameters are: Parameter | Description |
date | Contains the relative Julian date value to be displayed. |
String | returns the display form of the date in null-terminated form. |
The method returns the length of the date display. The method Character_FromDateTime
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_FromDateTime(longlong datetime,char* String);
|
The Character_FromDateTime method converts a date/time value into a string by simply displaying the date component in yyyy/mm/dd form followed by the time component in hh:mm form. Its parameters are: Parameter | Description |
datetime | Specifies the actual date/time value to be displayed in Julian seconds. |
String | Receives the display form of the date/time value in null-terminated form. |
The method returns the length of the date/time display. The method Character_FromDouble
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
void Character_FromDouble(double val,int ndig,int* pdecpt,int* psign, char* dspdig);
|
The Character_FromDouble method converts a double precision floating point value into a raw character form. ANSI C expects that all conversions of floating point values to string be performed via the "sprintf" service. Though this can be done, most generalized applications, prefer to perform their own editing operations, and require only a raw conversion be performed. Its parameters are: Parameter | Description |
val | Specifies the value to be converted to character form. |
ndig | Specifies the number of digits to produce. Precisely this many digits are produced. |
pdecpt | returns the position of decimal point with respect to the beginning of the string. |
psign | returns zero if the value was non-negative else it returns one if the value was negative. |
dspdig | Receives the string produced. It contains precisely ndig digits followed by a null-byte. |
If the number of digits in val exceeds ndig then the last digit is rounded. If the number of digits is less that ndig then it is padded with zeros. The method Character_FromLong
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_FromLong(longlong Value,char* String,int nDecimal);
|
The Character_FromLong method converts a long integer 8-byte value into a character string. Its parameters are: Parameter | Description |
Value | Specifies the value to be converted. |
String | Receives the character representation of the value in null-terminated string form. |
The parameter is | Specifies the number of assumed decimal places in the value. |
The method returns the length of the character representation, not counting the null.
The method Character_
FromTimegmCL: int Character_FromTime(int TimeValueFromShort
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_FromShort(int Value,char* String,int nDecimal);
|
The method Character_
FromTimeFromShort method converts a
time short integer 4-byte value into a character string.
The default used is hh:mm:ss, with the leading "h" blanked out if possible. The hour value is shown in 24-hour form. The time value itself is computed via the formula 3600*hour + 60*minute + second, in other words it is the number of seconds since midnight. The parameter TimeValue is the actual time value to be displayed in the form described above. The parameter String returns the display form of the time in null-terminated form. The method returns the length of the time display. The method Character_HexiDecimal
gmCL: int Character_HexiDecimal(ULONG Value,char* String,int base);gmNI: int String_HexiDecimal(ULONG Value,char* String,int base);gmSL: string Character.HexiDecimal(int iValue, int base); The method Character_HexiDecimal converts an unsigned integer value into a character string using hexadecimal, decimal, octal, or binary notation. Note that the decimal, octal, and binary notation digits are simply subsets of the hexadecimal digits. The parameter Value is the integer value to be converted. The parameter String returns the the string representation in the appropriate base, and the parameter base is the base to be used -- 2, 8, 10, or 16. The method returns the length of the character representation, not counting the null. The method Character_Insert
gmCL: int Character_Insert(char* source,int iStart,char* subStr,char* buffer);gmSL: string Character.Insert(string source, int iStart, string subStr); The method Character_Insert forms a new string by inserting the parameter subStr into the parameter source starting at the zero-based based offset specified by the parameter iStart. The result of the insertion is stored in the parameter buffer and the method returns the length of the result string. The method Character_IsControl
gmCL: int Character_IsControl(int charValue); The method Character_IsControl tests for control characters. It returns a nonzero value if a character value is below 32 or above 127, else it returns zero. It does not use character type flags and will report extended identifier characters as being control characters. The parameter charValue is the value of the character being tested. The method Character_IsDigit
gmCL: int Character_IsDigit(int charValue); The method Character_IsDigit tests for numeric digits. It returns a nonzero value if a character is a digit; else it return zero. The parameter charValue is the value of the character being tested. It may be signed or unsigned. The method Character_IsIdent
gmCL: int Character_IsIdent(int charValue); The method Character_IsIdent tests for identifier characters. It returns a nonzero value if a character is a possible identifier character; else it return zero. The parameter charValue is the value of the character being tested. It must be between 0 and 255. The method Character_IsLetter
gmCL: int Character_IsLetter(int charValue); The method Character_IsLetter tests for alphabetic characters. It returns a nonzero value if a character is an alphabetic, upper or lower case, character; else it return zero. The parameter charValue is the value of the character being tested. It must be between 0 and 255. The method Character_IsNothing
gmCL: int Character_IsNothing(int charValue); The method Character_IsNothing tests for characters with no special use. It returns a nonzero value if a character has no purpose flags associated with it; else it return zero. The parameter charValue is the value of the character being tested. It must be between 0 and 255. The method Character_IsQuote
gmCL: int Character_IsQuote(int charValue); The method Character_IsQuote tests for quote characters. It Its parameters are:
Parameter | Description |
Value | Specifies the value to be converted. |
String | Receives the character representation of the value in null-terminated string form. |
nDecimal | Specifies the number of assumed decimal places in the value. |
The method returns the length of the character representation, not counting the null. The method Character_FromTime
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_FromTime(int TimeValue,char* String);
|
The Character_FromTime method converts a time value into a string. The default used is hh:mm:ss, with the leading "h" blanked out if possible. The hour value is shown in 24-hour form. The seconds value is omitted if the OmitSeconds display flag is set. The time value itself is computed via the formula 3600*hour + 60*minute + second, in other words it is the number of seconds since midnight. Its parameters are: Parameter | Description |
TimeValue | specifies the actual time value to be displayed in the form described above. |
String | Receives the display form of the time in null-terminated form. |
The method returns the length of the time display. The method Character_Hexidecimal
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_HexiDecimal(ULONG Value,char* String,int base);
|
The Character_HexiDecimal method converts an unsigned integer value into a character string using hexadecimal, decimal, octal, or binary notation. Note that the decimal, octal, and binary notation digits are simply subsets of the hexadecimal digits. Its parameters are: Parameter | Description |
Value | Specifies the value to be converted. |
String | Receives the string representation in the appropriate base. |
base | Specifies the base to be used -- 2, 8, 10, or 16. |
The method returns length of the character representation, not counting the null. The method Character_Insert
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_Insert(char* source,int iStart,char* subStr,char* buffer);
|
The Character_Insert method inserts a substring into a base string starting at a zero-based offset. Its parameters are: Parameter | Description |
source | Contains base string that receives the substring |
iStart | Specifies the zero-based offset in the base string where the insertion is to begin |
subStr | Contains substring being inserted |
buffer | Receives the result of the insertion |
The method returns the length of the result string. The method Character_IsControl
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsControl(int charValue);
|
The Character_IsControl method tests for control characters. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character being tested |
The method returns a nonzero value if a character value is below 32 or above 127, else it returns zero. It does not use character type flags and will report extended identifier characters as being control characters. The method Character_IsDigit
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsDigit(int charValue);
|
The Character_IsDigit method tests for numeric digits. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It may be signed or unsigned. |
The method returns a nonzero value if a character is a
quote character; digit else it return zero.
The parameter charValue is the value of the character being tested. It must be between 0 and 255. The method Character_
IsSpecialgmCL: int Character_IsSpecial(int IsIdent
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsIdent(int charValue);
|
The method Character_
IsSpecialIsIdent method tests for
special characters. It identifier characters. Its parameter is:
Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It may be signed or unsigned. |
The method returns a nonzero value if a character is a
special possible identifier character
; else it
return returns zero.
The parameter charValue is the value of the character being tested. It must be between 0 and 255. It does use character type flags and will report extended identifier characters as being identifiers. The method Character_
IsWhiteSpacegmCL: int Character_IsWhiteSpace(int IsLetter
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsLetter(int charValue);
|
The method Character_
IsWhiteSpaceIsLetter method tests for
whitespace alphabetic characters.
It returns a nonzero value if a character is whitespace; else it return zero. The parameter charValue is the Its parameter is:
Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It |
must be between 0 and 255may be signed or unsigned. |
The method Character_RemovegmCL: int Character_Remove(char* strValue, int iStart, int length, char* buffer);gmSL: string Character.Remove(string strValue, int iStart, int length); The method Character_Remove forms a new string by removing length characters from the parameter strValue starting at the zero-based offset iStart. The result string is stored in the parameter buffer and the method returns the length of the new string. The method Character_Replace
gmCL: int Character_Replace(char* source,char* oldStr,char* newStr, char* buffer);gmSL: string Character.Replace(string source, string oldStr, string newStr) The method Character_Replace forms a new string from the parameter source in which all occurrences of the parameter oldStr have been replaced by the content of the parameter newStr. The parameter buffer returns the new string and the method returns the length of the new string. The method Character_RoundValue
gmCL: int Character_RoundValue(char* dspdig,int ndigit,int length); The method Character_RoundValue truncates and rounds a numeric string of digits. It modifies the content of parameter dspdig and returns the carry value from the round. If the input string consists of a sequence of "999.." such that all become rounded to zero, then the output string will contain "100..." and the method will return a value of 1; else it will return a value of 0. The parameter dspdig contains the string of numeric digits to be rounded. It may contain only numeric digits. The parameter ndigit specifies the number of digits desired in the rounded result. The parameter length specifies the total number of digits in the string as input. The method returns a one or a zero as described above. The method Character_SetIdent
gmCL: int Character_SetIdent(int charValue,int status); The method Character_SetIdent sets a character as an identifier character. It returns the previous identifier status of the character. The parameter charValue is the value of the character being set. It must be between 0 and 255. If the parameter status is nonzero, the character status is set to identifier; else it is set to not identifier. The method Character_SetQuote
gmCL: int Character_SetQuote(int charValue,int status); The method Character_SetQuote sets a character as a quote or not a quote. It returns the previous quote status of the character. The parameter charValue is the value of the character being set. It must be between 0 and 255. If the parameter status is nonzero, the character status is set to quote; else it is set to not quote. The method Character_SetSpecial
gmCL: int Character_SetSpecial(int charValue,int status); The method Character_SetSpecial sets a character as special or not special. It returns the previous special status of the character. The parameter charValue is the value of the character being set. It must be between 0 and 255.If the parameter status is nonzero, the character status is set to special; else it is set to not special. The method Character_ShiftLeft
gmCL: void Character_ShiftLeft(char* String, int nShift);gmNI: void String_ShiftLeft(char* String, int nShift); The method Character_ShifLeft shifts a null-terminated character string left a specified number of positions; thus removing the characters that are overwritten. The most common error in using this method involves forgetting that the string must be null-terminated. The parameter String is the string to be shifted and the parameter nShift is the number of positions to shift. The method Character_ShiftRight
gmCL: void Character_ShiftRight(char* String, int nShift, int fill);gmNI: void String_ShiftRight(char* String, int nShift, int fill); The method Character_ShiftRight shifts a character string right a specified number of places. The spaces thus created are set equal to the specified fill character. This method is typically used during detailed editing of displays during various numeric conversions. The most common error in using this service involves forgetting that the string must be null-terminated. The parameter String is the string to be shifted and the parameter nShift is the number of positions to shift. The parameter fill is the fill character to be used. The method Character_ShortFromHex
gmCL: int Character_ShortFromHex(char* String,int Length); The method Character_ShortFromHex converts an alphanumeric string in hexidecimal notation to a short integer 4-byte value. The parameter String contains the hexidecimal value to be determined. This string is assumed to be null-terminated only if the Length parameter is zero. The parameter Length is the length of the string represention or zero. The method returns the computed short value. If the representation was not well-formed, it the value as computed when the problem character is encountered. The method Character_ShortFromOctal
gmCL: int Character_ShortFromOctal(char* String,int Length); The method Character_ShortFromOctal converts an alphanumeric string to an octal integer value. The parameter String contains the integer value to be determined. The parameter Length contains the number of characters in the string. The method returns the computed integer value. The method Character_ShortFromString
gmCL: int Character_ShortFromString(char** StringPtr,int blank); The method Character_ShortFromString extracts a short value from a string. It converts an alphanumeric string to an integer value via a pointer to a pointer to a string. That pointer is then updated to point to the position beyond the end of the integer representation. The parameter StringPtr points to the location of a pointer to the start of the string. This location is updated to point immediately beyond the last character of the integer value. The parameter blank contains the blanks convention to be used. If it has a value of zero, then blanks terminate the string like any other nonnumeric character; if positive, then blanks are simply ignored; and if negative, then blanks have the value of "zero". The method returns the compute value. The method Character_Substr
gmCL: int Character_Substr(char* strValue,int iStart,int length,char* buffer);gmSL: string Character.Substr(string strValue, int iStart, int length); The method Character_Substr forms a new string by extracting a substring from the parameter strValue. The parameter iStart is the starting offset in the source string, relative to zero, of the start of the substring. The parameter length is the desired length of the substring. If it is negative or zero, then it is added to the length of the source string to determine its final value. The parameter buffer returns the new string and the method returns the length of the new stream. The method Character_ToDouble
gmCL: double Character_ToDouble(char *str,int nstr); The method Character_ToDouble converts an alphanumeric string containing a number in scientific notation to a double precision floating point number. The string can contain optional leading blanks, an integer part, a fractional part, and an exponent part. The integer part consists of an optional sign followed by zero or more decimal digits. The fractional part is a decimal point followed by zero or more decimal digits. The exponent part consists of an 'E', 'e', 'D', 'd', 'Q', or 'q' followed by an optional sign and a sequence of decimal digits. The parameter str cContains the alphanumeric string to be converted. The parameter nstr contains the number of characters in the string. Note that the string need not be null-terminated. The method returns the double precision value of the string. The method Character_ToShort
gmCL: int Character_ToShort(char* String,int nString,int nDecimal);gmNI: int String_ToShort(char* String,int nString,int nDecimal); The method Character_ToShort obtain a short value from a character string. It converts an alphanumeric string to a short integer 4-byte value. If the string contains no decimal point the the value is increased by the power of ten indicated. If the string contains decimal places then they must match the number specified. Note that this method accepts negative value representations; however, a leading minus sign must be used. The parameter String contains the integer value to be determined. This string is assumed to be null-terminated only if the nString parameter is zero. The parameter nString is the length of the string represention. If this is zero, then the String parameter is assumed to encompass the value and to be null-termined. The parameter nDecimal is the number of assumed decimal places in the value. The string must contain either no decimal places or exactly this many decimal places. The method returns the computed short value. If the representation was not well-formed, then an error code is set than may be retreived via the Character_ErrorCode field. The error codes set by this method are: Code | Meaning |
CharacterError_WrongDec | The string had the wrong number of decimal places |
CharacterError_BadDigits | The string contained non-numeric digits |
The method Character_ToLong
gmCL: longlong Character_ToLong(char* String,int nString,int nDecimal); The method Character_ToLong obtains a long value from a character string. It converts an alphanumeric string to a long integer 8-byte value. If the string contains no decimal point the the value is increased by the power of ten indicated. If the string contains decimal places then they must match the number specified. Note that this method accepts negative value representations; however, a leading minus sign must be used. The parameter String contains the integer value to be determined. This string is assumed to be null-terminated only if the nString parameter is zero. The parameter nString is the length of the string represention. If this is zero, then the String parameter is assumed to encompass the value and to be null-termined. The parameter nDecimal is the number of assumed decimal places in the value. The string must contain either no decimal places or exactly this many decimal places. The method returns the computed long value. If the representation was not well-formed, then an error code is set than may be retreived via the Character_ErrorCode field. The error codes set by this method are: Code | Meaning |
CharacterError_WrongDec | The string had the wrong number of decimal places |
CharacterError_BadDigits | The string contained non-numeric digits |
The method Character_ToDate
gmCL: int Character_ToDate(char* String,int nString); The method Character_ToDate converts a variety of date-formats into an integer julian date value. The formats recognized are: mm/dd/year, mm-dd-year, Mon dd year, dd Mon year, and yyyy-mm-dd Where: Symbol | Description |
dd | is a one or two digit day value |
mm | is a one or two digit month value |
Mon | is one of the standard 3-letter abbreviations of a month -- Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec. Note that case is ignored. |
Year | Is a two-digit or four-digit year value. Two-digit values are assumed to be in the 1900s if they are less than the cross-over value; otherwise they are assumed to be in the 2000s. |
The date value itself is computed as the number of days since the julian day zero, December 31, 1967. The parameter String contains the date to be computed. The parameter nString is the length of the date string. The value of the date computed as described above is returned. The method Character_ToTime
gmCL: int Character_ToTime(char* String,int nString); The method Character_ToTime returns a nonzero value if a character is an alphabetic, upper or lower case, character; else it returns zero. The method Character_IsLower
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsLower(int charValue);
|
The Character_IsLower method tests for lower case alphabetic characters. Since this test is typically made to do a case conversion, it returns the equivalent upper case value. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It may be signed or unsigned. |
The method returns the equivalent non-zero upper case value of the character if it is lower case; else it returns zero. The method Character_IsUpper
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsUpper(int charValue);
|
The Character_IsUpper method tests for upper case alphabetic characters. Since this test is typically made to do a case conversion, it returns the equivalent lower case value. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It may be signed or unsigned. |
The method returns the equivalent non-zero lower case value of the character if it is upper case; else it returns zero. The method Character_IsNothing
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsNothing(int charValue);
|
The Character_IsNothing method tests for characters with no special use. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It may be signed or unsigned. |
The method returns a nonzero value if a character has no purpose flags associated with it and it is in the range 0 to 255; else it returns zero. The method Character_IsQuote
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsQuote(int charValue);
|
The method Character_IsQuote tests for quote characters. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It may be signed or unsigned. |
The method returns a nonzero value if the character is a quote character; else it returns zero. The method Character_IsSpecial
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsSpecial(int charValue);
|
The Character_IsSpecial method tests for special characters. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It may be signed or unsigned. |
The method returns a nonzero value if the character is a special character; else it returns zero. The method Character_HasSpecial
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_HasSpecial(int charValue);
|
The Character_HasSpecial method tests for the special character value. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character whose value is wanted. It may be signed or unsigned. |
The method returns the special character value if the character is a special character; else it returns zero. The method Character_IsWhiteSpace
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_IsWhiteSpace(int charValue);
|
The Character_IsWhiteSpace method tests for whitespace characters. Its parameter is: Parameter | Description |
charValue | specifies the ASCII value of the character being tested. It may be signed or unsigned. |
The method returns a nonzero value if the character is whitespace; else it returns zero. The method Character_Remove
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_Remove(char* strValue, int iStart, int length, char* buffer);
|
The Character_Remove method forms a new string by removing a specified number of characters from a string starting at a zero-based offset into the string. Its parameters are: Parameter | Description |
strValue | Contains the string from which characters are to be removed. It must be null-terminated. |
iStart | Specifies the zero-based offset of the first character to be removed. |
length | Specifies the number of characters to be removed. |
buffer | Receives the newly formed string in null-terminated form. |
The method returns the length of the new string. The method Character_Replace
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_Replace(char* source,char* oldStr,char* newStr, char* buffer);
|
The Character_Replace method forms a new string from an existing one in which all occurrences of a specified substring have been replace by a new substring. Its parameters are: Parameter | Description |
source | Contains the original string to be modified. It must be null-terminated. |
oldStr | Contains the substring whose occurrences are to be replaced. It must be null-terminated. |
newStr | Contains the replacing substring. It must be null-terminated. |
buffer | Receives the new string in null-terminated form. |
The method returns the length of the new string. The method Character_RoundValue
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_RoundValue(char* dspdig,int ndigit,int length);
|
The Character_RoundValue method truncates and rounds a numeric string of digits. It modifies the content of that digit string and returns the carry value from the round. If the input string consists of a sequence of "999.." such that all become rounded to zero, then the output string will contain "100..." and the method will return a value of 1; else it will return a value of 0. Its parameters are: Parameter | Description |
dspdig | Contains the string of numeric digits to be rounded. It may contain only numeric digits. It need not be null-terminated. |
ndigit | Specifies the number of digits desired in the rounded result. |
length | Specifies the total number of digits in the string as input. |
The method returns a one or a zero as described above. The method Character_SetIdent
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_SetIdent(int charValue,int status);
|
The Character_SetIdent method sets a character as an identifier character. Its parameters are: Parameter | Description |
charValue | specifies the ASCII value of the character being set. It may be signed or unsigned. If it is not in the range 0 to 255, then the method does nothing. |
status | Specifies the status to be set. If it is nonzero, the IdentFlag is turned on for the character, else it is turned off. |
The method returns the previous identifier status of the character. The method Character_SetQuote
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_SetQuote(int charValue,int status);
|
The Character_SetQuote method sets a character as a quote character. Its parameters are: Parameter | Description |
charValue | specifies the ASCII value of the character being set. It may be signed or unsigned. If it is not in the range 0 to 255, then the method does nothing. |
status | Specifies the status to be set. If it is nonzero, the QuoteFlag is turned on for the character, else it is turned off. |
The method returns the previous quote status of the character. The method Character_SetSpecial
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_SetSpecial(int charValue,int status);
|
The Character_SetSpecial method sets a character as a special character. Its parameters are: Parameter | Description |
charValue | specifies the ASCII value of the character being set. It may be signed or unsigned. If it is not in the range 0 to 255, then the method does nothing. |
status | Specifies the status to be set. If it is nonzero, the SpecialFlag is turned on for the character, else all status flags are turned off. |
The method returns the previous special status of the character. The method Character_Shiftleft
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
void Character_ShiftLeft(char* String, int nShift);
|
The Character_ShifLeft method shifts a null-terminated character string left a specified number of positions; thus removing the characters that are overwritten. The most common error in using this method involves forgetting that the string must be null-terminated. Its parameters are: Parameter | Description |
String | Contains the string to be shifted in null-terminated form and receives the shifted string. |
nShift | Specifies the number of positions to shift. |
The method Character_ShiftRight
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
void Character_ShiftRight(char* String, int nShift, int fill);
|
The Character_ShiftRight method shifts a character string right a specified number of places. The spaces thus created are set equal to the specified fill character. This method is typically used during the detailed editing of displays during various numeric conversions. The most common error in using this service involves forgetting that the string must be null-terminated. Its parameters are: Parameter | Description |
String | Contains the string to be shifted and receives the shifted string. |
nShift | Specifies the number of positions to shift. |
fill | Specifies the fill character to be used. |
The method Character_ShortFromHex
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_ShortFromHex(char* String,int Length);
|
The Character_ShortFromHex method converts an alphanumeric string in hexadecimal notation to a short integer 4-byte value. The actual computation of the value is done using a longlong internal value. If the string is longer than 7 characters and begins with "8", then it is assumed to be negative. Its parameters are: Parameter | Description |
String | Contains the hexadecimal value to be determined. This string is assumed to be null-terminated only if the length parameter is zero. |
Length | Specifies the length of the string representation or zero. |
The method returns the computed short value. If the representation is not well-formed, it returns the value as computed when a problem character is encountered. The method Character_ShortFromOctal
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_ShortFromOctal(char* String,int Length);
|
The Character_ShortFromOctal method converts an alphanumeric string to an octal short integer 4-byte value. Its parameters are: Parameter | Description |
String | Contains the integer value to be determined. |
Length | Specifies the number of characters in the string. |
The method returns the computed integer value. The method Character_ShortFromString
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_ShortFromString(char** StringPtr,int blank);
|
The Character_ShortFromString method extracts a short integer 4-byte value from a string. It converts an alphanumeric string to an integer value via a pointer to a pointer to a string. That pointer is then updated to point to the position beyond the end of the integer representation. Its parameters are: Parameter | Description |
StringPtr | Specifies to the location of a pointer to the start of the string. This location is updated to point immediately beyond the last character of the integer value. |
blank | Contains the blanks convention to be used. If it has a value of zero, then blanks terminate the string like any other non-numeric character; if positive, then blanks are simply ignored; and if negative, then blanks have the value of "zero". |
The method updates the string pointer and returns the computed integer value. The method Character_Substr
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_Substr(char* strValue,int iStart,int length,char* buffer);
|
The Character_Substr method forms a new string by extracting a substring from a supplied one. Its parameters are: Parameter | Description |
strValue | Contains the supplied source string. It need be null-terminated only if the specified substring length is less than or equal to zero, |
iStart | Specifies the starting offset in the source string, relative to zero, of the start of the substring. |
length | Specifies the desired length of the substring. If it is negative or zero, then it is added to the length of the source string to determine its final value. |
buffer | Receives the new string in null-terminated form. |
The method returns the length of the new string. The method Character_ToDate
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_ToDate(char* String,int nString);
|
The Character_ToDate method converts a variety of date-formats into an integer Julian date value. The five formats recognized are: Seq | Format |
1 | mm/dd/year |
2 | mm-dd-year |
3 | Mon dd year |
4 | dd Mon year |
5 | yyy-mm-dd |
Where: Symbol | Description |
dd | is a one or two digit day value |
mm | is a one or two digit month value |
Mon | is one of the standard 3-letter abbreviations of a month -- Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec. Note that case is ignored. |
year | is a two-digit or four-digit year value. Two-digit values are assumed to be in the 1900s if they are less than the cross-over value; otherwise they are assumed to be in the 2000s. The current setting for this value is 60. |
The date value itself is computed as the number of days since the Julian day zero, by default December 31, 1967 (see the DateTime service class for details). Its parameters are: Parameter | Description |
String | Contains the date to be computed in string form. It need not be null-terminated. |
nString | Specifies the length of the date string. |
The method returns the integer value of the date computed as described above. The method Character_ToDateTime
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
longlong Character_ToDateTime(char* String,int nString);
|
The Character_ToDateTime method converts a date/time string into a long value equal to the number of seconds since the Julian day zero, by default December 31, 1967 (see the DateTime service class for details). The format is a valid date followed by whitespace followed by a valid time. See the methods Character_ToDate and Character_ToTime for a description of these valid formats. Its parameters are: Parameter | Description |
String | Contains the date/time string to be converted. |
nString | Specifies the length of the string. |
The method returns the long 8-byte integer value of date/time computed as described above. The method Character_ToDouble
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
double Character_ToDouble(char *str,int nstr);
|
The Character_ToDouble method converts an alphanumeric string containing a number in scientific notation to a double precision floating point value. The string can contain optional leading blanks, an integer part, a fractional part, and an exponent part. The integer part consists of an optional sign followed by zero or more decimal digits. The fractional part is a decimal point followed by zero or more decimal digits. The exponent part consists of an 'E', 'e', 'D', 'd', 'Q', or 'q' followed by an optional sign and a sequence of decimal digits. Its parameters are: Parameter | Description |
str | Contains the alphanumeric string to be converted. It need not be null-terminated. |
nstr | Specifies the number of characters in the string. |
The method returns the double precision value of the string. The method Character_ToLong
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
longlong Character_ToLong(char* String,int nString,int nDecimal);
|
The Character_ToLong method obtains a long value from a character string. It converts an alphanumeric string to a long integer 8-byte value. If the string contains no decimal point the value is increased by the power of ten indicated. If the string contains decimal places then they must match the number specified. Note that this method accepts negative value representations; however, a leading minus sign must be used. Its parameters are: Parameter | Description |
String | Contains the integer value to be determined. This string is assumed to be null-terminated only if the nString parameter is zero. |
nString | Specifies the length of the string representation. If this is zero, then the String parameter is assumed to encompass the value and to be null-terminated. |
nDecimal | Specifies the number of assumed decimal places in the value. The string must contain either no decimal places or exactly this many decimal places. |
The method returns the computed long value. If the representation was not well-formed, then an error code is set that may be retrieved via the Character_ErrorCode field. The error codes set by this method are: Code | Meaning |
CharacterError_WrongDec | The string had the wrong number of decimal places |
CharacterError_BadDigits | The string contained non-numeric digits |
The method Character_ToLower
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
void Character_ToLower(char* String,int ns);
|
The Character_ToLower method forces the case of any alphabetic characters contained in a specified string to be lower-case. Characters that are not alphabetic or that already have lower-case are not changed. Its parameters are: Parameter | Description |
String | Contains the characters to be converted and receives the converted characters. It is not assumed to be null-terminated. |
ns | Specifies the number of characters to be considered for conversion. |
The method Character_ToShort
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_ToShort(char* String,int nString,int nDecimal);
|
The Character_ToShort method obtains a short value from a character string. It converts an alphanumeric string to a short integer 4-byte value. If the string contains no decimal point the value is increased by the power of ten indicated. If the string contains decimal places then they must match the number specified. Note that this method accepts negative value representations; however, a leading minus sign must be used. Its parameters are: Parameter | Description |
String | Contains the integer value to be determined. It is assumed to be null-terminated only if the nString parameter is zero. |
nString | Specifies the length of the string representation. If this is zero, then the String parameter is assumed to encompass the value and to be null-terminated. |
nDecimal | Specifies the number of assumed decimal places in the value. The string must contain either no decimal places or exactly this many decimal places. |
The method returns the computed short 4-byte integer value. If the representation was not well-formed, then an error code is set that may be retrieved via the Character_ErrorCode field. The error codes set by this method are: Code | Meaning |
CharacterError_WrongDec | The string had the wrong number of decimal places |
CharacterError_BadDigits | The string contained non-numeric digits |
The method Character_ToTime
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_ToTime(char* String,int nString);
|
The Character_ToTime method converts a time string into an integer value equal to the number of seconds since midnight. The two formats recognized are: and Where: Symbol | Meaning |
hh | is a one or two digit hour value |
mm | is a one or two digit minute value |
ss | is a one or two digit second value |
If ss is omitted
the , a value of 0 is assumed.
The parameter String containing Its parameters are: Parameter | Description |
String | Contains the time to be computed. |
The parameter contains | Specifies the length of the time string. |
The
method returns the value of time computed as described above
is returned. If the representation was not well-formed, then an error code is set than may be retrieved via the Character_ErrorCode field. The error codes set by this method are: Code | Meaning |
CharacterError_BadDigits | The string contained non-numeric digits |
CharacterError_BadTimeSeparator | The values were not separated by colons. |
The method Character_
ToDateTimegmCL: longlong Character_ToDateTimeToUpper
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
void Character_ToUpper(char* String,int |
nString The method Character_
ToDateTime converts a date/time string into a long value equal to the number of seconds since December 31, 1967. The format is a valid date followed by whitespace followed by a valid time. See the methods Character_ToDate and Character_ToTime for a description of these valid formates. The parameter String contains the date/time to be computed. The parameter nString is the length of the string. The value of date/time computed as described above is returned. The method Character_Unpack
gmCL: int ToUpper method forces the case of any alphabetic characters contained in a specified string to be upper-case. Characters that are not alphabetic or that already have upper-case are not changed. Its parameters are:
Parameter | Description |
String | Contains the characters to be converted and receives the converted characters. It is not assumed to be null-terminated. |
ns | Specifies the number of characters to be considered for conversion. |
The method Character_Unpack
Prototype Code Block |
---|
language | cpp |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
|
int Character_Unpack(UBYTE* strValue,int nStrValue,int iStart,char* buffer); |
gmSL: string Character.Unpack(string strValue,int iStart); The method The Character_Unpack method extracts a specified string from a set of strings packed into a single string instance. The parameter strValue contains Its parameters are:
Parameter | Description |
strValue | Contains the packed set of strings |
and the parameter nStrValue is its length. The parameter iStart is . |
nStrValue | specifies the length of the packed string. |
iStart | Specifies the index relative to one of the desired string. |
The parameter returns | Receives the unpacked string |
and the The method returns the length of the unpacked string.