Hi James,

I've run into a problem implementing word wrap. When a word doesn't fit at the end of a field, I need to put it on the next field and pad with blanks. However, I need to distinguish between blanks I use for padding and those blanks the user entered.

TN5250 already keeps track of how many spaces are used for padding and how many the user entered. The spaces that the user typed will be set to actual spaces (x'40' in EBCDIC). The spaces that the user hasn't typed in that are just padding on the screen will be x'00'

Case in point... look at the tn5250_display_kf_end() function. It determines the end of the field by searching for the last character that's not x'00' (err, "\0", since this is C not RPG)

Go to a command-line (on a 5250 screen) and type 10 spaces, then move the cursor back to the start with the arrow keys, then hit the END key and you'll see that it'll move right back to right after the last space you typed. It doesn't go all the way to the end of the field... then look at the code in tn5250_display_kf_end and see how it works.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].