HP3000-L Archives

April 1998, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Zoltak <[log in to unmask]>
Reply To:
John Zoltak <[log in to unmask]>
Date:
Fri, 24 Apr 1998 10:26:56 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (79 lines)
Hello List Members,

I've just started using the new date intrinsics and I have this
intermittent problem. This is a HP Business Basic program that calls
HPDateConvert to convert from a YYMMDD to YYYYMMDD date. So I have this
date in a string and call HPDateValidate with this string and type code
25. This intrinsic returns success, good date. Then I call HPDateConvert
with the same input date string and type code 25, and output string and
type code 38. This will return -2 which means "Bad input date argument
is passed to the intrinsic". But this only happens most of the time. If
I rerun the program, and this is in the interpreter, it may fail or it
may work. It won't switch back and forth. If it doesn't work, it will
probably not work many more times. But sometimes it will work and then
works continuously after that. If I change the COM statement by just
removing the "#1", the common file, the intrinsic call will work
consistently, so far.

So what the heck is going on. There is something here I'm not seeing.
It's almost like there is an uninitialized variable in the date
intrinsic call that sometimes has the correct value. Does anyone have an
idea? Here is a program that demonstrates the failure.

TIA
John Zoltak
North American Mfg Co

----------------------------------------- here is program list
------------------------------------
 !  testit
     10  COM Today_gregorian$[8]
     20 !
     30  DIM Buffer$[32]
     40  DIM SHORT INTEGER Hpe_status(2), INTEGER Date_error
     50 !
     60  GLOBAL INTRINSIC
Hpdateconvert,Hpdateformat,Hpdatediff,Hpdateoffset,&
        FNHpdatevalidate ALIAS "hpdatevalidate"
     70 !
     80  Buffer$=DATE$(0)
     90  Buffer$=Buffer$[7;2]+Buffer$[1;2]+Buffer$[4;2]
    100 !
    110  Date_error=FNHpdatevalidate(25,Buffer$,-1)
    120  IF Date_error<>0 THEN
    130     DISP "Invalid date entered!"
    140     GOTO Ask_date
    150  ENDIF
    160  CALL
Hpdateconvert(25,Buffer$,38,Today_gregorian$,Hpe_status(*),-1)
    170  IF Hpe_status(1)<>0 THEN
    180     DISP "Error in input date convert, error=";Hpe_status(1)
    190  ENDIF
    200  SETLEN Today_gregorian$ TO 8
    210  DISP Today_gregorian$

----------------- here is sample run -------------------

HP Business BASIC/iX    HP32715A.00.15     Copyright Hewlett-Packard Co.
1989
                         FRI, APR 24, 1998, 10:21 AM
>get testit
>run
Error in input date convert, error=-2

>run
Error in input date convert, error=-2

>run
Error in input date convert, error=-2

>mod 10
     10  COM #1,Today_gregorian$[8]
             ddd
     10  COM Today_gregorian$[8]

>
>run
19980424
>

ATOM RSS1 RSS2