[Info-vax] Any Way to Pass Character String Arguments from C to Basic?
Craig Dedo
Craig.Dedo at gmail.com
Mon Oct 21 14:00:41 EDT 2019
On Monday, October 21, 2019 at 12:43:24 PM UTC-5, Craig Dedo wrote:
> On Monday, October 21, 2019 at 11:18:10 AM UTC-5, Robert A. Brooks wrote:
> > On 10/21/2019 11:31 AM, Craig Dedo wrote:
> >
> >
> > > Everything compiles and links correctly; no errors or warnings at all.
> > > When I run the program everything works fine until I try to assign character string data back into character string arguments> that are associated with character strings in the C program.
> > > * Assignment of character string arguments from the C program to variables in the Basic subroutine works fine.
> > > * Assignment of integer results from the Basic subroutine to the integer arguments in the C program works fine.
> >
> > > * BUT when I try to assign character string values to a character string argument in the C program, I get a fatal error:
> > > %STR-F-FATINTERR, fatal internal error
> > To be clear, you get this error not when you are calling the BASIC subroutine, but when you attempt to do the string assignment in the C source
> > prior to calling the BASIC subroutine?
> >
> > Let's see the C actual source.
> >
> > I don't see this support call in our internal bug tracking system yet.
> >
> > --
> >
> > -- Rob
>
> Bill Hall, our OpenVMS system manager, submitted the bug report at 10:07 a.m. Central Time (11:07 a.m. Eastern Time) today.
>
> No, this error is in the Basic subroutine, NOT the C program calling it. Here are the relevant statements in the Basic subroutine:
> Declare String Output_Results_lsa ( nItems_lkl )
> . . .
> Call Returns_Elig ( Procedure_Name_ls, Input_Data_lsa(), Output_Results_lsa(), Message_ls )
> DR3_Quantity_al = Integer ( Output_Results_lsa (1), Long )
> DR2_Quantity_al = Integer ( Output_Results_lsa (2), Long )
> Oldest_Invoice_Number_as = Output_Results_lsa (3)
>
> The suffixes _ls and _lsa refer to "local string" and "local string array", respectively.
>
> The error occurs at the assignment to Oldest_Invoice_Number_as. Interestingly, the value is assigned properly before the error condition is triggered. I know that from looking at the variables in the OpenVMS debugger.
>
> The string variables are passed from C to basic using variable-length string descriptors. The reading of the input string variables, passed the same way, works properly but not assigning to string variables.
>
> Sincerely,
> Craig T. Dedo. OpenVMS Software Development Consultant
> Navistar, Inc.
> 2701 Navistar Drive
> Lisle, IL 60532
I forgot to include the two statements before the statement Call Returns_Elig().
Input_Data_lsa (1) = Customer_Location_Code_as
Input_Data_lsa (2) = Part_Number_as
Both of these statements execute flawlessly. All three string variables, Customer_Location_Code_as, Part_Number_as, and Oldest_Invoice_Number_as are passed in exactly the same manner.
More information about the Info-vax
mailing list