Simulate the ON-ERROR (F4) key

rpenridge

New Member
Hi All,

I need to simulate sending the END-ERROR key in a bulk load program. The key is bound to the F4 (or PF4?) key, or CTRL-E also works for me.

According to my calculations:
F4 is 304 in DECIMAL and 460 in OCTAL
PF4 is 404 in DECIMAL and 624 in OCTAL
CTRL-E is 5 in DECIMAL and 005 in OCTAL?

I need to use it using either a put or export statement, so in other words something along the lines of...

put stream o_str control
"Insert Unknown escape code for Control-E here".

put stream o_str
chr(5). /* or 005, or 624 ..... etc */

How do I do this? I just can't seem to get it to work.

Thanks
Rob.
 
An unquoted period is used to signify the ENDKEY key, when importing data from a file. For example, if you have a file containing:

"A"
"B"
.
"C"
"D"

and you use the following program to read data:

INPUT FROM "file".
REPEAT:
IMPORT cText.
MESSAGE cText VIEW-AS ALERT-BOX.
END.
INPUT CLOSE.

Then you will see alert-box message for 'A' and 'B', but the loop will end when the period is encountered. This is because a REPEAT loop has a default ENDKEY property, when written in full is:

REPEAT ON ENDKEY UNDO, LEAVE:

As the period signifies the ENDKEY, the loop ends when it is encountered.

If you change the ENDKEY property to:

REPEAT ON ENDKEY UNDO, RETRY:

then you will see lines 'C' and 'D' too, but you'll also get an error because the loop doesn't know when to end, and Progress will close the input stream when you attempt to read past the end-of-file.
 
Top