Character windows - reports

!compat report

Run report in command line mode


SYNTAX

!compat report = 2

Execute any startup code, and then run the report without displaying a screen form. Any +|-window definitions and related code are ignored.

Reports are defined by means of the !report statement. If the program contains more than one !report section, the first is run, unless the startup code contains a run report command, in which case the report specified is run. When the report has finished, the program terminates.

The output of the report is directed to standard output. If a program containing this declaration is run under GUI, the output is sent to Windows Print Manager.

If a program contains the !compat report = 2 declaration, the output or input of a report can be redirected from the command line, provided that the operating system allows this state to be detected. The startup code is executed, a single report run, redirecting output and/or input as specified, and the program then terminates.

Output and input can of course be redirected from within a report program. The source or destination may be assigned by the program logic, or input by the user; the output file is specified in the run report command.


EXAMPLE

  1. Redirected input. The first report in the program “report1.r” is run, taking its input from the file “textfile.h” and directing the result to standard output.:

    srep report1 pterm < textfile.h
    
  2. Redirected output. The first report in the program “printlog.r” is run, and the output redirected to the file “tmpfile”.

    srep printlog hplaser1 > tmpfile
    

getinfo

Input a value into a field


SYNTAX

getinfoprompt_text”, field_id

Input a value into a field. The prompt_text is displayed on the screen. The input reply is validated and stored in the designated field.

The input data is validated both for field type (automatic validation) and against the field validation list, if any. If the data is invalid, the bell is sounded and the prompt redisplayed.

Responses to getinfo may be read from a text file by redirecting standard input, on operating systems which allow this situation to be detected. In this case the prompt_text is not displayed, and an invalid response causes the program to abort. When standard input is redirected in this way, the startup code is executed, a single report is run and then the program terminates. The first report defined in the program is selected, unless a different report is specified in the startup code. The getinfo command is the only input command which may be used with redirected standard input.

NOTES

  • The getinfo command honours the u (upper case) and l (lower case) assignment flags attached to alphanumeric fields. However, the characters are echoed back as typed.

  • The entire input line is read from standard input and the value read is stored in the field (after validation). Therefore, if the receiving field were type a3, the user could type a complete line of text, but only the first three characters would be stored. A numeric value which is too large is however rejected by automatic validation.

  • This command is only suitable for simple reports and should in general be restricted to reports whose input is redirected from a file. In order to input parameters to a report, use a window dialog in the main body of the program before running the report.

  • From version 4.2 onwards, the getinfo command works in GUI mode by emulating a command line dialog in wintask. It is only provided so that converted Sculptor 2 programs still work. Otherwise it is entirely obsolete and should not be used in new programs.


EXAMPLE

!temp Response,,a1

getinfo "Is the printer loaded and ready to run?", tmp.Response

switch toupper(tmp.Response) {
    case = "Y":
       statements
       break

    default:
       statements
       break
 }

putinfo

Display text on the terminal


SYNTAX

putinfo “text

Displays the text string specified on the terminal. The text is always output to the standard error output channel, and will therefore always be displayed on the terminal even if standard output is redirected or piped elsewhere (e.g. to the printer).

If output is redirected to a file or a pipe, and the operating system allows this state to be detected, putinfo is the only screen output command which may be used.

If input is redirected from a file, and the operating system allows this state to be detected, any output from putinfo is suppressed.

NOTES

  • Under UNIX it is possible to redirect the standard error output channel. If this is done, then the output from putinfo will also be redirected.

  • From version 4.2 onwards, the putinfo command works in GUI mode by emulating a command line dialog in wintask. It is only provided so that converted Sculptor 2 programs still work. Otherwise it is entirely obsolete and should not be used in new programs.


EXAMPLE

putinfo "Please enter the parameters requested"

Printer parameter files

Section 2, Entry 2 - Print Manager

The Sculptor Print Manager should always be selected.


RELATED TOPICS

Character windows

Reports

Printer parameter files