My First Aurora Program

Computer Programming is a creative process. Some simple programs can be written on-the-fly, whereas more complicated programs will require planning and mapping out. It is beyond the scope of these documents to teach programming methods, but let's look at the process of creating,  saving,  compiling and running a simple Aurora program.

Creating a Simple Aurora Program

Now let's start programming.

Start the Aurora IDE.

Once Aurora has started, open a new program by selecting from the main menu File and choosing New, then choose Aurora Source File

Type in the following program statements in the new editor window:

  /* first_one.src
     This is my very first program using the Aurora Language and Compiler
     This program demonstrates the minimum commands and declarations to 
     compile and run a console type program.
  */
  global sub main() 
  {
    string text                // this is a variable declaration
    text = "This is my first program"  // this is a variable assignment
    cls();                     // this command clears the screen
    writeln(text+"\n\n");      // this line writes to the screen
    while (GetKey() = "");     // this line tells the computer to wait until any key is pressed
  return;
  }

Notice that the keywords 'global sub main()' are the first non-comments that we have in our program. The keyword 'global sub' tell the compiler and linker that a subroutine named 'main()' is to be compiled and it is to be 'global' (visible) to all other subroutines (if any). All programs contain at least one subroutine named 'main()'. To tell Aurora the extent of the 'main()' subroutine curly brackets (or braces) '{' and '}' are used.

The variable named 'text' is declared as a string variable and assigned a value of "This is my first program". A variable is a storage place in the computer memory created by the compiler to store data (text, numbers, etc.) which matches the variable declaration.

Also notice that the text of the program is in different colors. The Aurora IDE automatically changes the colors of keywords which it recognizes as compiler keywords. It also changes the color of comments and text which is between quotation marks. Subroutines and functions (methods) which are user defined or included in libraries are not highlighted or colored by the IDE.

Saving an Aurora Program

Now that you've written a program, let's save it for future use. From the main menu select File and Save As, then choose a folder in which to save the file and type in a name such as "first_one.src". Aurora program source files should always end with ".src".

Compiling and Running the "first_one.src" program;

To compile "first_one.src" into a machine code executable press the F8 function key or select from the main menu Build and Built Single. The Executable Options dialog box will then pop up. Select "Console EXE" as the Target. The Executable filename will automatically be the same as you source code except with an ".exe" on the end. Make sure that the "Execute after creating" box is checked. Left Mouse click the "Create" button to compile the program, save and run the executable. The program will open a command prompt window and run. Congratulations, you have just written, saved, compiled and executed your first simple Aurora program.


top of page


prev


next