Re: New lexical function F$DELTA_TIME

From: Carl Perkins (carl_at_gerg.tamu.edu)
Date: 07/12/03


Date: 12 Jul 2003 10:11 CDT

In article <3F0F6573.D6BD3B9@fsi.net>, "David J. Dachtera" <djesys.nospam@fsi.net> writes...
}John Santos wrote:
}>
}> On Thu, 10 Jul 2003, David J. Dachtera wrote:
}>
}> > Jim Strehlow wrote:
}> > >
}> > > Guy Peleg <guy.peleg@hp.com> wrote in message news:<3F0D7BFC.383CB534@hp.com>...
}> > > ... with the next Alpha VMS version V7.3-2, we will ship a new
}> > > lexical function F$DELTA_TIME ...
}> > >
}> > > Having optional parameters for
}> > > (..., "day"|"hour"|"minute"|"second", variableName )
}> > > would be "nice" to save us from parsing the result string;
}> > > but we can parse if we have to do so.
}> > >
}> > > It would save us from writing an extra couple of lines of code (our own subroutine).
}> >
}> > Just tried these for fun...
}> >
}> > DJAS01::DDACHTERA$ say f$cvtime( "0 01:23:45.67", "delta" )
}> > 0 001:23:45.67
}>
}> $ write sys$output f$cvtime( "2 01:23:45.67", "delta" )
}> %DCL-W-IVDTIME, invalid delta time - use DDDD-HH:MM:SS.CC format
}> \2 01:23:45.67\
}
}Hhmmm...
}
}DJAS01::DDACHTERA$ say f$cvtime( "1 23:45:67.89", "delta" )
}%DCL-W-IVDTIME, invalid delta time - use DDDD-HH:MM:SS.CC format
} \1 23:45:67.89\
}
}Well! Looks like we found a bug in F$CVTIME()!
}
}V7.2-2, BTW. What's yours?
}
}--
}David J. Dachtera

On 7.2-1, you see this interesting thing:

$ write sys$output f$cvtime( "01:23:45.67", "delta" )
0 01:23:45.67
$ write sys$output f$cvtime( "001:23:45.67", "delta" )
0 001:23:45.67
$ write sys$output f$cvtime( "0001:23:45.67", "delta" )
0 0001:23:45.67

The formatting of the output fields matches the number of digits
in the input fields. It isn't just the hour field either:

$ write sys$output f$cvtime( "0001:023:0045.67", "delta" )
0 0001:023:0045.67

You are allowed to have a space in the hour filed if the first digit
is a 0, but not anything else:

$ write sys$output f$cvtime( "0 001:023:0045.67", "delta" )
0 0001:023:0045.67
$ write sys$output f$cvtime( "1 001:023:0045.67", "delta" )
%DCL-W-IVDTIME, invalid delta time - use DDDD-HH:MM:SS.CC format
 \1 001:023:0045.67\
$ write sys$output f$cvtime( "1-001:023:0045.67", "delta" )
1 001:023:0045.67

And finally:

$ write sys$output f$cvtime( "0001-0001:00023:00045.67", "delta" )
0001 0001:00023:00045.67

You can add one more digit before it gives an IVDTIME error (I expect
it is from exceeding the maximum allowed string length for the input).

How strange is that?

--- Carl



Relevant Pages