Axiant 4GL & Conditional Compiles

Whittall, Conrad Conrad.Whittall@Cognos.COM
Thu, 31 May 2001 21:03:53 -0400


Hi Joan,

The only place that Axiant supports conditional compilation in the
"traditional" PowerHouse sense is, as you have found, in procedural
code...either in screen procedures, or in field procedures.

All other parts of an Axiant screen program are objects with properties --
derived from the non-procedural QDESIGN specifications (such as layout and
data access) in your original PowerHouse source. So far, we have not been
able to figure out how to provide a mechanism that enables the designer to
include, exclude or modify the properties of these "objects" at build time
based on some conditional "flag" -- although we have some ideas that might
make it into a future version of Axiant.

However, if you stop and think for a moment about what conditional
compilation currently achieves in PowerHouse it is really only a way to
create two or more "variants" of a single program (or application). In such
cases you will still end up with two or more "executable" programs...they
simply came from a single PowerHouse source code file (maybe with other
source code files included through USE statements).

Although it would have to be set up manually in the current versions of
Axiant (this is something we are looking to perhaps automate in the future)
you could perhaps achieve the functionality that you require in a few
different ways.

Perhaps the easiest way is to only have one button attached to a command
that calls a named DESIGNER procedure. Then at runtime you simply determine
when the DESIGNER procedure is called which of the alternative courses of
action you want to be performed.

Another way is to perhaps copy each section (data access, form, etc.) of
your program into a library. Assuming that you don't need to remove or
delete anything from these sections for the two (or more) "variants" of your
program (i.e. that any variations are simply changes to properties or
additional objects), set up two applications and create a screen program in
each that inherits the sections that you have now placed into the library.
In one of the programs you could now change ("specialize" in Axiant
terminology) the button in your form...change its label, change what command
it calls, etc. Now you can build one "application" which uses the unaltered
form from the library and results in a program where the button does one
thing, and then build the other "application" where the button in the
program perhaps looks different and does something completely different too
(based on the "specialization" that you performed on it).

By putting common, re-usable, pieces of a program into libraries (or even
hierarchies of libraries) the inheritance capabilities of Axiant can be used
to create variant applications -- where the program objects in the
application container are simply themselves containers that inherit most of
what they need from program sections (or program fragments, if you prefer)
held in libraries, but where certain object properties are "specialized" at
the application level (or some lower library level) in order to modify the
behavior of the programs for that specific "variant" of the program.

This second example is the very powerful scenario that we hope some day we
might be able to at least partially automate in a future version of Axiant
-- in order to help our customers deal with conditionally-compiled
non-procedural PowerHouse code. However, don't hold your breath -- it is an
exceedingly complex thing for us to try to automate, especially when trying
to deal with a legacy of over 15 years-worth of conditionally compiled
PowerHouse source code.

On a different subject, I note that you are moving to Microsoft SQL Server.
If you are not already doing so, I strongly recommend that you use the
generic "ODBC" database access in Axiant to connect to SQL Server 7.0 or SQL
Server 2000 databases. The reason for this is that the Axiant database
access behind the "Microsoft SQL Server" type uses the DB-LIB API, which
Microsoft declared mature when they released SQL Server 7.0. Microsoft
stated that DB-LIB will no longer be developed, and any new features of the
SQL Server product will not be accessible through the DB-LIB interface. We
also have anecdotal evidence from customers that the ODBC interface (at
least to SQL Server 2000) performs much better than the DB-LIB interface.
Hence, for accessing SQL Server 7.0 and SQL Server 2000 databases Cognos
recommends (and in future will only support) using an ODBC database
connection.

Best regards,
Conrad

Conrad Whittall
Marketing Manager, Application Development Tools
Cognos Incorporated, 3755 Riverside Drive, Ottawa, Ontario, K1G 4K9, Canada

Developer productivity never goes out of style!

For details of the Cognos PowerHouse family of high-productivity
development tools for Web, Windows and terminal-based business
applications, and to request your own free copy of our new product
demo CD, simply click here http://www.cognos.com/powerhouse.


-----Original Message-----
From: Joan Conniff [mailto:joan@intertechsystems.com]
Sent: Thursday 31 May 2001 09:59
To: powerh-l@lists.swau.edu
Subject: Axiant 4GL & Conditional Compiles

We are converting a Powerhouse application from HP3000 to Axiant/SQL Server
on Windows 2000.

We have conditional compile code throughout various screens.  If the
conditional compiles are in the screen procedures tab we don't seem to have
any problems.  We do, however, have some conditional code that has come up
on the Layout of the screen in Axiant.

We cannot seem to get this code to work on the Layout.  Axiant has turned
the code into a comment line.  Does anyone know how we can make use of this
code within the Layout tab?  We have two buttons that display under one
condition and a different button display under a different condition but are
not able to get this to work.

Thanks in advance for any help.

Joan Conniff
Intertech Business Systems
(780) 413-0400