Getting to uniPaaS How to get from here to there

Getting to uniPaaS
How to get from here to there
By Heidi Schuppenhauer
Getting to uniPaaS
With apologies to Robert Burns
Should old long programs be forgot
and never brought to mind?
Should old long programs be forgot,
or be brought up with time?
For uniPaaS, my mate,
For uniPaaS we cheer!
We'll take a new conversion yet,
For uniPaaS is fine.
And surely you'll buy your pint cup!
and surely I'll buy mine!
And we'll take a cup o' Guiness yet
For uniPaaS is fine.
Should old long programs be forgot,
or should they be made new?
With uniPaaS the answer's clear
by the time, you start, you're through.
1
Welcome to uniPaaS!
4
1
Getting Started in eDeveloper 10
Welcome to uniPaaS!
Magic Programs just keep going and going ...
Magic Programs never give up. After all these years, I'm still converting programs from V5
... no, even V3! ... into the latest version, which is now uniPaaS. Thing is, those old
programs still work. How many programs do you know from the 1980's that still work?
And it's not even that hard to convert them, as you'll see.
However, you can waste a lot of time doing conversions. The first few I did took many,
many hours. Then I got smart. Now they don't take long at all. So, here are the tricks that
I've learned, in hopes they help you.
1.1
Before you Export
In general, it is easier to work with the application in the newer versions of Magic. The tools
are better: you have nice things like good cross-referencing and better error checking.
© 2010 Enter your company name
Welcome to uniPaaS!
5
However, there are a few things you should so before you export, or your conversion might
fail entirely. These principles apply no matter what version you are currently on.
Make sure you have all the Rights
This may seem intuitively obvious, but it's a common cause of conversion problems. You
may be able to work fine with the application, but be missing a Right to, say, the menus.
Any item you do not have a Right to will not be exported.
Make sure you have good backups
OK, this may seem obvious too. But it is very likely you will need to go back to "the original"
at some point for reference, if not recovery. Have your backup control file in some place
that is really easy to reference. Back up early and often!
Delete unused items
If you have items you know are unused and unneeded, this is a good time to get rid of them.
Do a syntax check
Before you export, do a syntax check on each of the repositories: types, files, programs. Fix
any problems that may exist.
Export the application, then re-import it
Exporting and re-importing will fix some internal errors that may exist. Or, if the export or
import crashes, you will know there is a corrupted program that you need to fix (or lose).
1.2
Reading This Section
You probably won't need all the steps I'm showing here. It depends what version of Magic
you are currently running. Originally this material was in several different books, but I'm
including it all here for convenience, and also because you really do not need to know how
Getting Started in eDeveloper 10
6
Getting Started in eDeveloper 10
to convert from 7 to 8 to 9, if you are converting from 7 to 10. The intermediate steps aren't
needed, except for a simple export/import.
Before you start though, you should read the "Migration" materials that come with uniPaaS.
Those will be updated with whatever current changes exist. Then, start with your current
version:
· If you are in V5, start with Exporting from V5.
· If you are in V7 or V8, start with Export From V7.
· If you are in V9, start with Exporting From V9.
Some of the examples that follow assume you exported from V5. That is because, it is the
hardest case. If you can convert from a DOS program, converting from V7 is easy!
Also, some of the screen prints are from V9. This is because some of this material was
adopted from a "Conversion to 9" document. The differences are minor, but, since you all
are programmers, I know that you are attuned to minor differences. That is what we do.
This section assumes you know the basics of how uniPaaS works, which was covered in
the previous section of this book. If you don't, spend some time learning it before you
change your programs too much. Work with some simple programs with 2 or 3 fields,
before you try to figure out why a DOS program from 15 years ago acts differently in
Windows. Most programs will convert nicely, but the ones that don't require some learning
on your part.
© 2010 Enter your company name
2
Exporting From V5
8
2
Getting Started in eDeveloper 10
Exporting From V5
The first step is to export your application from V5.
2.1
A V5 Application
Here is a typical V5 application.
Note that all the text is fixed (this is DOS, after all). The "buttons", in this example, are not
buttons at all, just prompts to tell you which hot keys to press. (There are usually hot keys
that don't show up on the screen too, because of limited real estate).
The text, however, is very easy to read. There is a nice thick bar showing what line we are
on. The keyboard is really easy to use, and the user does not need a mouse. The menu stays
up all the time, so it's easy to find stuff.
Your users will be used to these features. We will show you how to get into Windows
without losing the more useful DOS features.
© 2010 Enter your company name
Exporting From V5
2.2
9
Doing the Export
Export the application as you normally would. Name the export something meaningful, in
case you have to go back to it, and save the name somewhere for reference. We named
ours "V5All.Exp".
It is often helpful to do the export in "pieces", doing the Types, Files, and Programs
individually.
Remember that in V5, you can't have file names over 8
characters long.
2.3
Report Generator Programs
There is no upgrade for the Report Generator programs. If you have any of these in your
V5 application, they will have to be rewritten.
Getting Started in eDeveloper 10
3
Importing into V7 or V8
Importing into V7 or V8
3
11
Importing into V7 or V8
You can't jump from V5 directly into V9. You have to import into V7 or V8 first.
You do not need to work with the code much in V7 or V8. It is only an intermediate step. If
you don't have a copy of either, you can have someone else do this step for you and send
you the exported version.
3.1
Doing the Import
When you do the import, be sure to select Import 5.xx 4.xx.
Getting Started in eDeveloper 10
12
Getting Started in eDeveloper 10
The Optimization type is critical. We'll show you the effects of the optimization type in the
next section. You will want to import it with Optimization As is, which we will explain
below.
3.2
Effects of the different kinds of imports
This is the most critical part of the conversion effort. The problem is, when you go from
DOS to Windows, the fonts and colors are handled very differently.
Fonts
DOS programs use a fixed-width font, and there was only one font. When these programs
are imported into V7 or V8, the spacing just doesn't work well. So you can spend hundreds
of hours just reformatting the forms to look decent.
Colors
Another issue is color. DOS programs used a lot of color, partly to make up for the lack of
fonts. Some colors were used as "invisible" colors, to make a field look like it had
disappeared.
Color usage is not affected by the import into V7. It is affected by the import into V9, and
we will cover it there.
Reports
One very important factor is that the V5 reports include font information in the report color.
In this example, each color represents a printer command. Also. note the graphical lines.
© 2010 Enter your company name
Importing into V7 or V8
13
Now, it may make sense to convert all the reports to GUI, but in real life, that just isn't
always practical. These old reports can work just fine with Windows and newer printers,
using 3rd party tools.
3.2.1
Import 3D
Getting Started in eDeveloper 10
14
Getting Started in eDeveloper 10
Here is what
happens when we
import the screen as
Optimized 3D.
Note that the list is
far smaller. The text
does not fit well, and
some of it is cut off.
The reports have
retained their colors
and print attributes,
but have lost their
graphic lines.
© 2010 Enter your company name
Importing into V7 or V8
3.2.2
15
Import 2D
If we select to import
optimized 2D, then the
fields are cramped. Much
of the text is cut off.
The print attributes are
intact. However, all the
graphical lines are gone
from the reports.
Getting Started in eDeveloper 10
16
3.2.3
Getting Started in eDeveloper 10
Import AsIS
Now, suppose we
import As Is.
Here, all the text fits.
It is in a fixed font,
which is a little oldfashioned looking, but
it works.
However, the graphic
lines all look like weird
A's and little 3's.
© 2010 Enter your company name
Importing into V7 or V8
17
So what is the solution?
3.2.4
Using Letter Gothic Line
The answer is: use a
font that works like a
DOS font.
Because there was
only one font in the
DOS days, all your
forms will, when you
import them, use
Font 7. So all you
have to do is import
As Is, and make sure
Font 7 will display
graphical lines
correctly.
Fortunately one such
font exists, and it's
free. It's called
Letter Gothic Line,
and is included with
this class. Just drop it
into your Windows
Font directory.
Getting Started in eDeveloper 10
18
Getting Started in eDeveloper 10
Then, we make sure
that Magic points to
that font as font 7.
And now we are
almost looking ok! All
we need to do is fix
the colors, and the
application will be
usable, if not modern
looking. When we
import this into
uniPaaS, we'll
modernize it too.
© 2010 Enter your company name
Importing into V7 or V8
3.3
19
The Import Log
When you import the application from V5, an import log will be automatically created,
called XXIMP.LOG, where XX is the control file prefix. You want to look at this.
You can fix these issues in V7, or wait and do them in uniPaaS. Usually it is easier to fix
things in uniPaaS. However, the "Expression parse errors" may indicate something serious,
Getting Started in eDeveloper 10
20
Getting Started in eDeveloper 10
such as an embedded special character, or a Right that you don't have.
The Alt-key problem can also be fixed in uniPaaS.
3.4
Export From V7
Once you have imported
the V5 application, check
it over. Make sure you
seem to have everything,
and do a syntax check.
Then export it and reimport it into an empty
control file.
Now you are ready to
export it again.
© 2010 Enter your company name
4
Importing into V9
22
4
Getting Started in eDeveloper 10
Importing into V9
Your next step is to import
the application into V9.
When the "Overwrite
default menus" screen
appears, you might want to
say "No". Although this will
create duplicate entries, the
menu options are different
in V9.
© 2010 Enter your company name
Importing into V9
23
Again, a log will be created, which you should look at.
4.1
Colors and Fonts
If you read the conversion literature for V9, you will see that you are supposed to convert
your colors and fonts in going from V8 to V9.
DO NOT DO THIS. Your V5, 6, 7 or 8 fonts and colors will work fine in uniPaaS. They
won't work in V9, but you don't care at this point, because you aren't going to be running in
V9.
Getting Started in eDeveloper 10
5
Exporting from V9
Exporting from V9
5
25
Exporting from V9
When you export from V9, the main thing
you have to do is the Export for Version
10.x. This creates a file that is ready to be
converted to XML in uniPaaS.
Getting Started in eDeveloper 10
6
Converting to V10 (aka uniPaaS)
Converting to V10 (aka uniPaaS)
6
Converting to V10 (aka uniPaaS)
6.1
The V9 Converter
In the uniPaaS installation directory, is a utility called v9converter.exe. You can run this
from the command line, or create a .bat file to run it.
From a .bat file, the command would look something like:
v9converter.exe -EXPORT C:\temp\test.exp -uniPaaSEXPORT C:
\temp\converted.xml
where -EXPORT is the exported V9 file, and -uniPaaSEXPORT will hold the uniPaaS
XML file. This XML file is what you will import into your new uniPaaS project.
The Converter Utility
However, you don't have
to run this from the
command line. There is a
utility that is installed with
uniPaaS, which gives you
a window interface to the
utility.
Getting Started in eDeveloper 10
27
28
6.1.1
Getting Started in eDeveloper 10
Conversion errors
If there were any problems in the
conversion you will see a list of
errors in the IMP.LOG file. This file
will be located in the directory from
which you ran the V9Converter.
Usually, there won't be a lot of errors, if the programs passed a syntax check in V9.
Disabled functions
Some functions have been disabled in uniPaaS and V9. So you might get some errors about
those.
Other functions have been renamed (CHR() is now AsciiCHR(), for instance), as have
some of the reserved literals (for instance, '3'FILE is now '3'DSOURCE). You don't have
to worry about those, they will be renamed for you.
6.2
uniPaaS Setup
uniPaaS installs very easily, and will be up and running quickly. There are a few areas,
however, where you'll probably want to change the setup before you run your new
application.
You cannot use your old Magic.ini file. There are new settings that are needed to run
uniPaaS. The conversion routine will convert your old Magic.ini for you, or you can
manually move the entries you need.
You can start uniPaaS using one specific Magic.ini file or by using overrides, as was done in
the past. However, if you then open a different project from the overhead menu, you will be
using the same Magic.ini. This can be confusing. In general, it's easier, at least while you
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
29
are working on a program, to use the default Magic.ini as much as possible, and set the few
entries that need changing for each project in the Application Properties or in the Main
Program's Task Prefix.
6.2.1
File Setup
In V3 and V5 applications, the DB File the DB File name was often hard-coded, or, a
logical name was used in the DB File column. Hard-coding a file name is always a bad idea,
and the logical name method doesn't work as well in V9. In particular, if you want to start
using an SQL database, you will need to use a different method, as the path is handled by
the DBMS and the DB File name is only the table name.
Warning!
Some V5 applications still use the V3 method of having NO file
names at all. In this case, the DB Files are named according to
the Application Prefix and the location of the file. For instance,
our GPUSER file would be named AAFIL002.DAT.
This is very dangerous! If the file is moved within the File
Dictionary, it will automatically be renamed, sometimes with
very strange results.
If you come across an application like this, the first thing you
should do is to give each DB File a meaningful name. Or at
least enter the current V3-style name (such as AAFIL002.DAT)
into the DB File column.
Getting Started in eDeveloper 10
30
6.2.1.1
Getting Started in eDeveloper 10
Setting up the Logical Name
The Logical Name in uniPaaS can be the same is it was in V5. The Translation column is
the actual database location, and can be either a relative or absolute path.
Then, you can user your logical name in the Databases repository, to set the position of the
ISAM database.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
31
Alternatively, you can use the built-in %WorkingDir% logical name to point to the current
directory. This is particularly useful for testing, as you can have many different projects
going and don't need to set up different logical names for the data on each project.
6.2.1.2
Pervasive Vs. Btrieve
You will notice that there are two DBMS's for uniPaaS: Btrieve, and Pervasive.
In actuality, there is only one product put out by the Pervasive company, which is a DBMS
that can be accessed by either ISAM or SQL. There is no product called "Btrieve"
anymore.
However, you can access the Pervasive database via an ISAM gateway, and it works just
as it always has. In fact, you can still use the new Pervasive product with V5 applications.
MSE has chosen to call this ISAM gateway "Btrieve". If you select it, it will work just like
Btrieve always has in the past. It's a good, solid workhorse.
Getting Started in eDeveloper 10
32
Getting Started in eDeveloper 10
However, if you choose "Pervasive", then you will be setting up an SQL gateway, which is
an entirely different beast. SQL has it's advantages also, but you need to be aware of the
differences if you are going to use it (and have some familiarity with how it works internally,
which you don't need so much with the ISAM gateway).
6.2.1.3
Setting up the tables
Now, we can use our new Database in the Database column, and remove the reference to
the Logical Name in the DB Table column.
Note how much easier it is to read the DB Table name now!
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.2.2
33
Colors and Fonts
There is no need to convert your colors and fonts. The files you used in Version 8 or 9 will
work fine in Version 10, as "runtime" (application) fonts and colors. For the Internal and
Studio fonts and colors, start with the default files and change them to suit your needs.
There will be a lot of "extra" colors when you do this, because the internal colors will still be
in the file. But you can clean that up later, using the nice cross-referencing that now exists
in uniPaaS.
It is easiest to set up your Application (i.e. Runtime) fonts and colors in the Application
Properties. This is especially true if you work on several Projects at once. It is very easy in
uniPaaS to use one instance of the Studio to access multiple Projects, and each may have
it's own colors and fonts.
The Internal colors and fonts are the ones that will show to the user at runtime for the
Getting Started in eDeveloper 10
34
Getting Started in eDeveloper 10
menus and other items controlled by the runtime engine. I usually leave those alone, and so
only use the default files that come with uniPaaS.
Keyboard mapping I also leave alone these days. In the past I remapped copy and paste,
and the Cancel key, because F2 was too easy to hit accidentally. But the new mapping
works very well. Also, if you do use your old keyboard mapping file, you may get odd
results, since the mapping file won't jibe with the menu shortcut keys at runtime. Also,
uniPaaS has more entries in the keyboard file than previous versions do. If you do need to
remap some of the default keys, you will need to add your changes to the uniPaaS keyboard
file.
6.2.3
The User File
The format of the user file ... the encrypted file that holds user names and passwords ...
changed in some previous version, so your old one may not work. There is a conversion
utility available to convert it. However, unless the file is very large, you might just re-enter
the users. This is a good opportunity to clean up the user file, and to user groups if you
aren't already.
6.2.4
Handy INI Settings
Most of the default INI settings in uniPaaS work well enough for you to get started. There
are a few special ones that are helpful to know about, however.
6.2.4.1
Activate as Enterprise Server
Be sure that Activate as Enterprise Server is set to No. Otherwise, when the application
starts, you will not be able to access any menus.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.2.4.2
35
Preferences
There are a few entries in Settings->Environment->Preferences that you'll want to be
aware of.
Group Checker Messages by determines how error messages are displayed. Usually what
you want is Object, so you can correct one program or task at a time. However, sometimes
you'll want to work with one kind of error at a time, in which case you can choose Type. Or
Object and Type.
Use Windows XP Theme should be Yes, because it looks better. In my opinion. If you like
the old 3D look better, then select No.
Auto Create Task Logic Units, if it is Yes, will create 4 empty Logic units every time you
create a new task (Task Prefix, Task Suffix, Record Prefix, and Record Suffix. This may
make you feel more "at home" at first, but after awhile you may find they just look cluttered.
Also, if you are American, you will want to change the Date Mode on the International tab
to American.
6.2.4.3
MAGIC DEFAULTS
[MAGIC_DEFAULTS]
DefaultDate='00/00/0000'DATE
NullAlphaDisplay='Enter data'
Getting Started in eDeveloper 10
36
Getting Started in eDeveloper 10
NullNumericDisplay='Enter number'
NullLogicalDisplay='Enter Yes or No'
NullDateDisplay='Enter Date'
NullTimeDisplay='Enter Time'
NullMemoDisplay='Enter Text'
NullBlobDisplay='Enter Blob here'
uniPaaS by default will use a default date of 01/10/1901. Since many applications rely on
having the date field initialized as 00/00/0000, this will cause problems.
To fix this, add DefaultDate='00/00/0000'DATE in the[MAGIC_DEFAULTS]section,
as shown above.
6.2.4.4
MAGIC SPECIALS
By default, uniPaaS will create all new tasks with the transaction mode set to Deferred.
This isn't what you may be used to, and it may cause you some confusion, since Deferred
transactions work quite differently from Physical transactions.
To change this default, you need to add a Magic Special as shown:
[MAGIC_SPECIALS]
SpecialDefaultTransactionMode = P
6.3
Modernizing the Code
Once you convert your application to uniPaaS, it will probably run pretty well. In the
conversions I've done, very little work was needed to actually get them running in uniPaaS,
and most of the errors that we found were actually from programs that were poorly written
to begin with. So you can probably ignore most of this section and be ok.
However, sooner or later you'll probably want to "modernize" your code and take advantage
of the new features in uniPaaS. So we'll give you some pointers on how to do that, in this
section.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.3.1
37
Results of V5 import
If you imported from V5, and used Letter Gothic Line, you can see that the programs
actually look and work OK in uniPaaS.
On the positive side, there is very little color in uniPaaS, so the fact that the colors are still
off doesn't really show. Also, note that because we are using Letter Gothic Line, the
graphic lines are ok.
On the other hand, the table bar doesn't show up, which will drive the users nuts, and the
screen looks old fashioned. The hot keys will still work, but the Windows users will expect
push buttons.
You can fix all this by adding Field Models and changing the default Table type, and adding
push buttons. Most of the work you'll be doing will be on the Form.
6.3.2
Number the programs
The first thing we do is to add a number into each of the "Public Name" fields.
Getting Started in eDeveloper 10
38
Getting Started in eDeveloper 10
This is to allow us to backtrack to the original version if needed. Typically when you convert
an old application, there is a lot of deadwood, and the programs are disorganized, so you will
want to start organizing them into folders and grouping them, and deleting the unused ones.
However, such reorganization makes it difficult to go back to the previous version.
So the first thing you do is add a sequence number to the Public Name column. These are
numbered one off because there is a new program in V9, the Main Program, which throws
the numbers off by one.
6.3.3
Make a copy
After the programs are numbered, make a copy of the entire set of programs, and put them
in a separate folder (you'll have to add a character to the Public Name too, or you'll get
syntax errors). Call that separate folder "Originals".
Sure, you could export the programs and keep a backup that way. However, by having a
copy of each program in this Project, the references to Data Sources and Fields and Models
and other Programs will be kept intact as you work with the originals. This allows you to
easily backtrack, if you ruin a program, or to double-check and see if the error that crept in
was something you did or was there all along.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.3.4
39
Delete extra Programs, Models, and Tables
Next, we delete the unused items. Why bother converting something you don't use?
You can easily get rid of your extra programs, files, and models by using the Magic
Optimizer product from Ocean Solutions. Optimizer will also help you find potential errors
in your control file. It is very easy to learn and intuitive to use, so we won't cover how to run
it here. Basically though, you export your control file, then ask Optimizer to find the unused
objects, which it lists onscreen as shown below. You can print the list too, if you'd rather
have a hard copy.
First, get rid of the unused programs.
Then, export your application again, and run Optimizer again. You'll have more unused
programs this time, since some of the ones that were marked "used" were used by
otherwise unused programs. You may have to do this a couple of times.
Then, export again and get rid of the unused Tables.
Export again and get rid of the unused Models.
Now, your control file should be pretty clean!
Getting Started in eDeveloper 10
40
Getting Started in eDeveloper 10
When you are deleting items:
Delete starting at the bottom of the Repository. That is, if the
last unused item is #166, delete #166 first. That way, the line
numbers in uniPaaS continue to match the ones in the Magic Optimizer.
6.3.5
Create generic models
In order to simplify converting the screens in this application, you need to get familiar with
the uniPaaS concept of Models. Models allow you to encapsulate the color, font, and other
layout properties of each item on the form.
This is very important, because otherwise you can spend may hours in the GUI environment
making forms look good.
But what is even more important is that once you have the forms formatted, you can change
them all rather easily with models. If the users decide they don't like 3D fields for input
fields, but would rather have 2D input fields ... you can change that in one place and all the
fields will automatically change.
We cover this in our sample application, but we'll give a basic review here.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.3.5.1
41
Field Models
Field Models
First, there are two basic types of models. The models with Class = Field are the ones that
will have been imported from V5. These are your basic data definition type of models. They
describe the data Attribute (Alpha, Numeric, Logical, etc.), and the Picture that formats the
data onscreen.
Getting Started in eDeveloper 10
42
Getting Started in eDeveloper 10
Each Field Model has a set of
Properties. The first few
Properties are very similar to
the Properties in Magic 5
These will import from V5 and
work just like they used to.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
43
However, some of the
properties at the lower part of
the property sheet are new.
With Version 9 and 10 you can
attach more properties to a data
field. This is a great feature: it
allows you to save time by
setting up your data once.
You don't need to to learn all
these features right now
though. Your converted
program will work fine with the
defaults.
One thing you should notice
here, however: note that two of
the fields, GUI display and GUI
display table are in blue. This
means that the default value
has been overridden.
Why? Well, when you imported
the program from Version 7,
uniPaaS assumed you wanted
to keep the Version 7
formatting. Since we just
imported and exported out of
Version 7, the fields will be set
up to use 3-D Sunken (gray)
format, which just looks ugly
these days.
We'll show you how to fix that
in a later section.
Getting Started in eDeveloper 10
44
6.3.5.2
Getting Started in eDeveloper 10
Control Models
Control Models, on the other hand,
concern how data is displayed.
Control models exist for data entry
fields, or for entire Forms.
Control Models will have a Class of
GUI Display for GUI screens, or
GUI Forms for GUI reports.
The Attribute will vary depending on
the Class. For instance, for GUI
Display models, you can choose
Edit, Push button, Check box, List
box, Image, ActiveX, Form, and
more. Here, we are displaying an
Edit field, so we chose Edit.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
The properties of this model determine how
the field is going to look onscreen.
For converting V5 programs, the most
important properties are Font, Color, and
Style.
You can also control the the alignment of the
data, and the multi-line edit controls.
The relationship between Field and
Control models
Here is where it gets a little tricky for people
who are not used to Version 9. In Version 5,
there was only one kind of model, called a
"Type". The Type included information about
the field ... the data type, allowed values, and
so forth ... and also information about how
the data was displayed, such as the color.
However, in V9 this information has been
split into two parts. The Field model holds
information about the data. The Control
model holds information about how the data is
displayed. You can think of the Control model
as being the house that the data lives in.
Now let's look at how to tie the two together.
Getting Started in eDeveloper 10
45
46
6.3.5.3
Getting Started in eDeveloper 10
Tying Field Models to Control Models (COPY)
You can tie a Field model to one or more Control models, to change how the
data is displayed. Not only that, but you can change the display depending on
the context. For example, you might want a field to display as a combo box
when it is on an input screen. But when it is being displayed on a report, you will
want it displayed as a plain text field.
Here you can see the GUI display property ties into a Control Properties dialog. Inside the
Control Properties dialog, you can choose a Model. We use one standard Model for most of
the fields: "Screen: Edit Field". That way, all our data entry fields will look the same, by
default.
6.3.5.4
Other Models
You can create other models too. For instance, here is our Standard Screen model. We will
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
47
use that for most of our screens that interact with the user.
Again, this is just an easy way to standardize our application. Say we format all the screens
with a white background, and then the user decides they want a blue background. It's really
easy to just come back to the screen model, and change the color.
A note on the Screen Font:
It is a really good idea to use your Letter Gothic Line or some
other fixed font for the Font property here. Screens resize
themselves based on the hardware they are being displayed
on, and aspect ratio comes into play there. If you use a
proportional font for the form font, then a field that works fine
on one computer might cut off the text on another computer.
Getting Started in eDeveloper 10
48
6.3.5.5
Getting Started in eDeveloper 10
A basic set of Models
The trick here is to come up with a small set of models that you can use to format most of
your screens. This way, you can get your new application looking good in a minimal amount
of time.
It's tempting to create a large set of models that you can use for any occasion. However,
you really shouldn't need all that many. Remember that in V5, you only had one font and a
handful of colors.
6.3.5.6
Reformatting old Field models
One thing you will want to do with your imported field models is to change the Control
property. The default GUI display for them will be grey 3-D Sunken, which looks rather
ugly.
You can click on the little
property to be chosen.
just to the left of the Style property to allow the default
Or, you can choose a model.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.3.6
49
Logic Units
In the old days, every task always had that nice loop, coded above the Operations. Usually,
a few of these boxes were empty.
Now, you can choose whether or not to have those "empty boxes" show up in your Logic
Units area. To set this, set Auto Create Task Logic Units:
to Task, Record, or Task and Record.
Which one you choose is mainly an issue of personal preference. In my opinion, it is better
not to have empty logic units, so I select No.
6.3.6.1
Conversion of Logic Units
Here is a V9 program. It has the standard layout, with the Task and Record logic units at
the top of the task. Note that 3 of these are empty: they have zero operations. Only Task
Getting Started in eDeveloper 10
50
Getting Started in eDeveloper 10
Prefix has operations, and then only two of them.
Then the program is converted, only the Task Prefix Logic Unit is created (depending on
which options you chose for the conversion). The two Operations are now located right
under the Task Prefix header, making it more readable.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.3.7
Record Main Compatible
Here is the Record Main section of our V9 program. As we know, Record Main doesn't
exist in uniPaaS. So what happens to this logic?
Getting Started in eDeveloper 10
51
52
Getting Started in eDeveloper 10
The answer is, it gets turned into a special kind of logic unit, the Record Main Compatible
Logic Unit. This only exists for programs that were converted from previous versions, but it
works exactly like Record Main did in the old days. You do not have to convert this, at least
not right now. It works fine.
Still, you'll probably want to convert this logic. For one thing, once you get used to it, the
Logic Units are a lot easier to understand and maintain. Second, someday the Record Main
might NOT be supported. So let's take a look at how to convert Record Main into Logic
Units.
6.3.7.1
Reference Lines
First, notice that there are a lot of lines in grey. Those are the Reference lines. They refer
to variables. In the old days, variables were in Record Main, and they were very important
in the cursor flow of the program. Now they are on the Data View tab, and they aren't
important at all in cursor flow. The Record Main Compatible section is a way to bridge the
gap between the two paradigms. These are lines you don't need to convert.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.3.7.2
53
Function Conversion
Another thing you might notice here is that the functions have been slightly converted.
DBDel('78'File)
is now
DBDel('78'DSource)
There are a number of changes that have been done to the literal names, and some of the
functions. These will be automatically converted.
6.3.7.3
Push Button Actions
Here we have a typical push button that you will see in older uniPaaS code. We have a
Start push button. Because it is an older style button, it is triggered with a Zoom action. A
Block operation with Flow Mode = After, causes the Zoom action to work.
Getting Started in eDeveloper 10
54
Getting Started in eDeveloper 10
First, we want to change
how the Start button
operates.
This is an "attached"
button, that uses a
virtual.
It raises the Zoom event.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
55
We change it to raise the
ge.Start event, which is
just a global user event
we have created.
Actually you can use any
event here, as long as it
is easy to understand.
Zoom will still work if
you set it up as a Logic
Unit, but since Zoom is
not something
programmers normally
associate with push
buttons, it is better to
create your own User
Events.
Now, we create a Logic
Unit to handle our Event.
In this case, we create
an Event Handler for ge.
Start.
Getting Started in eDeveloper 10
56
Getting Started in eDeveloper 10
We select the lines that
will be part of our new
Handler.
Then we press Ctrl+C
(or select Copy from the
Right-Click menu).
You can also press Ctrl
+X, or Cut, which will
automatically delete
these lines when they are
pasted.
Finally, you paste the
lines below our ge.Start
header.
Note we didn't select the
Block operations. You
can if you want, but in
this instance they don't
change the processing,
and therefore are not
needed, once the
Operations have been
brought into a Logic Unit.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
57
Finally, we add a Raise
Event Next Field to
simulate the "After"
mode.
We also delete the Block
operations from Record
Main Compatible, since it
appears we don't need
them anymore.
6.3.7.4
Zooms in Record Main Compatible
If you are working on an application that has been converted from previous versions of
uniPaaS, chances are you have some Record Main Compatible sections in your converted
programs.
Usually these tasks have Call Program or Call Subtask operations in the Record Main
Compatible section. These are typically zoom operations. You can tell that they are zoom
Getting Started in eDeveloper 10
58
Getting Started in eDeveloper 10
operations because if they are, the Flow mode will be Before or After.
If the Flow mode is Before, then that means the Call is Before the field it refers to. In our
example, the zoom will happen when the user is parked on Variable B. The programmer
made this more obvious by putting a blank line after variable B, but the blank line is simply a
comment line and doesn't affect the code.
6.3.7.4.1 Converting Record Main Zooms
You should convert these Record Main zooms into something else. Usually you'll convert
them into an Event.
Moving the logic is easy. All you need to do is select the line in the left column (so it turns
black) and use cut or copy. Then paste it into a handler.
Many of the zooms will be for "attached" push buttons. These can be converted using an
internal zoom event, attached to the push button control. Or, you can create more mnemonic
events (such as ge.ADD above).
If the zoom was an After zoom, you'll need to add a Raise Event Next Field to force the
cursor to jump after the user selects something.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
59
6.3.7.4.2 Zooming for details
Also a lot of the zooms you will find in older programs existed to show some bit of detail
about the current screen.
Keep in mind that these days there is more screen real-estate, so you might be able to
display the data onscreen now. Or, you can use a Subform to display the subtask in real
time.
In certain cases, it was necessary to add a zoom to the parent task to make the cursor work
correctly for child tasks. These zooms were never actually used as zoom fields, and they
can just be deleted.
6.3.8
Using Models
One of the main things to keep in mind while you are converting is that you need to use
Models. You can work in uniPaaS without using Models, but you'll be working a lot more
slowly and maintenance will be harder.
Try to set your standard colors, fonts, and Models as soon as you can when you start your
application. But even if you don't know what your standards are yet, use some generic
Models anyway. Have a generic "Form" model, "Table" model, "Edit Field" model ... one
Model for every Control type.
That way, when you decide that say, you want all your Forms to have a blue background, or
you want to use Arial font for all your controls, you can can just change the background on
your master model.
Getting Started in eDeveloper 10
60
6.3.8.1
Getting Started in eDeveloper 10
Attaching Controls to Fields
You'll need to attach Control Models to each Field Model. Then "get rid of the blue" in the
Control properties for each Style.
This can be a bit boring, but once you are done, much of your data will display properly.
You'll still probably have to get rid of overrides on each of the Forms, and attach more
Models, which is what we'll cover next.
6.3.9
Table Conversion Issues
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
61
When you convert Tables from Pre-V9 applications, the header text will be imported as text
controls. Sometimes, they will be located behind the table control, so it may seem as if they
have disappeared.
An easy way to fix this is to select the table and move it down (collapse it a little if you need
more room). Then you can see what the headers were, and can add those headers into the
Column Properties.
6.3.9.1
Attaching Models
You can attach field models to all the fields on a row by:
· First, select all the fields. You can do this by holding down the Ctrl key while you click on
each one. Or, select the entire table, then old down the Ctrl key and click on the lower
area, to de-select the table control itself.
· Then, select the model that you want to apply to all the fields.
It's a good idea to have one control for use on tables, because you'll probably want the
background color to be transparent.
Getting Started in eDeveloper 10
62
Getting Started in eDeveloper 10
You can select one Model to apply to all the fields in the same way. Select all the Columns
by holding down Alt+Ctrl while you click on each Column. Then select one Model to apply
to all of them.
You won't have to select a default table Model though. One is already attached during the
conversion process. You can modify the Model as needed to change the look of your
application.
6.3.9.2
The Table Model
After you convert, there will already be on Control Model in the Model Repository. This
Model is for Tables, and has a Public Name of V9 Compatible Default Table. By default it
might be a 3D-Raised table, but you can change it. (If you use the GUI Converter, it will be
changed to Windows style).
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
Before using the
GUI Converter.
The V9
Compatible
Table model was
3D Raised
After using the
converter: it is a
Windows table.
6.3.9.3
Other Converters
There are other converters you can use also, if you like.
Getting Started in eDeveloper 10
63
64
Getting Started in eDeveloper 10
The Builder Data Converter will convert your V9 data created by the eDeveloper V9
COM, WSDL, EJB, and MCI Builders to an eDeveloper 10/uniPaaS project.
The INI Converter will convert your current INI. This can be useful, esp. if you have a
very complex INI to work with. Again though, my recommendation is to use memory tables
or DBMS tables to hold data, rather than the Magic.Ini. Using tables is more robust and
easier to maintain.
The GUI Enhancer will change the look of your tables and other controls to look more
modern.
Before using
the GUI
Converter.
The Default
Table Control
Model was set
to 3D Raised.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
65
After using the
converter: it is
a Windows
style table.
However, you
can do the
same thing by
changing the
Default Table
Control Model.
6.3.10 Gotchas
Converting to 10 is generally pretty painless, but there are a few issues that sometimes
cause problems during conversions.
6.3.10.1 The Death Star
In older applications, it was common to use a star (Asterisk) as a mask in the Range
property. If you wanted to fetch "All records", you would use a range: From: '*' To: '*'.
This worked just fine in V5, and in fact in V9 it wasn't bad either. But in uniPaaS, it can be
very, very slow. In fact, it will freeze up and cause your application to act as if it were dead:
hence the name of this section!
You should change your programs that use '*' to use CNDRange().
6.3.10.2 Default Date
Getting Started in eDeveloper 10
66
Getting Started in eDeveloper 10
Previous versions used
'00/00/0000'DATE as a date default,
the date that will display if nothing
has been entered. In V9 and
uniPaaS, the default date is
'01/01/1901'DATE. This might be a
problem for converted programs,
which often test for
'00/00/0000'DATE.
You can change this in the Default
value property of your Date model.
Or, you can set it globally in the
Magic.ini
[MAGIC_DEFAULTS]
DefaultDate='00/00/0000'DAT
E
NullAlphaDisplay='Enter
data'
NullNumericDisplay='Enter
number'
NullLogicalDisplay='Enter
Yes or No'
NullDateDisplay='Enter
Date'
NullTimeDisplay='Enter
Time'
NullMemoDisplay='Enter
Text'
NullBlobDisplay='Enter Blob
here'
You can change this globally in the
[MAGIC_DEFAULTS] area of the
Magic.ini.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
67
Once you change the
[MAGIC_DEFAULTS] and restart
uniPaaS, the Default value will inherit
the new Default Value.
(Make sure the model is inheriting the
Magic default: if the property is in
blue, then it is overriding the default.
6.3.10.3 My program won't run
A problem sometimes occurs when you start an application, and, nothing happens. There
are no errors, but the application just doesn't show any screens. It's as if all the windows
have disappeared.
Usually the cause of this is that, somehow, the environment setting, Activate as Enterprise
Server has been set to Yes. An Enterprise Server is an instance of uniPaaS that just sits in
the background and processes requests.
Getting Started in eDeveloper 10
68
Getting Started in eDeveloper 10
6.3.10.4 Program doesn't do anything
One problem that crops up occasionally is that a program will run fine, but the data does not
seem to get saved in the database.
This is usually a problem with Deferred transactions. In a deferred transaction, the data
changes are stored in memory, in uniPaaS. The transactions are then all sent to the actual
DBMS at one time, after successful completion of the entire transaction.
If a transaction is opened in the parent task, then records can be added or deleted in a
subtask, but the changes won't be committed if there was an error or a "Cancel" in the
parent task. Often there will be a "hidden" error, written to the Activity Log but without an
error message to the user, that is keeping the transaction from being committed.
6.3.11 Re-formatting a detail screen
Now let's look at reformatting a simple data screen. Here is our Before shot:
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
69
This is a V5 import. If you were importing from a later version, it will look better.
Let's see what we can do with it.
6.3.11.1 Using the Form Model
First we go to the Customer Detail Form. We open up the Properties by pressing Alt+F2.
Getting Started in eDeveloper 10
70
Getting Started in eDeveloper 10
Th
e
firs
t
thi
ng
we
do
is
to
use
our
For
m
mo
del
.
W
e
sel
ect
the
Mo
del
call
ed
Sta
nd
ard
Scr
ee
n.
Th
en
we
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
71
clic
k
on
the
to
re
mo
ve
the
ov
erri
des
.
All
the
bol
d
blu
e
fiel
ds
will
ch
an
ge
col
or
ba
ck
to
bla
ck,
an
d
wh
Getting Started in eDeveloper 10
72
Getting Started in eDeveloper 10
en
we
op
en
up
the
for
m,
the
pro
per
ties
will
be
the
on
es
we
set
up
in
our
Mo
del
s.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
73
6.3.11.2 What it looks like now
Here is what the form looks like after we change the model. We used a blue background,
partly so it's obvious what fields are already done. Also, we got rid of the those little grid
dots, because we like to use a finer grid and the dots slow things down at a finer resolution.
Getting Started in eDeveloper 10
74
Getting Started in eDeveloper 10
6.3.11.3 Getting rid of colons
Next, we get rid of
the free-floating
colons. Some of the
colons will be part
of the prompt field,
but if there was
more than one
space between the
colon and the text,
the colon will be in
a separate control.
You can select
several controls at
the same time by
holding down the
control key and
clicking on the
colons one by one.
After you select the
items you want to
delete, press the
delete key.
6.3.11.4 Changing prompt text
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
75
Now, we change the field prompts. You can change several of them at a time, by holding
down the Ctrl key while clicking on each field. Then, when you change the properties, it will
change the properties for all the fields at once.
We have a model we are using for all field prompts. We select that model, then click on the
to get rid of the property overrides.
–
Getting Started in eDeveloper 10
76
Getting Started in eDeveloper 10
A note on colors:
Be careful when getting rid of the Color override. If you see a
question mark in the Color Expression field, or any number
other than zero, then the original program used a color
expression. This was often done in V5 to make a field
"invisible". You'll need to analyze these color expression fields
on a case-by-case basis.
After we exit
the Properties,
we press Ctrl
+Shift+R to line
all the fields up
on the right.
Here are the
results so far.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.3.11.5 Changing fields
Next, we do the same thing with the data input fields.
Getting Started in eDeveloper 10
77
78
Getting Started in eDeveloper 10
6.3.11.6 Changing field height
Now, the fields will look better, but they are still too small. We select a group of fields at
once, either by using Ctrl+Click for by rubber-banding them. Then change the height
property by typing in the height we want to use.
If the height property doesn't "stick":
The height property automatically adjusts itself based on the
form's Grid X and Grid Y properties. If you can't get the height
you want, then use a finer grid resolution.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
79
6.3.11.7 Spreading out the fields
Now, we need to
spread out the
fields a little
vertically.
· Drag the
bottommost
fields
down.
· Rubberband one
column.
· Press
to
spread
out the
fields
evenly
up and
down.
· Press
to make the field prompts all the same size, if you want, and Ctrl
+Shift_L or Ctrl+Shift+R to line up fields.
· Expand the input fields as needed.
Getting Started in eDeveloper 10
80
Getting Started in eDeveloper 10
Here are the
results.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
81
6.3.11.8 Group Boxes
Now, in
our
original,
the text
was
organize
d using
graphic
lines to
group
the
data.
Howeve
r, since
we are
bringing
this into
a GUI
environ
ment,
we can
use
group
boxes
instead.
Getting Started in eDeveloper 10
82
Getting Started in eDeveloper 10
We
align the
fields as
we did
with the
nongrouped
fields.
Then
we
create a
group
box,
using
our
group
box
model.
The title
of the
group
box is
the
same as
the title
on the
old
screen.
Then
we use
the link
comman
d to link
the
fields to
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
83
the
group
box, and
move
the
fields
onto the
group
box.
When
we use
our
Models
on our
example
screen,
we end
up with
somethi
ng like
this.
Getting Started in eDeveloper 10
84
Getting Started in eDeveloper 10
6.3.11.9 Memo Fields
It was common
in V5 programs
to rely on F6 or
Zoom to edit
Notes and
memos, with
just a few
characters
visible. In V9,
you can make
nice big memo
fields onscreen,
with scroll bars
if needed.
The V5 data
might have
embedded
spaces in it to
make it fit well
on a fixedwidth box of,
say, 40
characters.
You'll need to
use a program
to parse this
data and
remove the
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
85
spaces.
6.3.11.10 Non-Edit fields
At this point it is good to look at the data, and see which fields are not accessible to the
user. These non-edit fields can use a different model, so there is a visual cue to the user that
the fields aren't clickable.
Here is an example of an edit field.
Here are the same fields with no border, to
show the user the fields are not editable.
6.3.11.11 Multiple Choice fields
Many of the fields that used to be zooms or ranges can now be made into combo boxes.
Fields with ranges are the easiest.
Here is the Status field as it was.
Here is the same field in a Combo box.
All you need to do is:
· Drop a Combo box on the form
· Point it to a variable that has a finite range on it.
Getting Started in eDeveloper 10
86
Getting Started in eDeveloper 10
6.3.11.12 The final result
Here is our new Customer Detail screen.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.3.12 Re-formatting a list screen
Now let's take a look at a list, or table, form. Here is our example before we start
formatting it. This is a V5 import. If you were importing from a later version, it will look
better.
6.3.12.1 Separating the table
First, we use our model for the form as we did in our detail screen example.
Getting Started in eDeveloper 10
87
88
Getting Started in eDeveloper 10
Then, we ungroup the text that is on the table. We do that by selecting the table, then
clicking on the
icon.
Separate the table fields from the table itself by dragging them off.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
Getting Started in eDeveloper 10
89
90
Getting Started in eDeveloper 10
6.3.12.2 Using the table model
Now we change the table properties so the table uses our table model. Type in the values
for title and row height, and shrink down the table so it is quite skinny.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
91
6.3.12.3 Changing table fields
Now, we select the fields that were on the table and attach them to a model. Note that we
moved the fields a little away from the other fields; there were one-character static fields
between each of these that we don't need anymore.
Also make the fields taller if needed, and make them wider too.
Getting Started in eDeveloper 10
92
Getting Started in eDeveloper 10
6.3.12.4 Re-attaching fields to the table
Now you can reattach the fields to the table. Click on each field by holding down the Ctrl
key and selecting each field, from left to right. The order is important, because this will
determine the order of the fields on the table.
Once each field is selected, press the
icon. Your table will then like like the one below.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
Getting Started in eDeveloper 10
93
94
Getting Started in eDeveloper 10
6.3.12.5 Changing table columns
Now, you need to reformat the table columns. To select one column, you hold down the Ctrl
key and click on the column somewhere below the first line (i.e. below where the variables
are).
The column will then turn pink to show it is selected. Once a column is selected, you can
delete it by pressing the Delete key, or modify the column header in the Properties pane.
You will have one extra column to the left; we will go ahead and delete that one.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
95
Multi-line headers
You can have
multi-line headers if
you like. To make a
multi-line header:
· Go to the
Column
title
property.
· Press F6
· Position
the cursor
where you
want the
line break.
· Press
Enter
Pressing Enter
inserts a CRLF.
You will also have
to make the header
taller, by dragging
it's bottom edge.
Moving columns
You can shift columns over by dragging them. If you hold down the Ctrl key while you drag
the column, the data will drag along with the column divider.
And here is our table so far. Now we will delete the extra text, and move on to adding push
buttons.
Getting Started in eDeveloper 10
96
Getting Started in eDeveloper 10
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
97
6.3.12.6 Table row highlight
One of the things you might want to do in uniPaaS is to use the Row Highlight feature. The
highlighting in Windows is not as intense as it was in DOS, so adding an intense highlight this
will help your users.
You turn on Row Highlight in the table properties, so you can do it in the table model and it
will apply to all tables.
Getting Started in eDeveloper 10
98
Getting Started in eDeveloper 10
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
99
6.3.13 Text (not parkable) Push buttons
Many V5 screens have text on the screen that is basically documenting the existence of a
hot key. These are not push buttons, but in the Windows world, the users will expect that
they can somehow click on this text and something will happen.
Worse, there are probably hot keys internal to the program that are not onscreen at all.
These undocumented features make a program difficult to learn.
The easiest way to handle these is to add hypertext buttons. They don't take up much
screen real-estate, and you don't have to add any new events to use them. The user will still
have the hot-key available, but will also be able to click on the button using the mouse. This
section shows how to set these up.
Getting Started in eDeveloper 10
100
Getting Started in eDeveloper 10
6.3.13.1 Adding a hypertext button
To create the push button, just drag the button onto the form.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
101
6.3.13.2 Choosing the Hypertext model
Now, you just need to attach the push button to the model you want to use. In this case,
since the application uses F2 as a zoom key, we have a generic F2=xxxx model that we
use. But we also have a set of standard models, such as F3 = Delete.
These hypertext buttons raise a System event, which means they basically press the key for
the user. In this example, when the user presses the push button, an F2 will go into the
keyboard buffer.
Once we have the buttons done, our screen is complete.
Getting Started in eDeveloper 10
102
Getting Started in eDeveloper 10
6.3.14 Parkable Push Buttons
V5 applications also had their version of "3D" push buttons. These buttons were of three
types:
1. Zoom buttons, which have code in Record main to support them.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
103
2. User Action buttons, which would raise a User Action which was then handled in
the Event section.
3. System or Internal Action buttons, which would raise actions that, in V9, are
called "System" or "Internal" events.
We will cover each of these types of buttons.
Button highlighting
One thing to think about is that the buttons in V5 were very
strongly highlighted. This does not happen with Windows
push buttons; there is very little indication of the cursor
position. If you want the cursor position to show up well in
Windows, use the Text on Image style buttons.
Getting Started in eDeveloper 10
104
Getting Started in eDeveloper 10
6.3.14.1 Zoom Buttons
Zoom buttons in V5 raised a
Return Action of Zoom.
Inside the program, a Block
operation connected the Zoom
to some set of operations.
These sorts of buttons convert just fine. The Block operations will still be in Record Main,
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
105
and the button will convert to a 3D push button. How to do this is covered in Zooms in
Record Main Compatible.
6.3.14.2 User Action Buttons
The term "User Action" in
V5 was not the same as a
User Event in uniPaaS. In
V5 a User Action was
listed in what is now
termed the Internal
Events.
There were only 20 User
Actions, and they were
named numerically. This
makes them rather
confusing to maintain,
since it isn't clear exactly
what "User Action 20"
actually does.
Nevertheless, these push
buttons convert just fine,
and will work as is in
uniPaaS.
If you want to make the
application easier to
follow though, you can
create your own User
Action in uniPaaS and use
that for the push button.
Getting Started in eDeveloper 10
106
Getting Started in eDeveloper 10
6.3.14.3 System Action buttons
System action buttons in V5
have a Return Action that does
something in Magic, but there
is no programmer code
attached to them.
In this example, pushing the
button raises an "Exit" event.
These will convert fine into
uniPaaS. You don't have to do
anything.
6.4
Handling Reports
For the most part, your V5 reports will run OK in uniPaaS. However, there are some
important differences.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
107
LPT1
LPT1 does not work as an output port in Windows XP. In fact, if your program does a
direct output to LPT1, it will freeze up. There are utilities that can redirect LPT1 to a
Windows printer port, but it's better to find all occurrences of LPT1 (including the ones in
batch files) and get rid of them.
PCL Output
A lot of V5 programs used embedded printer codes to output to PCL5 printers. These will
still work in uniPaaS, but you have to be careful how they are routed to the printer so
Windows doesn't embed it's own printer codes.
However, PCL printers are going away, so at some point you have to either:
· Rewrite the program to use GUI forms
· Buy a product such as Swiftview that converts the PCL output to other printer
formats.
There is no easy shortcut to converting PCL reports, which are basically text, into GUI
reports. It may be possible, if the reports use the color print attributes, so convert them into
HTML.
The GUI reports however, are better supported in that they allow you to take advantage of
features such as Print preview and Printer dialog.
6.4.1
Print prompting
A lot of V5 applications have homegrown printer prompting, where a Magic program
Getting Started in eDeveloper 10
108
Getting Started in eDeveloper 10
prompts the user for which printer to route to. These printer tables were entered manually,
and used INIPUTs to change the printer definition in Magic.
In the uniPaaS I/O File definition, there is a feature called Print Dialog. If Print Dialog is set
to Yes, then the user will get the standard Windows printer dialog. This is a great feature,
because it allows the user to route the printer to any kind of Windows printer.
However, you might want to also take into consideration the Print Preview and PDF
functionality. If you do a Print Preview, the user can decide, after the report is displayed,
where to route it. Often the user doesn't want to print the report at all; they just wanted to
view the data, or maybe they only want to print a page or two of it. We'll take a look at this
next.
© 2010 Enter your company name
Converting to V10 (aka uniPaaS)
6.4.2
109
Print Preview
Also, a lot of V5 programs
had a "print preview"
feature, where the output
was routed to a text file and
the displayed. Or, they used
"print to console" as a sort of
print preview.
uniPaaS, however, has a true
print preview function built
in, in I/O Properties, as
shown here. If Preview is
set to Yes (or, you can use
an Expression that evaluates
to Yes), then a Print
Preview of the report will
appear.
However, the PDF facility is
even better. This not only
previews the output, but it
also stores it as a PDF,
which gives you a lot more
possibilities.
Getting Started in eDeveloper 10
110
Getting Started in eDeveloper 10
Index
-Aawards
4
-RRecord Main Compatible
Converting 58
-ZZoom
Record Main Compatible
57