Overview
- What Is C++?
- C++ is a recent mutation of C, generally known as 'assembler with
objects'. Okay, perhaps a bit unkind. C++ is widely used, combines
the generality of C with solid object-orientation. It's the language
of choice for Windows GUI programming.
- Portability
- C++ is pretty portable. C++ compilers are available for most
platforms, but you may find that the main reasons for using C++ -
class libraries - are not portable.
- Pros and Cons
- Pros: C++ is powerful and widely known; it is object oriented.
Cons: it's a large language to learn.
- How To Get It
- I guess most C++ users know the answers to this.
- Libero Supports
- Standard C++.
Working With C++
- Schema: lrschema.cpp.
- Program model: Class named after the program: entry point
is a member function called 'execute'; you can change this.
- Good for: not really sure. We'll see.
- Files used/made: own work in myprog.cpp; generates include
files mydialog.h and mydialog.i. You also need the
prelude.h header file at compile time.
- Module functions:
MODULE Cprogram::module_function_name (void)
- Private functions:
type Cprogram::private_function_name ()
()
- Naming style: any except -style=cobol.
- Limits: standard Libero limits. All tables are defined
statically in the myprog.i file.
- Development cycle: run lr after changing the dialog. If
you add new modules, update the .cpp program. Compile, link, and
run. You need the .h and .i files at compile time.
You can freely change the .h file to add private data and
functions. Follow the guidelines in the generated code which indicate
where you can change code.
Example of code
Code fragments:
///////////////// MODULE FUNCTION NAME //////////////////
MODULE Cprogram::module_function_name (void)
{
// Empty module needs no code
}
Cprogram::private_function_name (argument,...) {
the_next_event = ok_event;
raise_exception (error_event);
}
A fuller example.
Specific Schema Options
- -opt:class='xxx' xxx is class name. Default value is C$