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

Jeffrey H. Coffield jeffrey at digitalsynergyinc.com
Sat Jun 8 14:21:42 EDT 2019



On 06/05/2019 07:45 AM, DuncanMorris wrote:
> 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, &
>

There are a number of places in both text libraries as well as .BAS 
files that have the following "patch":

       %IF %DECLARED(%BASIC$QUADWORD_DECLARED) = 0 %THEN
          RECORD BASIC$QUADWORD
             LONG FILL(2)
          END RECORD
          %LET %BASIC$QUADWORD_DECLARED = 1
       %END %IF

because Basic didn't have a quad data type. It does now and this 
could/should be cleaned up.

There are other long time errors and omissions in Basic support that I 
have had to keep my own fixed/stable versions of some of the library 
files so my programs will work. Notably the files concerning XAB 
structures for Basic would change/break with new versions of OpenVMS.

If anyone is interested in fixing, I can dig up some small samples.

Also, if there is a list of things to do, Basic still does not support a 
get/find key "LT" or "LE" which RMS supports.





More information about the Info-vax mailing list