Call routine and return value (AREV Specific)
At 25 MAY 1999 08:05:49PM Tad Groves wrote:
Need your advice.
GOAL: To let user decide if to print Landscape or Portrait. If they print Portrait, they are printing on a dedictated tractor fed dot matrix printer. If they print Landscape, they can print to a network printer and the print is condensed.
QUESTION: Should I past the program listing below into each of my reports(20+) or is there a way to call PRINTLANDSCAPE from the reports and have the code executed ?
PROGRAM LISTING FOR BP,PRINTLANDSCAPE 20:02:43 25 MAY 1999
0001 DECLARE SUBROUTINE MSG, INPUT.CHAR
0002 RESP=Y';
0003 MSG("Print Landscape on 8 1/2 X 11 ?|Y/N","RC",RESP,
) 0004 IF RESP=N' THEN 0005 STOP 0006 END 0007 PRINTER ON 0008 /* Custom Printing Options */ 0009 PRINT CHAR(27):'&l1O' /* Orientation */ 0010 PRINT CHAR(27):'&k2S' /* Font Pitch */ 0011 PRINT CHAR(27):'&l8D' /* Lines Per Inch */ 0012 /* Added 5/25/99 */ 0013 PRINTER OFF </QUOTE> —- === At 25 MAY 1999 08:30PM Barry Stevens wrote: === <QUOTE>subroutine printlandscape DECLARE SUBROUTINE MSG, INPUT.CHAR RESP=Y'; MSG("Print Landscape on 8 1/2 X 11 ?|Y/N","RC",RESP,
)IF RESP=N' THEN
return ;*<-----NoteEND
PRINTER ON
/* Custom Printing Options */
PRINT CHAR(27):'&l1O' /* Orientation */
PRINT CHAR(27):'&k2S' /* Font Pitch */
PRINT CHAR(27):'&l8D' /* Lines Per Inch */
/* Added 5/25/99 */
PRINTER OFF
return ;*←—-Note
In report program
call printlandscape()
Barry
At 26 MAY 1999 11:29AM Tad Groves wrote:
Thanks
I saved the subroutine "PRINTLANDSCAPE" in "BP PRINT.LANDSCAPE". I compiled "BP PRINT.LANDSCAPE". I did a makevoc on "PRINT.LANDSCAPE".
Then I created and compiled program "BP PRINTMAIN" that calls the subroutine "PRINTLANDSCAPE". An error, "PRINTLANDSCAPE" has not been cataloged. Which is correct, "PRINT.LANDSCAPE" was cataloged because "PRINTLANDSCAPE" didn't show up in the list to catalog.
So, I changed "BP PRINTMAIN" to call "PRINT.LANDSCAPE" instead of "PRINTLANDSCAPE" and everything appears to work correctly.
QUESTION: Is there a problem with the SUBROUTINE name being different from the program name? Are they the same and the first line is just a formality ? Should they be the same name ?
At 26 MAY 1999 03:06PM akaplan@sprezzatura.com - [url=http://www.sprezzatura.com]Sprezzatura Group[/url] wrote:
In ARev, the name on the Subroutine Header line is not used for any real purpose, in these circumstances anyway. It can be anything you wish it to be. It's the CATALOG and $name that matters.
akaplan@sprezzatura.com
At 27 MAY 1999 10:41AM Tad Groves wrote:
I thought that was the case. Thanks.