[Info-vax] Any Way to Pass Character String Arguments from C to Basic?

Craig Dedo craig.dedo at gmail.com
Mon Oct 21 11:31:31 EDT 2019


Is there any way to pass character string arguments from a C program or procedure to a procedure written in Basic?  For both languages I'm using the current versions of the languages:  
    VSI C V7.4-002 on OpenVMS Alpha V8.4-2L2
    VSI BASIC V1.8-005 on OpenVMS V8.4-2L2

I need to pass character string variables from a main program or procedure written in C to a subroutine written in Basic and get back character string data from the Basic subroutine.  I had to write the subroutine in Basic because it needs to call a utility subroutine in Basic that uses arrays of varying-length character strings.

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

I have already documented the fatal error and reported it to our firm's OpenVMS system manager who reported it to VMS Support at VSI a few minutes ago.

While we are waiting for a reply from VSI, is there any way around this defect in the String module of the OpenVMS Run Time Library?  Here are the procedure interfaces:

C side (caller):
void Get_DIA_Return_Eligibility ( struct dsc$descriptor_d *Customer_Location_Code_adsc, struct dsc$descriptor_d *Part_Number_adsc, long *DR3_Quantity_al, long *DR2_Quantity_al, struct dsc$descriptor_d *Oldest_Invoice_Number_adsc, struct dsc$descriptor_d *SQL_Status_adsc, struct dsc$descriptor_d *SQL_Message_adsc );

Basic side (callee):
Sub Get_DIA_Return_Eligibility ( String Customer_Location_Code_as, String Part_Number_as, Long DR3_Quantity_al, Long DR2_Quantity_al, String Oldest_Invoice_Number_as, String SQL_Status_as, String SQL_Message_as )

BTW, this is NOT an academic assignment.  It is a real production problem in a commercial environment with real profit and loss responsibility and real money at stake.

Any help would be very much appreciated.

Sincerely,
Craig T. Dedo. OpenVMS Software Development Consultant
Navistar, Inc.
2701 Navistar Drive
Lisle, IL   60532



More information about the Info-vax mailing list