[Info-vax] Error Messages in Basic - %BASIC-E-PARMODNOT, mode for parameter <n> of routine <procedure-name> not as declared

DuncanMorris duncanjmmorris at btinternet.com
Wed Jun 5 10:45:12 EDT 2019


On Wednesday, June 5, 2019 at 3:28:00 PM UTC+1, Jeffrey H. Coffield wrote:
> The following compiles and runs for me on both Alpha and Itanium. You 
> must have something wrong in how you are declaring the function.
> 
>           program test
> 
>          external long function lib$convert_date_string
> 
>          Declare Long            Date_Time_Context_gl
>          Declare String          End_of_Month_Date_gs
>          Declare Quad            End_of_Month_Date_Time_gq
>          Declare Long            End_of_Month_Weekday_gl
>          Declare Long            VMS_Condition_Code_gl
> 
>          End_of_Month_Date_gs = '31-may-2019 01:23:45.67'
> 
>          VMS_Condition_Code_gl   &
>                  = LIB$CONVERT_DATE_STRING (End_of_Month_Date_gs, &
>                  End_of_Month_Date_Time_gq, &
>                  Date_Time_Context_gl )
> 
>          print VMS_Condition_Code_gl
>          print End_of_Month_Date_Time_gq
> 
>          end
> 
> 
> 
> On 06/05/2019 06:48 AM, Craig Dedo wrote:
> > VMS_Condition_Code_gl   = LIB$CONVERT_DATE_STRING ( End_of_Month_Date_gs, End_of_Month_Date_Time_gq, Date_Time_Context_gl )

Nothing wrong, per se, with the program.

As Hoff has pointed out, the external definition in the library expects BASIC$QUADWORD for parameter 2. This is not seen as the same type as QUAD.

Try this-
program test

%include "starlet"           %from %library   "sys$library:basic$starlet"      ! System Services declarations
%include "$ssdef"              %from %library   "sys$library:basic$starlet"      ! condition codes
%include "lib$routines"          %from %library   "sys$library:basic$starlet"      ! LIBRTL routines

         Declare Long            Date_Time_Context_gl
         Declare String          End_of_Month_Date_gs
         Declare Quad            End_of_Month_Date_Time_gq
         Declare Long            End_of_Month_Weekday_gl
         Declare Long            VMS_Condition_Code_gl

         End_of_Month_Date_gs = '31-may-2019 01:23:45.67'

         VMS_Condition_Code_gl   &
                 = LIB$CONVERT_DATE_STRING (End_of_Month_Date_gs, &
                 End_of_Month_Date_Time_gq, &
                 Date_Time_Context_gl )

         print VMS_Condition_Code_gl
         print End_of_Month_Date_Time_gq

         end

I1        12238     !     LIB$CONVERT_DATE_STRING
I1        12239     !
I1        12240     !     Convert Date String to Quadword
I1        12241     !
I1        12242     !     The Convert Date String to Quadword routine converts an absolute date
I1        12243     !     string into a VMS internal format date-time quadword. That is, given
I1        12244     !     an input date/time string of a specified format,
I1        12245     !     LIB$CONVERT_DATE_STRING converts this string to a VMS internal format
I1        12246     !     time.
I1        12247     !
I1        12248       EXTERNAL LONG FUNCTION  lib$convert_date_string &
I1        12249                ( &
I1        12250                    STRING  BY DESC, &
I1        12251                    BASIC$QUADWORD  BY REF, &
I1        12252                   OPTIONAL LONG  BY REF, &




More information about the Info-vax mailing list