Highlighted
Absent Member.
Absent Member.
1294 views

[archive] Highlighting text

[Migrated content. Thread originally posted on 16 October 2003]

When you move from field to field in forms in a usual way, then the text in entry-fields is highlighted.

Is there a way to accomplish the same effect when you perform a particular routine, saying

....
MOVE 4 TO ACCEPT-CONTROL
MOVE 101 TO CONTROL-ID.

and how can I accomplish the same effect by just clicking once on a entry-field ?

Txs
0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Highlighting text

Look at Format 13 of the SET statement. The SELECT-ALL-SELECTION action should do what you need.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Highlighting text

Hi DanM,

Txs for your reply. This solves my problem halfway.

If I set exception mark-field to select-all-selection, then indeed, if I press F1 in my case, the field is marked.

Now I want to accomplish the same effect without pressing F1, but in an after procedure from an entry-field.

In an after-procedure I check a date. If the date is wrong, I want to get the same effect like pressing F1.

Txs
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Highlighting text

You could use w$keybuf library routine to send the F1 keystroke automatically.

ie.
perform validate-entry-date
if invalid-date
call "w$keystroke" using 1, "{k1}"
end if
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Highlighting text

Unfortunately, the AcuCobol screen section does not supply color values for the currently active cell. However, it is possible to achieve this with some slick code. If you use this approach, you should be able to customize it to do what you want.

Step 1:
Make a procedure copybook, screen.pl
Make a working storage copybook, screen.ws
Make sure you have ...is special names screen control in your working storage, preferably in a copybook.

In working storage copybook:
78 Active-Color value ...
78 Inactive-Color value ...

In procedure copybook:
Default-Before.
modify CONTROL-HANDLE color is Active-Color.

Default-After.
modify CONTROL-HANDLE color is Inactive-Color

Now, from this point on, your screen sections should look like:

01 Main-Screen color is Inactive-Color before procedure is Default-Before after procedure is Default-After
05 ....

The only thing you have to remember is if you add a before or after procedure to your control in the screen section, make sure to perform Default-Before or Default-After in the first line of your procedure.

Merlin
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Highlighting text

sorry, misread the initial question, my previous post doesn't answer it 🙂 still, useful stuff...

Merlin
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.