[U2] checking if a passed in file pointer is valid?

2009-01-14 Thread doug chanco
is there a way (universe 10.2.x/aix) to tell if a file pointer passed 
into a subroutine as a parameter is valid?


I somehow forgot that doing the following won't work when the pointer is 
valid.


IF pointer name NE '' THEN

any suggestion/thoughts/ideas welcomed

thanks!

dougc
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] checking if a passed in file pointer is valid?

2009-01-14 Thread Nick Gettino
Can you use the FILEINFO(pointername, NN) to see if it works?  Where
pointername is the VOC name and the NN is a number based on what you
want to determine. You can get all kinds of information including if it
is opened.


Nicholas M Gettino | Director of Development | EnRoute Emergency
Systems, an Infor company | office: 813-207-6998 | fax: 678-393-5389
nick.gett...@infor.com | www.enroute911.com

-Original Message-
From: owner-u2-us...@listserver.u2ug.org
[mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of doug chanco
Sent: Wednesday, January 14, 2009 9:48 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] checking if a passed in file pointer is valid?

is there a way (universe 10.2.x/aix) to tell if a file pointer passed 
into a subroutine as a parameter is valid?

I somehow forgot that doing the following won't work when the pointer is

valid.

IF pointer name NE '' THEN

any suggestion/thoughts/ideas welcomed

thanks!

dougc
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] checking if a passed in file pointer is valid?

2009-01-14 Thread Anthony Youngman
You'll have to check the functions that return file information about a file 
pointer. I'm sure there's some way of doing it.

It would be nice if IBM could fix that - it always used to work in INFOBASIC, 
you would have thought that a logic test could at least return true/false 
instead of crashing even when fed a file pointer ...

Cheers,
Wol

-Original Message-
From: owner-u2-us...@listserver.u2ug.org 
[mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of doug chanco
Sent: 14 January 2009 14:48
To: u2-users@listserver.u2ug.org
Subject: [U2] checking if a passed in file pointer is valid?

is there a way (universe 10.2.x/aix) to tell if a file pointer passed
into a subroutine as a parameter is valid?

I somehow forgot that doing the following won't work when the pointer is
valid.

IF pointer name NE '' THEN

any suggestion/thoughts/ideas welcomed

thanks!

dougc
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] checking if a passed in file pointer is valid?

2009-01-14 Thread Charles Stevenson
Look up FILEINFO() function.
Look up STATUS statement (STATEMENT, not function), too.

   $include UNIVERSE.INCLUDE FILEINFO.H
   IF ASSIGNED( VAR ) THEN
  IF FILEINFO(  VAR, FINFO$IS.FILEVAR ) THEN
 * yep, it's a file variable alright.
  END ELSE
 * it's been assigned but it ain't a file.
  END
   END ELSE
  * it's not even been used yet,
  * ;et alone a file variable.
   END

The UV documentation talks about
   $INCLUDE SYSCOM FILEINFO.INC
instead of
   $INCLUDE UNIVERSE.INCLUDE FILEINFO.H
but that's language cribbed from old Prime Information manuals and never
corrected.

All the above is from memory. I might have a few details wrong, but that's
the vibe of the thing.

Chuck Stevenson
stevenson.c...@gmail.com  - new email address


doug chanco  wrote:

 is there a way (universe 10.2.x/aix) to tell if a file pointer passed into
 a subroutine as a parameter is valid?
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] checking if a passed in file pointer is valid?

2009-01-14 Thread doug chanco

thanks a million everyone!

dougc

Charles Stevenson wrote:

Look up FILEINFO() function.
Look up STATUS statement (STATEMENT, not function), too.

   $include UNIVERSE.INCLUDE FILEINFO.H
   IF ASSIGNED( VAR ) THEN
  IF FILEINFO(  VAR, FINFO$IS.FILEVAR ) THEN
 * yep, it's a file variable alright.
  END ELSE
 * it's been assigned but it ain't a file.
  END
   END ELSE
  * it's not even been used yet,
  * ;et alone a file variable.
   END

The UV documentation talks about
   $INCLUDE SYSCOM FILEINFO.INC
instead of
   $INCLUDE UNIVERSE.INCLUDE FILEINFO.H
but that's language cribbed from old Prime Information manuals and never
corrected.

All the above is from memory. I might have a few details wrong, but that's
the vibe of the thing.

Chuck Stevenson
stevenson.c...@gmail.com  - new email address


doug chanco  wrote:

  

is there a way (universe 10.2.x/aix) to tell if a file pointer passed into
a subroutine as a parameter is valid?


---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/