You are on page 1of 5

The AdaIDE for Gnat Ada95

by Errol Martin (epm@ise.canberra.edu.au)


and Don Overheu
Version 2.5 January 1997
-----------------------This document describes our free, simple, integrated editor/compiler
environment for Ada95 program development using the GNAT Ada compiler.
AdaIDE is an MDI (multi-document interface) style program based on the
Microsoft example in Visual Basic.
Contents:
1.
2.
3.
4.
5.
6.

Quick Start Installation for Win3.1 or Win95


Description of AdaIDE
Changes from version 2.4
Using the Debugger
Using the Error Listings
How to talk to us and get upgrades.

1. Quick Start Installation for Win3.1 or Win95


----------------------------------------------1.1

You should download, (ftp or whatever) the correct zip file.


Zip file a25win95.zip is for Windows95.
Zip file a25win31.zip is for Windows3.1.

The win95 version unzips to two directories, disk1 and disk2, and the
win3.1 version unzips to three directories, disk1, disk2 and disk3.
These are standard Microsoft style installation sets, which you start
by executing a file 'setup.exe'. The default arrangement for the
setup is that the application will be installed in a directory called
adaide25, and the application executable is called either adid3225.exe
(for win95) or adaide25.exe (for win3.1). Note that the
subdirectories correspond to installation disks. If you execute
setup.exe from the subdirectory disk1 then all the files should be in
the same subdirectory.
1.2 The installation disks look formidable, with all sorts of special
Visual Basic files which you may already have on your system. Our
understanding is that the setup process will not copy these systems
files if you have the same or a newer version. The only files we have
created are:
The application executable: Either adid3225.exe or adaide25.exe.
The help files: adaide25.hlp, adalrm95.hlp, gdb.hlp and make.hlp
1.3 This only sets up AdaIDE, not the GNAT compiler. You have to do
that separately, and be sure the GNAT path and other environment
variables are set up before running AdaIDE.
This version of AdaIDE works transparently with the gnat304a release
of gnat for win95 or the ez2load version of gnat 3.05 for MS-DOS
(which also works in the win95 environment).
1.4 The system has some on-line help, including a Windows help version
of the LRM and the GNU debugger GDB. The rest of this document

provides additional information.


2. Description of the system
---------------------------This version is an upgrade to AdaIDE Version 2.4 which was designed
only for Windows 3.1. This release comes in either a 16 or a 32 bit
version. The essence of AdaIDE is that it is designed to be simple to
use, e.g. in a University laboratory environment. Main change is to
the .ini file. Under win3.1 the ini file is now adaide.ini and is
stored in the windows directory, ie. c:\windows typically. The ini
file used to be stored in the same directory as the .exe file. Under
win95 the ini information is stored in the registry of course.
AdaIDE is a multi document interface (MDI) program based on the
MicroSoft example in Visual Basic 3.0. It has been modified to suit
the requirements of an integrated development environment for Gnat
Ada95.
For the 16-bit version, which uses the MS-DOS GNAT compiler, working
in the Windows environment takes about 8K more of conventional memory
than working from the DOS prompt. More importantly, there may not be
as much dpmi memory available when Windows is running.
The whole operation of the MS-DOS version of GNAT depends on having
plenty of dpmi memory available (see djgppfaq.txt in the docs
subdirectory of the gnat system), so this may slow down the Gnat Ada95
operations to some extent -- but not significantly for small programs,
we find. We have used AdaIDE to compile, link and run a suite of
programs comprising about 7000 lines in 13 modules, as well as all the
examples in the Gnat distribution, and many other individual example
programs.
Note: The ADAIDE system assumes that the Gnat system has been
installed
The fundamental change to the MDI example has been to require that
there is always a child form present. If no file is currently loaded,
the first child form is made an untitled #1 form.
A second change has been to remove the simple list of fonts in favour
of the Dialog Box capability in Visual basic. The inclusion of a
choice of fonts may seem marginal but is useful for those who prefer a
larger size text in the display.
The third change has been to introduce a "Change" and "Find Previous"
capability into the "Search" menu selection. This allows for both
verified change and a "Change All" capability.
Finally, an .INI file capability has been added to recall windows
sizes, and to maintain a recently used file list.
All action associated with Gnat Ada operations is implemented by
shelling out to DOS and running a batch file with the compiler
commands. The result is exactly what you could do by hand, either
without Windows running, or by starting a Dos Prompt within Windows
and then running the compiler at the command line prompt.

