Home Why Omnibasic Features FAQ Examples
Reviews Keyword/Syntax On-Line Manual Download Manual ScreenShots

Chapter 1

Getting Started

OmniBasic™ Installation Notes

 

Windows Based Systems

If Disc does not autorun, go to directory of disc, double click Setup.exe

 

Linux Systems

There is no automatic installation for the Linux version at this time, so copying the obw directory (folder) to / is required. Also, to run the IDE, invoke a shell (Term) window, type cd /obl followed by ./obide

Getting started with OmniBasic

When you start the OmniBasic program the first screen that you will see is shown below.

When starting the program the only options available are the “Create New” or “Help”. First, you click on “Create New”. This will bring up the splash screen that allows you to select the type of project that you wish to work on.

There are three types of projects. They are:

1.    Graphical Project – A graphical project will enable all of the features of the IDE so that you can quickly build a graphical screen with objects and build the program in a modular format. A graphical project is designed to operate as an interface to the user in the windowing environments of the operating system that you are using. A graphical project creates a file with the .obp extension. This file contains all of the information necessary to recreate the visual representation of the objects on the main form. When you compile a graphical project the IDE will create a .bw extension which is a pure OmniBasic representation of what was created on the main form along with the program that was entered by the programmer. The other file that is created when you compile an OmniBasic Program is the executable program that will have a .exe extension in Windows-based programs and no extension in Unix-based programs. This executable program is the end result of your compile, the finished product. To run your program, you can enter a text window and type the name of your program with the correct path and no extension and watch it run. You can also access your program from a file viewer or from a desktop shortcut.

2.    Console Project - A console project is a non-windowing, non-graphical project that can be run in a text window or used as a background program. The OmniBasic Compiler is an example of a console project. It is “called” by the OmniBasic IDE, which is a graphical project. It is still a 32-bit protected mode executable and so it must run in a Windows or Unix environment. It may look like a DOS program, but it is not. Standard DOS programs are 16 bit real address mode applications. If you need to create DOS programs you may want to consider the OmniBasic Legacy product that does have a DOS port.

3.    Graphical Script Project – The graphical script project allows the programmer to write a graphical based program without using the ‘drag and drop’ form building features of the IDE. You will not have a graphical representation of the form available to build your display but you will be free to use all of the features of OmniBasic to code your program. The Graphical Script project is available for the purist. In this mode, you will only create a .bw file and when you compile, an executable file.

Creating a simple graphical program.

On the splash screen, we will select the Graphical Project. This will bring up the Control Center, the Edit Window, the Properties Window, and the OBMain form. Use the Control Center to place objects on the OBMain form. Use the Properties Window to change the properties of the objects on the OBMain form. These properties are then used to automatically create the OmniBasic Code for the Objects that exist on the OBMain Form. The Edit Window is designed to allow you to create and edit the text portion of your program. In order to assist the programmer, the Edit Window allows the programmer to write the program in four different modules. These modules are:

Declaration Module – Use this module to hold all of the user defined items: Dimensioned Variables, Constants, Subroutine Names, Function Names, Macros, and Library invocations.

Initialize Module - The Initialize Module is used to set starting values for the variables used in your program. The code that resides in this module runs once at the start of the program.

Function Module – The Function Module is used to store any Subroutines or Functions written in the program. The code written in this module is “called” from programming in the Event Module or the Initialize Module.

Event Module – The Event Module is where the most activity takes place. The objects that are placed upon the form and even the form itself can have events. An event is an action initiated by the user of the program. A ‘Click’ event is a typical event that causes a section of program code to be executed when a user ‘clicks’ upon a given object. Graphical-based programs in OmniBasic are event-driven in that a section of code is run only when an event takes place. All of the event code is stored in the Event Module.

A fifth module, the Construct Module is a ‘view only’ module that shows the programmer a snapshot of what is constructed on the OBForm.

Once the Control Center is displayed, you can place an object from the dispenser onto the OBMain form window by double clicking on the object.

When you double click on the object, it will be placed upon the OBMain form. Once the object is dropped on the form it will show up in the Properties Window as well.

 

 

The Properties Window displays the object properties that will be used as the default values for the object in the OmniBasic program. As you adjust the size and position of the object on the form, the Properties Window will update with the current information. You can use the Property Window to change the color of the object or the text on the object. You can also change the name of the object as well as the text and font information. All of the properties are used to generate the OmniBasic program on the Editor Window in the Construct Module. The Construct Module will give you a ‘snap shot’ of the object based code that will be generated when you compile the program. Since this module is generated based upon what is on the Form, you cannot modify the information in the Construct Module.

The first section of code in the Construct Module will be the programming required for the main window. This main window is always named OBMain. The position displayed in the program is the position of the OBMain window on the screen. Either grabbing the edge of the form and adjusting it or entering a new value into the Properties Window adjusts the size. The other properties, which are enabled, backcolor and text heading on the window are configured by adjusting the values in the Properties Window.

The second section of code in the Construct Module is the programming generated when we dropped the button onto the form by double clicking on the button icon in the Control Center. All of the properties can be adjusted by the programmer using the Properties Window.

If we want to change the text on the Button called Button1 when the end user clicks on the button, we need to create an event for that object. In the following Event Module we will create a click event that will replace the default value of “Button1” on the button to “Hello World”. All events start with the ObjectName.EventType and end with Exit Event. In between those two statements you can do any OmniBasic Programming you want. When the program is running, this code will be dormant until the user clicks on button1. At that point this code becomes active and will execute. When Exit Event is reached, the program leaves this event and will not return until someone clicks on Button1 again.

After the program is written, you will need to save the program by either selecting “Save” or “Save As” on the File drop down menu; or by clicking on the red floppy that represents ‘Save’ or the blue floppy that represents ‘Save As’ on the button bar of the Control Center. When you save the program, you give it a name using the normal naming conventions of the system you are running OmniBasic on. You do not need to place the .obp suffix on the file name because the IDE will take care of that automatically for you.

After the program is saved, you can compile the program. You have an ‘EXE’ button on the button bar that will create the executable code. When you press that button, the program will create a finished version of the OmniBasic Code into a file with the .BW suffix and then an executable version of the program. When the compiler has finished, the Status Window will pop up to show how the compile went. If all is OK, the Status Window will display “No errors” and an executable version of the program will be saved onto the disk. This program will have an .EXE suffix in Windows-based systems and no suffix on Unix-based systems. If an error exists, the Status Window will display the section and the line of the program that the error occurred in, as well as what type of error has occurred. After a successful compile you can go to a text window and type in the name of the program and it should execute. This sequence of events will work for all of your graphical program developing.

Typing in the above will cause the actual program to run. Be forewarned that the real program window will be placed over the top of the OBMain form that you were editing on if you have left it up. The executable program will be placed on the screen in the same location as the OBMain form that you used to create the program.

Once you have created a program that runs to your satisfaction, you can take the .obp file or the .bw file to another OmniBasic IDE running on another platform, load it in, compile it and you will have the same program available to run on both platforms.

Next Page: Chapter 2

Table of Contents


Home || Why Omnibasic || Features || FAQ || Examples
Reviews || Links || Privacy Statement || Top of Page

 

   Innomation Systems, Inc.

117 Morrison Ave. Morrison, MO 65061 (573) 294-6130

OmniBasic is a trademark of Innomation Systems, Inc., other trademarks are the property of their respective owners.
Innomation Systems, Inc. reserves the right to change prices and specifications without prior notice.
Copyright © 2000, 2001, 2002 Innomation Systems, Inc.