Computer Corporation of America
|
Feedback
Search CCA:
   
USA CCA
CCA Products
CCA Customer Support
CCA Resources
CCA - Company
CCAPRINT: A Newsletter for Model 204® and System 1032® Users
March10, 1997
 
 
IMPACT'97: It's not too late to be an Early Bird

Time is running out for early-bird registration for IMPACT'97! The deadline is just five days away - March 15th. IMPACT'97 will be held at the Hyatt Regency Denver Downtown Hotel, and will offer sessions on Internet - Intranet - Web, Transforming Legacy Systems to Open Systems, as well as sessions on the Year 2000!

In addition to presentations by users, CCA presenters will offer the following topics:

 

Questions & Answers

This month, CCAPRINT features a question about the upcoming new release of Model 204 and a question about System 1032 report formatting.

Model 204 Question

Question: If I open files under Model 204 V4R1, can I open them again under previous releases?

Editor's Note 8/10/97: Due to changes in product implementation, the answer to this question, printed in the March 1997 edition of CCAPRINT, does not reflect current functionality and, therefore, has been removed from the Web site. In the September 1997 edition of CCAPRINT, we will publish an updated response to this question. Alternatively, see the Model 204 and Connect* Release Notes for V4R1.

System 1032 Question

Question:For System 1032 reports: How can I reliably predict exactly how many lines of output a given scrolled format text item will take up?

Answer: Ever since scrolled formats became available in System 1032, report programmers have been scratching their heads to arrive at the answer to this question.

Reasons for this need vary. You might create reports that output to preprinted stock, or you want to make sure that you can keep all relevant data together on a page.

The problem comes from the interaction of user data-entry and features of the scroll formats:

Perhaps you have been using the formula:

# lines = ($LEN($TRIM(text_item)) /field-width) + 1

This formula says to trim leading and trailing spaces from the text field, determine the length of the trimmed text, divide this length by the field width, then add 1 line to allow for word wrapping.

This method usually works well, until you run that report for the president, and every other page has only one line on it!

Now there is a more reliable method to accomplish this task.

Use the System 1032 tools: INIT_OUTPUT and GET_OUTPUT. With these tools procedures from the S1032_HLI library and the $TEXT system function, you can write code fragments to return the exact number of lines that a given text item will take for a particular format.

How the tools work

INIT_OUTPUT creates a memory buffer, rather than an output file, for a System 1032 channel. Initialize the buffer, then use a WRITE command to write the text item using its intended format to the memory buffer, as if it were written to the report file. Afterwards, a call to GET_OUTPUT returns the exact number of lines the text item takes in the actual report.

For example, you are writing invoices, and need to know how many lines the comment field INVOICE_COMMENT will take up in the report:

Variable OUTBUF text varying
Variable NLINES integer
Open Library S1032_HLI in S1032_TOOLS Read-only
Call INIT_OUTPUT(7)
Write on 7 INVOICE_COMMENTS format (SV35(a))
Call GET_OUTPUT(OUTBUF, NLINES, 7)

The value of NLINES is the actual number of lines that the invoice comment value needs when being output using the SV35(a) format.

When you are done using this memory buffer, you need only release the channel.

System 1032 lets you have any combination of file channels and memory channels open at once.

 
Copyright © 2008 Computer Corporation of America.
All right reserved. Published in the United States of America.

Contact CCA Webmaster
Copyright 2008