Only the simplest command line arguments are used. However there is a
menu option to change the arguments to the command line. To do this
you would first need to have studied the file 'gnatinfo.txt' supplied
with GNAT.
Additions and Changes to the MDI
-------------------------------The following additions have been made to the File menu choice:
a. An Ability to print the contents of a form. The retention of a font
facility is useful for this addition which also uses the Visual Basic
Dialog Box capability for print options.If a font is not selected, the
default printer font is used. An Ability to determine margins has not
yet been included
b. An Ability to shell out to a DOS prompt. (This may cause a memory
problem if used for Gnat operations but should be protected by Windows
since DOS applications are run in a window.
c. No change has been made to the MDI entry for Edit
d. The MDI "Search" menu has a "Change" selection added with either
verification before aa change is made or a "Change All"
capability. This has meant some significant changes to FIND.FRM and
MDINOTE.BAS as well as additions to NOTEPAD.FRM. Also added is a "Find
Previous" capability
e. The MDI example has been considerably modified to ensure switching
of the directory name when a file is loaded from the Recent Files list
or when a 'Save As' operation occurs or when switching from one
displayed document to another. A section has also been added to the
INI file to save automatically the last directory used and restore it
on a restart.
f. The 'Run' entry causes the compiled and linked program to run
g. The 'Compiling' entry has three choices:
(i)
Compile -- See the ADAIDE Help for details
(ii)
Link -- See the ADAIDE Help for details
(iii) Syntax Check -- See the ADAIDE Help for details
h. The 'Make' entry has three choices:
(i) GnatMake
(ii) Make which has -k on its command line and depends on how
the user constructs the make file
(iii) Rebuild which uses the Gnat supplied Make file and will
operate on the files in a whole directory
i. The Options entry has two sections. The first part covers
switches for Debug, error output control and listing to a .LSB or .LSS
file, non-interactive output selection and switching of the
toolbar. The use of these is explained more fully in the ADAIDE Help
file. The second part allows the user to bring up a secondary window
which enables changes to be made to the default values of the command
line switches or to set Fonts either for the screen or the
printer. The fonts available depend on what is installed in the
version of Windows in use.

j. The Windows
(i)
(ii)
(iii)

entry has three options


Cascade As provided in the MicroSoft MDI Sample
Tile_Horizontal As Provided in the MicroSoft MDI Sample
Tile_Vertical Added

k. The Help facility has these options


(i)
About ... Who's responsible for this mess.
(ii)
ADAIDE Help... about this program
The current data relating to the last four files selected and the
sizing of the MDI form is kept in a file called ADAIDE.INI. The system
automatically creates this file when it is first used and updates any
changes to it. No harm can result if it is accidentally deleted, since
the system will use default values on start up and re-establish the
file on exit. The changes made to automate the saving of files prior
to a GNAT operation and the recovery of the directory and file name
after switching between documents in different directories has been
introduced to overcome the need to manually save changes made to a
document prior to a GNAT operation and the need to manually recover a
directory and file for the currently active document through a Save As
operation. The first of these changes does not absolve the user from
saving a document if a GNAT operation is not selected. Note that the
first change does not apply to selection of a Run, Link or a Rebuild
operation and in the second case to the Rebuild operation only.
3. Changes from version 2.4
--------------------------3.1 The .ini file for the windows 3.1 version is now automatically
created in the Windows directory.
3.2 The ADACAPS directory Previous version of AdaIDE used the
excellent LRM help file supplied with ez2load. This version uses a
Windows help file version of the LRM supplied on our installation
disks. This makes installation and maintenance of the registry or
.ini file easier.
3.3 Some bug fixes.
3.4 A limited undo capability
4. Using the Debugger
---------------------Earlier versions of the set up for the debugger used the Compile
operation, after setting the Debug switch, for compiling, linking and
running. This was meant to be a temporary measure while we waited for
an Ada sensitive version of GDB. This is now available in
Gnat3.04. The debug option simply ensures that the -g command line
switch is added for a compilation either under the Compile or the
Gnatmake selection. This causes a Coff file (without the usual
obligatory ".exe") to be produced. When Run is selected with the debug
option 'ON', the GDB debugger is called.---WARNING---For reasons that
are not yet clear (but are perhaps due to the need to swap windows
and/or Gnat out to a disk before loading GDB) it takes some time for
the debugger to load. This can be disconcerting on first use but be
patient, it will happen! The ".exe" file can be present with the Coff
file and the debug switch will allow the user to switch between them
for running programs.

5. Using the Error and Listing Options.


---------------------------------------Please study the Help file entries about these since the available
combinations are complex. They are meant to give the user a choice of
output forms and saving of results. The two switches "Show Errors" and
"List Output" work together and with the command line switches to
provide considerable flexibility. Note that because of the way
GNATMAKE appears to work, no output occurs when there are no errors
and the same source file is run a second time. We have indicated this
by simply showing a blank document or leaving an empty file when this
situation arises. Treat changing entries in the command lies of the
various GNAT operations with care and understanding. We cannot be
responsible if you blow up your work.
6. How to talk to us and get upgrades
-------------------------------------AdaIDE was written by
Errol Martin (epm@ise.canberra.edu.au)
Don Overheu

and

We attempt to reply to all enquiries. We try to ensure that the latest


version of AdaIDE is available at
ftp://ftp.canberra.edu.au/pub/ise/adaide/
We are now at Version 2.5

Happy New Year,


Errol and Don
1/1/97

You might also like