Redirect ouput to screen

Anamika

New Member
I want to redirect output to screen if procedure is not in batchrun mode. How do I get to know value of procedure is in batchrun at runtime. I m using gpselout.i in my procedure in which output destination is decided.
 

jchellap

Member
I guess the below code will be useful for you.

{mfdtitle.i}
if not batchrun then
display "not batch run".
else
disp "batch run".
 

Anamika

New Member
Its not working I had tried it before.As I'm using gpselout.i which determines output destination.So I'm not able to get output on screen using this.
 
gpselout.i redirects all the output to the destination entered in screen.
Why can't you enter screen as a destination in output field.
Use "page" or "terminal" as an output (In CHUI) if you want output on screen. These has to be defined as a printer in 36.13.2 and I think comes in product.
 
Hi Anamika,

Please check if this code helps you:

PROCEDURE(.P):

Code:
DEF VAR b-mod AS LOG NO-UNDO.

b-mod = SESSION:BATCH-MODE.
{gpselout.i
&msg = b-mod}

gpselout.i :
Code:
IF B-MOD = YES
THEN DO:
   OUTPUT TO VALUE("C:\RAJAT\ABC.TXT").
   FIND customer WHERE custnum = 1 NO-LOCK NO-ERROR.           /* BUSINESS LOGIC */
   DISPLAY name.
   OUTPUT CLOSE.   
END.

ELSE DO:
   FIND customer WHERE custnum = 1 NO-LOCK NO-ERROR. 
   DISPLAY name.
END.

Thanks & Regards,
Rajat.
 
Last edited:
Top