Character UI - resetting the cursor to start of line

NickA

Member
Arrgh - this is driving me nuts! :confused:

Progress V8.3x CHUI.

I'm trying to build limited EAN barcode parsing into part of our system. To do this I've changed the format on our SSCC input field from 'X(20)' to 'X(256)' and added 'VIEW-AS FILL-IN SIZE 20 BY 1' (If you don't know what an SSCC is, pretend it's a batch code or something).

In theory this means I get a fill-in with only 20 characters visible, but it will allow entry of a much bigger piece of text (IE a long EAN barcode).

All of this works fine, but if the text entered is >= 20 characters and the fill-in scrolls, I can't get the fill-in to reset back to the leftmost cursor position to display the SSCC correctly.

EG.
Code:
DEFINE VARIABLE SSCC AS CHARACTER FORMAT "X(256)"
    VIEW-AS FILL-IN SIZE 20 BY 1 NO-UNDO.

...

UPDATE SSCC.
RUN eanparse.p ( INPUT-OUTPUT SSCC ).
DISPLAY SSCC.

...
. Barcode scanned: 00 312345671058469411.
. This is 20 digits: the fill-in scrolls 1 character to the left.
. When the 'DISPLAY' runs, it chops off the first digit. IE it has retained some kind of cursor position: '12345671058469411'.

----

I've tried using the CURSOR-OFFSET attribute, but it doesn't seem to make any difference.

BTW: This runs through a common include, so I'd really like solutions that didn't involve rewriting a lot of programs.

TIA
 

NickA

Member
Additional...

Additional to this subject, I've found that the behaviour is different between GUI and CHUI clients.

GUI works exactly the way I want, CHUI doesn't, and I can't make it work without redisplaying the field in a different frame.
 
Top