![]() | Setting Up the Configuration File | Key Code List | ![]() |
This chapter provides answers to some questions that people unfamiliar with Dialog System typically ask. Each answer includes a detailed description with step-by-step instructions for solving the problem.
Also, your Dialog System software includes some screensets with sample solutions to each question. The names of these screensets are question-number.s, for example, q1.s, q2.s, and q3.s.
The subjects covered by the questions are:
Q1.:
How do I define how validation messages are
displayed when an error is found and removed when the error is corrected?
A.:
The display and removal of validation messages is
completely automatic once you make the relevant definitions. Use the following
steps:
Key Function Parameters
TAB SKNF 0001
BTAB SKPF 0001
This screenset is now ready to run (see the chapter Running the Screenset for details on running screensets). You can compare your screenset with the sample provided in q1.s.
Q2.:
How do I define just one panel in which all of my error messages can
appear?
A.:
This is a common requirement. The previous example
explained how to place the error message field on the relevant panel, which you
could do for every panel. However, it is also quite straightforward to create
a separate panel. This example continues on from the example in Question One.
Use the following steps:
Key Function Parameters
ESC POP
ANYO RPKY
POPKey Function Parameters
ERR PUSH $NULL
CON
GOP ERRORThis screenset is now ready to run (see the chapter Running the Screenset for details of running screensets). You can compare your screenset with the sample in q2.s.
Q3.:
How do I define scrolling for an array of data
fields?
A.:
This is also a common requirement. Dialog System
can have up to 30 separate scrolling groups on each panel. For simplicity, the
example shows how to define just one.
Name FIELD1, Format X, Size 20
Name FIELD2, Format X, Size 10
Name FIELD3, Format X, Size 3
Name FIELD4, Format 9, Size 4.2
Name
FIELD5, Format 9, Size 4.2
The fields are now on the panel, but there is only one occurrence of each. If you run the screenset at this stage, you can enter data only on the first of each of the 50 occurrences in each field.
Key Function Parameters
CURU PBUP DATA-GRP
0001
CURD PBDN DATA-GRP
0001
TAB SKNF 0001
BTAB SKPF 0001This screenset is now ready to run (see the chapter Running the Screenset for details on running screensets). Scrolling at the top and bottom of the list is completely automatic. You can compare your screenset with the sample in q3.s.
Q4.:
How do I define inserting and deleting in an array
of data fields?
A.:
You can so this easily using the following steps,
which continue on from the previous example.
Key Function Parameters
F3 IBP DATA-GRP
F4 DBP DATA-GRP
CURU PBUP DATA-GRP
0001
CURD PBDN DATA-GRP
0001
TAB SKNF 0001
BTAB SKPF 0001This screenset is ready to run (see the chapter Running the Screenset for details on running screensets). You can compare your screenset with the sample in q4.s.
Q5.:
How can I keep track of how many items there are
in an array after inserting and deleting?
A.:
You can both control and monitor this array size.
Once you have set the array size, the Dialog System Run-time System prevents
you from moving above the first occurrence or below the final occurrence. For
example, the previous example uses an underlying array size of 50. Every use of
the DBP function reduces the internal array size by one, down to a limit of
one. Every use of the IBP function increases the array size by one, up to a
limit of 50. However, if you set the array size to five, the IBP function
applies only up to a limit of five.
The following steps explain how you can monitor the array size, using the previous example screenset as a starting point.
Key Function Parameters
P000 MOVE 0002
ARR-SIZEKey Function Parameters
F3 IBP DATA-GRP
MAS DATA-GRP
ARR-SIZE
RFTD
F4 DBP DATA-GRP
MAS DATA-GRP
ARR-SIZE
IF ARR-SIZE
0002
P001
RFTD
CURU PBUP DATA-GRP
0001
CURD PBDN DATA-GRP
0001
TAB SKNF 0001
BTAB SKPF 0001
P000 SAS DATA-GRP
ARR-SIZE
P001 MOVE 0002
ARR-SIZE
XP P000This screenset is ready to run (see the chapter Running the Screenset for details on running screensets). Watch the behavior of the group and the value in ARR-SIZE as it runs. You can compare your screenset with the sample in q5.s.
Q6.:
How do I define a list of menu options in the
middle of the screen, from which I can select an option either by moving up and
down the list and pressing Enter or by typing a key letter?
A.:
This is a common requirement that makes your
application much more useful. Use the following steps:
Key Function Parameters ANYO POP
The dialog table looks like this:
Key Function Parameters
CR BPD MENU
P011
CURU PBUP MENU
0001
CURD PBDN MENU
0001
C MOVE 0003
OPT-NO
XP P001
XP P013
D MOVE 0004
OPT-NO
XP P001
XP P014
L MOVE 0001
OPT-NO
XP P001
XP P011
S MOVE 0002
OPT-NO
XP P001
XP P012
X MOVE 0005
OPT-NO
XP P001
XP P015
P000 MOVE 0000
OPT-NO
P001 SB MENU
OPT-NO
P011 PUSH $NULL
GOP LOAD
P012 PUSH $NULL
GOP SAVE
P013 PUSH $NULL
GOP CLEAR
P014 PUSH $NULL
GOP DELETE
P015 RETC
You have defined the characters C, D, L, S and X in upper case but not in lower case. This is because by default Dialog System recognizes these as the same character. However, if you require case sensitivity, you can turn it on. See the section Dialog Definition Menu in the chapter Dialog for details.
The procedures defined for the lines in a text group must occur in the same order as the lines in the group.
This screenset is ready to run (see the chapter Running the Screenset for details on running screensets). You can compare your screenset with the sample in q6.s.
Q7.:
How do I define a menu line at the top of the
screen from which I can select an option either by moving along the list and
pressing, or by typing a key letter?
A.:
This uses the same principles as the previous
question. The differences are that instead of using a fixed text group for the
menu and moving a selection bar up and down it, you use a one-line virtual
attribute group and press the <left-arrow> and <right-arrow> keys
to position the virtual attribute data up and down. Use the following steps:
Key Function Parameters ANYO POP
The dialog table for this menu panel looks like this:
Key Function Parameters
CR BPD MENU
P011
CURL PDUP MENU
0001
CURR PDDN MENU
0001
C MOVE 0003
OPT-NO
XP P001
XP P013
D MOVE 0004
OPT-NO
XP P001
XP P014
L MOVE 0001
OPT-NO
XP P001
XP P011
S MOVE 0002
OPT-NO
XP P001
XP P012
X MOVE 0005
OPT-NO
XP P001
XP P015
P000 MOVE 0001
OPT-NO
P001 SD MENU
OPT-NO
P011 PUSH $NULL
GOP LOAD
P012 PUSH $NULL
GOP SAVE
P013 PUSH $NULL
GOP CLEAR
P014 PUSH $NULL
GOP DELETE
P015 RETCThis screenset is ready to run (see the chapter Running the Screenset for details on running screensets). You can compare your screenset with the sample in q7.s.
Q8.:
Can I extract the contents of a virtual text item
into a data field?
A.:
Yes. Use the following steps:
Name POSITION, Format 9, Size 2
Name TEXT, Format X, Size 30
The field "TEXT" is the field to move the required virtual text to, and the field "POSITION" is the field to use to monitor this move on the current screen.
Key Function Parameters
CR MBD TEXT-GRP
POSITION
MOVEVTXT TEXT-GRP
POSITION
TEXT
RFTD
CURU PBUP TEXT-GRP
0001
CURD PBDN TEXT-GRP
0001This screenset is ready to run (see the chapter Running the Screenset for details on running screensets). You can compare your screenset with the sample in q8.s.
Q9.:
How can I "chain" many panels so that <right-arrow>|
in the last field in a panel moves to next panel and |<left-arrow> in the
first field in a panel moves to the previous panel?
A.:
This is another common requirement. The solution
uses the ability to detect an exception condition when a SKNF function attempts
to execute but there are no more fields on the panel, and the similar but
opposite situation for SKPF. Use the following steps:
Key Function Parameters
TAB BPE P001
SKNF 0001
BTAB SKPF 0001
P001 PUSH $NULL
GOP BBBBBBBB Key Function Parameters
TAB BPE P001
SKNF 0001
BTAB BPE P002
SKPF 0001
P001 PUSH $NULL
GOP CCCCCCCC
P002 POPKey Function Parameters
TAB SKNF 0001
BTAB BPE P002
SKPF 0001
P002 POPYou can chain a number of panels in this way. However, the maximum number of panels you can PUSH is 16.
This screenset is ready to run (see the chapter Running the Screenset for details on running screensets). You can compare your screenset with the sample in q9.s.
Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
![]() | Setting Up the Configuration File | Key Code List | ![]() |