Introduction
NewBASIC is the name of New Deal, Inc.'s visual
builder tool. NewBASIC is designed to rapidly develop applications for New
Deal's line of desktop software. NewBASIC provides the following modules:
- Graphical Forms Builder: this lets you design the appearance of your
application by placing components on forms.
- Component Palette: this palette provides several UI components as
well as components which manage certain system resources and functions.
- System Services: this provides components and routines allowing you
access to several of the more important system-provided services.
- Debugger: the debugger allows you to run your program from within
the NewBASIC Builder, which will catch errors and let you to peek at values
stored inside your program.
- Code Editor: the editor allows you to customize component behavior
by writing BASIC code.
A program consists of one or more modules. Each module consists of Components
and BASIC code; a module is the smallest unit of a program that may be loaded
or unloaded at a time. A typical small NewBASIC program consists of one module.
A larger program might consist of one main module that loads other modules
during times of need, then unloads them to free the memory they require.
You will use the NewBASIC Builder to create modules. You will create and
arrange the module's components and customize it with routines written in
a BASIC-like language.
Components
Components are program objects from which you
build up your program's User Interface and system communications. If you're
familiar with object-oriented programming, you'll feel comfortable with
components.
Each component type has three programmable aspects: Properties, Actions,
and Events.
- Properties are data associated with the component.
- For example, a button component has a caption property; the caption property
specifies which text the button should display. Setting a button's caption
to "Cancel" causes the button to display the text "Cancel."
- Actions are like messages that your module may send to a component,
telling that component to do something.
- For example, calling a dialog box component's BringToFront( )
action would cause that dialog box to come to the front. Actions are something
that you call using your modules.
- Events are the component's way of alerting the module that the component
has detected something important happening.
- For example, a button component generates a _pressed( ) event
when the user clicks it; a power component generates a _wakeUp( )
event when it detects that the device has turned on. Events cause your program
to call module routines. For example, when a user presses a button called
CancelButton, then if the module contains a BASIC routine called
CancelButton_pressed( ), that routine will be called. Note that
events are something that you do not initiate yourself.
NewBASIC uses a programming language that strongly resembles BASIC. By writing
program routines, you may specify how the module's components work together.
The NewBASIC interpreter will begin these routines at appropriate times.
- Components generate events; they alert the program when they detect
something important happening. When they generate an event, they cause a
BASIC routine to run. For example, when a button called "CancelButton" is
pressed, if the module contains a BASIC routine called CancelButton_pressed(
), that routine will run.
- There are certain routines which will be called at certain important places
in a module's life cycle. These routines will be called when the module is
loaded, unloaded, and on certain other occasions.
- You may write utility routines which are called by your other routines.
We recommend that you follow these steps when beginning to develop a NewBASIC
program:
- Plan your program's layout and program structure, but don't try to plan
everything ahead of time. One of NewBASIC's strengths is that it allows you
to change your program easily.
- Lay out your program's components. Specify their starting properties to give
your program its initial appearance.
- Write the BASIC routines which will customize how your program responds to
user and system input.
- Run your program on the emulator. Use the emulator's debugging functions
to find bugs. Fix the bugs. Repeat as necessary.
- Build your program for use within New Deal Office.
- Celebrate, you've created a NewBASIC program! Take your built version and
put it somewhere where your customers may access it.