SystemClass - System services
The SystemClass provides a number of static functions in order to perform specific requirements. Originally, the class was not intended to be published, but it turned out, that it provides useful functionality. SystemClass functions are static functions that might be called from within C++ or OSI functions,
Moreover, this class is an example, how one may extent the OSI functionality by writing an OSI interface class in order to provide an OSI interface.
When calling SystemClass functions from within OSI functions, C++ types NString and NPath have to be passed as OSI STRING values. Enumerated values are also passed as string values containing the exact enumerator name (case sensitive).
System classes provide several function in order to display progress information. Progress data usually will be displayed on console as well as in GUI applications referring to a progress bar. Similar to system input and output, progress data requests are directed to the context set as application context in the system input/output. When no context has been set, progress data will be displayed on console.
In order to activate progress display, the option SystemIO.Progress has to be set to a proper progress display type. Several sub options allow controlling the way of displaying progress information. More details one may find in Reference documentation/Common ODABA options
There are three functions supported by SystemClass , which might be called in order to display progress information:
StartProgress()
DisplayProgress()
StopProgress()
The example below demonstrates the simple use of displaying system progress. The example below shows an OSI function fragment that illustrates the use of progress display functions.
// process producong progress information (OSI function in ODC_ImpClass)
... fragment ODC_ImpClass::doForFunctions ( ) {
... ::StartProgress("Generate source code file for " + sys_ident,pfunctions.count);
while ( pfunctions.next ) {
::DisplayProgress(pfunctions.currentPosition);
... do something for function
}
... ::StopProgress();
}
ODABA provides some features for supporting number, date and time conversion into strings. Since data conversion is made implicitly in many cases, the way of data conversion can be defined in common format settings. System class provides the following functions for changing format settings.
- 1. Formatting - Number and date time formatting support
- 2. Date/time - Date time functions
- 3. Template - Template support
- 4. Conversion - Data conversion
- 5. Input_Output - System input output functions
- 6. Debugging - OSI debugging support
- 7. Access handle - Provide access handles
- 9. others - Other functions
- CreateDocument - Create document
- Date - Get current local date
- DebugFunction - Get function header
- DebugLocals - Get values for local variables
- DebugParameters - Get parameter values
- DebugVariable - Get variable value
- DisplayProgress - Display operation progress
- FMTChangeDate - Change date formatting
- FMTChangeDecimal - Change decimal point
- FMTChangeThousands - Change thousands point
- FMTChangeTime - Change time formatting
- GetDatabase - Get database handle
- GetDictionary - Get dictionary handle
- GetObjectSpace - Get object space handle
- Input - Get user input data
- IsUnix - Return if the expression host is run on unix or not
- Message - Write line to output area
- Output - Write output to user area
- Pause - Pause number of seconds
- PopOptions - Pop option values
- Print - Write text to output area
- PushOptions - Save option variables
- RandomNumbers - Provide random numbers
- ResetResult - Reset template result
- Sleep - Pause milliseconds
- StartProgress - Start progress
- StatusMessage - Status message
- StopProgress - Stop progress display
- TemplateString - Get template result
- Time - Get current local time
- ToHex - Convert number to hexadecimal string
- ToLower - Convert string to lower case letters
- ToUpper - Convert string to upper case letters
- TraceCounts - - internal feature (not documented)
- TraceMessage - - internal feature (not documented)
- Translate - Fixed text translation
- TranslationLanguage - Set default language for text translation
- UUID - Get universally unique identifier (UUID)
- WriteResult - Write template result to template output area