Bill
Bill

Reputation: 1247

Is there a way to tell if a default stream is open?

There is a line in a library that I can't take out:

put oResults format "x(80)" skip.

I have a program that is calling the library that doesn't have a default output so this line errors out.

I know I can just send output in my program somewhere but I want to fix it so you don't have to have a output. Seek function maybe?

EDIT: 10.2b

I only get an error in unix.

In a unix environment this line:

put oResults format "x(80)" skip.

errors out.

but if you put a:

if seek(output) <> ? then 
  put oResults format "x(80)" skip.

it doesn't error.


in a unix environment line:

put oResults format "x(80)" skip.

errors out.

but if you put a:

if seek(output) <> ? then 
  put oResults format "x(80)" skip.

it doesn't error.

Upvotes: 0

Views: 1007

Answers (1)

Tom Bascom
Tom Bascom

Reputation: 14020

You are running in batch mode. You should always be redirecting your output at the OS level when you run in batch mode. Something like this:

bpro -p test.p > errors.out 2>&1

Not redirecting output will pretty much always lead to the error that you are seeing.

If you are embedding the bpro, mbpro or _progres -b or whatever command in a script that needs to show that output or otherwise work with it you would typically use "cat" or "tail -f" on the output file.

Upvotes: 1

Related Questions