Use the OCONV statement to convert internal representations of data to their external form. The statement takes the general form:
Where expression1 may evaluate to any data type but must be relevant to the conversion code. expression2 should evaluate to a conversion code from the list below. Alternatively, expression2 may evaluate to a user exit known to the jBASE BASIC language or supplied by the user.
Description of date, time, number and currency conversions same as when used in ICONV and International Mode
OCONV will return the result of the conversion of expression1 by expression2. Shown below are valid conversion codes:
Converts an internal date to an external date format. The numeric argument n specifies the field width allowed for the year and can be 0 to 4 (default 4). The character c causes the date to be return in the form ddcmmcyyyy. If it is not specified the month name is return in abbreviated form.
Allow the conversion of an external date to the internal format even though an output conversion is expected.
Returns the day in the current month.
Returns the number of the month in the year.
Returns the name of the current month.
Returns the number of the day in the year (0-366).
Returns the quarter of the year as a number 1 to 4
Returns the day of the week as a number 1 to 7 (Monday is 1).
Returns the name of the day of the week.
Returns the year in a field of n characters.
Given a prospective filename for a command such as CREATE-FILE this conversion will return a filename that is acceptable to the version of UNIX jBASE is running on.
Removes all but the alphabetic characters from the input string.
Removes all but the non-alphabetic characters in the input string.
Returns just the alphabetic and numeric characters from the input string
Removes all but the numeric characters from the input string
Removes all but the non-numeric characters from the input string
Remove all alphabetic and numeric characters from their input string.
Replaces all occurrences of string s1 with string s2
Converts all upper case characters in the string to lower case characters
Converts all lower case characters in the string to upper case characters.
Capitalizes each word in the input string; e.g. JIM converts to Jim
Converts all non-printable characters to a period character "." in the input string. When supplied use the character "c" in place of the period.
In the same manner as the MCP conversion, it replaces all non-printable characters. The ASCII hexadecimal value follows the replacing character.
Performs the opposite conversion to MCPN. The ASCII hexadecimal value following the tilde character converts to its original binary character value.
Converts the decimal value in the input string to its hexadecimal equivalent.
Converts the hexadecimal value in the input string to its decimal equivalent.
Extracts x groups separated by character c skipping n groups, from the input string.
Performs time conversions.
Converts the supplied integer value to a decimal value.
Converts a packed decimal number to an integer value.
Converts ASCII input to hexadecimal characters.
Performs file translations given a cross-reference table in a record in a file.
Go back to jBASE BASIC.