Midrange News for the IBM i Community


Posted by: pslink
Bus Application Analyst/Pgmr
DARPA (jk..)
Indianapolis, IN
Space(s) required between values on a screen?
has no ratings.
Published: 14 Nov 2012
Revised: 23 Jan 2013 - 1553 days ago
Last viewed on: 23 Apr 2017 (2440 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Space(s) required between values on a screen? Published by: pslink on 14 Nov 2012 view comments(4)

Does anyone know off hand, what determines space requirements of fields on a screen?

More specifically, space required between displayed values (constants,fields) and does it change

when using the COLOR keyword as opposed to the DSPATR keyword? I am referring to the beggining attribute byte and trailing attribute byte of fields. TIA  

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Space(s) required between values on a screen?
Posted: 4 years 5 months 10 days 16 hours 8 minutes ago

All fields require one space between them and the next field.

This position is used for the attribute byte. So a +1 in DDS will insure that it compiles, whereas an RPG output spec-style +0 will never compile.

 

Posted by: TFisher
Premium member *
Comment on: Space(s) required between values on a screen?
Posted: 4 years 5 months 10 days 15 hours 8 minutes ago
Edited: Wed, 14 Nov, 2012 at 12:50:27 (1623 days ago)

There are times when you need two spaces between fields. 

A field with CNTFLD keyword specified needs two spaces before it in order for it to function properly.  There are also other keywords that require two spaces, like SNGCHCFLD and MLTCHCFLD..

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Space(s) required between values on a screen?
Posted: 4 years 5 months 10 days 13 hours 14 minutes ago
Edited: Wed, 14 Nov, 2012 at 14:23:20 (1623 days ago)

And there is no difference between color and monochrome; just changes how it's rendered.

  • There's a leading (invisible) attribute byte before each field.
  • There's a trailing (invisible) attribute after each field.
  • Between two fields the attribute can be shared. You need a minimum of one (invisible) space for the shared attribute byte. I.e., the leading attribute of the 2nd field also acts as the trailing attribute of the first field.
  • Be aware that fields wrap from line to line. If a field ends in column 80, it's trailing attribute is in column 1 of the next row. The next field can't begin before column 2. Not 100% sure, but I believe there's also a wrap from 24,80 to 1,1. (Or 27,132 to 1,1 if you're *DS4.)

 Plus what Fisher said.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Space(s) required between values on a screen?
Posted: 4 years 5 months 10 days 10 hours 21 minutes ago

Yes, position (1,1) on the display cannot be written to. It is blocked. But a field's attribute may appear there.