Using SiMPLE To Program In C++


If you're familiar with the C++ language, SiMPLE (versions 3.03 and higher) provides you with the capability of writing either "hybrid" programs (ones that contain C++ statements intermixed with SiMPLE statements), or programs that are written exclusively in C++.

As an example of a program that is written exclusively in C++, let's look at the ever-popular "Hello World" program that the writers of C++ tutorials are always so fond of using:

            // My first program in C++
            #include <iostream.h>
            int main ( )
            {
               cout << "Hello World!";
               return 0;
            }

Let's choose to name this program "HELLO". So, on SiMPLE's command line, type:

            EDIT HELLO.CPP

This will bring up the familiar "blue screen" text editor into which you can type the source listing.

When you are finished (and have returned back to the "black screen"), type:

            COMPILEC HELLO

on the command line to create the object file for the program.

Next, type:

            LINK HELLO

on the command line to link your program's object file with the required object files in the C++ libraries.

And finally, you can simply type:

            HELLO

on the command line to execute the program.

If you create a "C++ only" program, its name will not appear in the box at the top of the "black screen", because that box displays only the names of your SiMPLE (and hybrid) programs. (However you can view a list of all the C++ source code files in the project by typing: DIR *.CPP on the command line.)



  [ Webmaster | FAQ's | Home Page | Contact Us ]