home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
spd_20.zip
/
CUSTOM.DOC
next >
Wrap
Text File
|
1989-03-11
|
11KB
|
248 lines
Hi all you Clarion users out there! What you will find in this
arc file is a modified STANDARD model file from the Clarion
Professional Developer, Batch 2007. Included are the extras
which I have been using for all of my designer-based applica-
tions.
When changing a model procedure, it is recommended that you make
a copy of the original before making any changes. Because I use
the changed procedures most often, I usually rename the original
then create a modified procedure using the original name. For
example, I have made a copy of the original *FORM procedure,
renamed one of them to *NORMFORM, and made my modifications to
the *FORM version. In some cases I have broken this rule if the
change was always desired (ie: remembering menu options [see
below]).
The one convention that I strictly adhere to is the marking of my
changes. All modified lines are flagged with a comment beginning
with two exclamation points (!!). This helps when a new batch
comes out, and you have to figure you where you made the changes.
The changes address three basic areas: adding functionality to
the designer, overcoming Clarion inadequecies, and increasing
error detection. The following list of changes will be presented
in the form of PROBLEM then SOLUTION.
.................................................................
Problem When creating tables in designer, all tables allow the
addition, modification and deletion of records.
Solution Changes were made to the *TABLE procedure to include
three flags (ADD_OK, HOME_OK and DEL_OK). If you wish
to prevent one of these operations, set the appropriate
flag to zero using the setup procedure line on the
table options screen. For example, ADD_OK=0 prevents
the addition of new records to the table.
When preventing addition, two situations had to be
dealt with: preventing automatic addition to an empty
table and preventing the user from adding records by
pressing the INS_KEY. When a table is empty and
ADD_OK=0, a window is opened specifying that there are
no records and the user may not enter any. As well,
when the user presses the ESC_KEY, a beep is sounded
and a warning message is placed in MEM:MESSAGE.
When preventing modification, it is assumed that the
user would still be allowed to view the record.
Therefore, when the enter key is pressed and CHK_OK=0,
the update procedure is called with ACTION=4. I have
also made changes to the *FORM procedure to deal with
this new action code. The designation of "4" to mean
1
"view" is consistent with the table's interpretation of
"4" to mean "lookup and retrieve." In the *FORM
procedure, ?DELETE_FIELD was changed ?PAUSE. The
"view" action is treated the same as the delete
action, except that a different (new) message is
displayed and the record is not processed in any way.
To prevent deletion in the table, the actions are
similar to those performed when a user attempts to add
a new record using the INS_KEY. If the DEL_KEY is
pressed and DEL_OK=0, a beep is sounded and MEM:MESSAGE
is set to warn the user that the delete function is not
allowed.
.................................................................
Problem When a user changes a field then presses the up key,
the newly-entered value is replaced by the original
value and the change is lost.
Solution All procedures containing entry fields have been
changed so that they process the up key without losing
any new entries. As well, the procedures also treat
the TAB_KEY as an ENTER_KEY and the SHFT_TAB as an
ESC_KEY. I have avoided using ALIAS for this reassign-
ment of the tab keys, which enables the programmer to
localize this interpretation of the TAB_KEY and the
SHFT_TAB. The one procedure that does not include this
special treatment of cursor keys is the *MEMOFORM,
because the UP_KEY must allowed for movement in the
memo field, and the tab keys can be handy.
.................................................................
Problem Users sometimes have difficulty pressing CTRL_ENTER
and CTRL_ESC if one of their hands is occupied.
Solution In addition to CTRL_ENTER and CTRL_ESC, the user may
press F10 and F2, respectively.
.................................................................
Problem When the user presses the ESC_KEY from the main menu of
his application, the program exits to DOS and must be
reloaded (a long process).
Solution A new menu procedure called *MAINMENU has been created
that recognizes neither the ESC_KEY nor CTRL_ESC.
.................................................................
Problem When a user enters or returns to a menu, the selector
bar is always located on the top-left option.
2
Solution The menu procedure has been changed so that it remember
the last option selected.
.................................................................
Problem When the user loads the application, he is forced to
wait for an extended period of time (5-60 seconds),
while the data files for the application are being
opened. During this procedure, the user has no idea
of what is happening.
Solution While the files are being opened, a screen is displayed
that states that the data files are being opened, and
each filename is shown as it is opened.
.................................................................
Problem When using the numeric keypad, the user has to reach
across the keyboard to hit the ESC_KEY.
Solution The gray asterisk key (GAST_KEY) is treated as an
alternate ESC_KEY.
.................................................................
Problem When invoking a table with a selector, the table may
only show some of the records matching the selector
field.
Solution This could happen if the key was comprised of more than
one field and the selector contained only some of these
fields. If there were stray values in the fields that
were not part of the selector, the SET procedure may
not locate the first record in the group. The table
and report procedures have been changed to accomodate
this bug. The problem was reported to Clarion after
the release of batch 2007, and should be fixed in 2008.
.................................................................
Problem Many file access procedures are not checked for errors.
This can result in corrupted data files.
Solution Two procedures named CHKERR and GODOS have been added
to the model file. CHKERR is called after each file
access statement that is not normally checked for an
error. If an error condition exists, the program
displays a screen specifying the module name, line
number and error message. After the user presses a
key, the program is halted using GODOS.
Because the module names and line numbers cannot be
determined within a translated Clarion program, I have
created a utility which will mark all occurences of
CHKERR with the module name and line number. It is
called MrkErr and must be invoked in the same directory
3
as your CLA files. It will mark all occurances of
CHKERR in all of the Clarion source files in the
default directory. You may specify a directory mask to
limit the number of files processed. You should run
MrkErr before compiling the source code. During the
defelopment stage, this is not always necessary, but
during debugging and after distribution, CHKERR is an
invaluable asset.
The only text allowed on a line after CHKERR is a
comment preceded by a exclamation point. MrkErr was
written in C, and the source code and executable file
are included in the ARC file.
.................................................................
Problem When printing long reports, there is no way to stop the
report, except turn off the machine.
Solution There has been a screen added to the report model which
states that the report is running and the user may
press Esc to exit. The inner loop of the report
monitors all keys. If the user presses the ESC_KEY,
the report will stop. All other keys are ignored.
I hope these changes are useful to other Clarion users. If you
have any comments, questions or complaints, please feel free to
leave me a note on the board. Happy CLARIONing!
-=> Mike Hanson <=-
4