dbTalk Databases Forums  

Multiple Values within Multi-Value Fields...

comp.databases.pick comp.databases.pick


Discuss Multiple Values within Multi-Value Fields... in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
cds
 
Posts: n/a

Default Re: Multiple Values within Multi-Value Fields... - 07-22-2005 , 09:54 AM






Quote:
To check the file handle...

IF NOT(ASSIGNED(CM.FILE)) THEN OPEN 'CM' TO CM.FILE
Almost, but common variables are initialized to 0 when the common is
1st defined.
Try this instead:
IF NOT( FILEINFO( CM.FILE, 0)) THEN OPEN "CM" TO CM.FILE
or
IF NOT( FILEINFO( CM.FILE,FINFO$IS.FILEVAR )) THEN OPEN "CM" TO
CM.FILE
where
$INCLUDE UNIVERSE.INCLUDE FILEINFO.H
is inserted in the pgm header.


001 SUBROUTINE HELLO(outp,inp)
---> $INCLUDE UNIVERSE.INCLUDE FILEINFO.H <--------
002 COMMON /HELLO/ CM.FILE
003 IF NOT( FILEINFO( CM.FILE,FINFO$IS.FILEVAR )) THEN <-----
004 OPEN "CM" TO CM.FILE ELSE ...
005 END



Reply With Quote
  #22  
Old   
murthi
 
Posts: n/a

Default Re: Multiple Values within Multi-Value Fields... - 07-22-2005 , 09:58 AM







<douglas (AT) pickteam (DOT) com> wrote

Quote:
To check the file handle...
or even:
IF NOT(ASSIGNED (CM.FILE) ) THEN OPEN 'CM' TO CM.FILE

Won't work on UV (or Unidata) since they set Common variables to 0, rather
than unassigned as D3 does. Maybe there's an environment variable, but I
don't know of it.

Chandru Murthi




Reply With Quote
  #23  
Old   
Mecki
 
Posts: n/a

Default Re: Multiple Values within Multi-Value Fields... - 07-23-2005 , 05:34 AM



cds wrote:
Quote:
Where do you assign a value to AT.TIME?


OOPS! Thanks, Mecki!

When you open the file:

001 SUBROUTINE HELLO(outp,inp)
002 COMMON /HELLO/ AT.TIME, CM.FILE
003 IF AT.TIME # @TIME THEN
004 OPEN "CM" TO CM.FILE ELSE STOP...
---> AT.TIME = @TIME <---------- insert this new line
005 END

If you don't like AT.TIME (that wil fail if subr runs precisely at
midnight, @TIME = 0, since common variables are automaticlly
initialized to 0), you can use other flags, e.g., INIT.FLAG 1 or 0.
I like usnig @PATH, which changes whenever you logto somewhere else.
You'd hate to use the other account's file.

You will still get a "Variable not assigned a value" error message.



Reply With Quote
  #24  
Old   
douglas@pickteam.com
 
Posts: n/a

Default Re: Multiple Values within Multi-Value Fields... - 07-25-2005 , 05:02 PM



I still don't like that time check.

How about
IF NOT(ASSIGNED(OPEN.SW)) THEN OPEN.SW = 0
IF NOT(OPEN.SW) THEN
OPEN 'CM' TO CM.FILE THEN OPEN.SW = 1
END


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.