Karen,

One of my clients wanted an "expanded" screen print capability.

The following is an (incomplete) extract of the code I used to
produce the report in DOS. It may be tedious, but I have complete
control.

I do my own pagination and I put printer control
codes into the output line as necessary.

The subroutines I run are listed at the bottom.
----------------------------------------------------

--preset the format for currency
  SET VAR vdollfor TEXT = ('99,999,990.00')

--Clear the output line
  RUN clearlin.sub

--Put text column header, right adjusted at column 16
  RUN place.sub USING 'ContCost','R',16

  -- other column headers here

--Write the line and clear it
  RUN writeclr.sub

--Format currency value to text
  SET VAR vtext = (FORMAT(.veccst,.vdollfor))

  --put the text in the output line, right adjusted at column 16
  RUN place.sub USING .vtext,'R',16

  -- other columns of data here

  --write the line and clear it
  RUN writeclr.sub
-----------------------------------------------------------
-----------------------------------------------------------

--CLEARLIN.SUB -AR- clear the print line
SET VAR whoami TEXT = 'clearlin'

CLEAR VAR vline
SET VAR vline TEXT = (SFIL(' ', .vll))
RETURN
-----------------------------------------------------------

--WRITECLR.SUB -HH- write one line from vline, handle pagination,
clear vline

IF vleft < 1 THEN
  RUN &tpagname
ENDIF
WRITE .vline
SET VAR vleft = (.vleft - 1)
RUN clearlin.sub
RETURN
-----------------------------------------------------------

--PLACE.SUB -EH- put a text field in line

--Input:

---Command Line
----vtext - the field
----vlr   - left/center/right justification
----vcol  - column position (Left, Center, or Right)

----Variables
----vline - the line

SET VAR vztext TEXT = (CTXT(.%1))
SET VAR vzlr TEXT = (CTXT(.%2))
SET VAR vzcol INTEGER = (INT(CTXT(.%3)))
CLEAR VAR __-_

SET VAR vzleng INTEGER = (SLEN(.vztext))
SWITCH (.vzlr)
CASE 'R'
  SET VAR vline = (SPUT(.vline, .vztext, (1 + .vzcol - .vzleng)))
  BREAK
CASE 'C'
  SET VAR vzlengh INTEGER = (.vzleng / 2)
  SET VAR vline = (SPUT(.vline, .vztext, (.vzcol - .vzlengh)))
  BREAK
DEFAULT
  SET VAR vline = (SPUT(.vline, .vztext, .vzcol))
  BREAK
ENDSW
CLEAR VAR vztext,vzlr,vzcol,vzleng
RETURN

Reply via email to