These are some of the more essential conversion routines in Power-4gl.
Converts a word code to a corresponding word or short phrase in a native language. The actual words are contained in a dictionary which is in the form of a flat text file called "word.tbl". If the word is not found in the dictionary, the word code is used. Deviations from this routine are "Upfword" which upshifts the first letter of the word and "Upshword" which upshifts the whole word.
1 parameters:
Code: Word code. Normally this would be in
English (possibly abbreviated).
1 return value:
Word: The corresponding word or short
phrase in the native language.
Converts a message code to a corresponding message or sentence (single line text) in a native language. The actual messages are contained in a flat text file called "stx.tbl". If the message is not found in the text file then the code is used as the message.
1 parameters:
Code: Message code. Normally this would be
in English (possibly abbreviated).
1 return value:
Message: The corresponding single line
message in the native language.
Converts a message code to a corresponding message paragraph (multiple line text) in a native language. The actual messages are contained in a flat text file called "mtx.tbl". If the message is not found in the text file then the code is used as the message.
1 parameters:
Code: Message code. Normally this would be
in English (possibly abbreviated).
1 return value:
Message: The corresponding multiple line
message in the native language.
Converts an interval time value to it's corresponding equivalent in decimal hours.
1 parameter:
Interval: The interval time value.
1 return value:
Hours: The corresponding decimal value in
hours.
Converts an interval time value to it's corresponding equivalent in decimal seconds.
1 parameter:
Interval: The interval time value.
1 return value:
Hours: The corresponding decimal value in
seconds.
Converts a decimal time value in seconds to it's corresponding equivalent interval value.
1 parameter:
Interval: The decimal time value in
seconds.
1 return value:
Hours: The corresponding interval time
value.
Converts control character markers (i.e. "^") in a string to their corresponding control character values. In many cases, it is convenient to store strings containing control characters in a viewable and editable format. A standard method is to precede a letter with a caret to represent a control character, e.g. "^L".
1 parameter:
Marked string: A string containing control
character markers.
1 return value:
Control string: The corresponding string
containing real control characters.
Formats a decimal number to a character string of specified length, with specified decimal places. The number is right justified in the string with optional thousands indicators.
4 parameters:
Number: The number to be
formatted.
Length: The resulting string length.
Decimal
places: The desired number of decimal places (must be less than the
length).
Thousands: True or false as to whether thousands indicators should
be included.
1 return value:
String: The formatted number.