[Info-vax] Any Way to Pass Arrays of Strings from C to Basic?

Craig Dedo craig.dedo at gmail.com
Wed Nov 6 22:11:44 EST 2019


On Wednesday, November 6, 2019 at 6:49:20 PM UTC-6, Arne Vajhøj wrote:
> On 11/6/2019 11:51 AM, Dave Froble wrote:
> > On 11/6/2019 7:38 AM, seasoned_geek wrote:
> >> On Thursday, October 31, 2019 at 4:38:48 PM UTC-5, Stephen Hoffman wrote:
> >>> Better still, expunge the BASIC code entirely, if the folks working 
> >>> here are not familiar with mixed-language programming on OpenVMS.  Or 
> >>> wrap the BASIC code in something more easily callable.  These 
> >>> approaches were mentioned last time too, but I don't recall seeing a 
> >>> reply.
> >>
> >> The core business system is in BASIC. It's also the profit center of 
> >> the company.
> > 
> > Ayep!  Transcomm Data System's TOLAS software.
> > 
> > Which then causes me to wonder why there is any C code in use?
> 
> I don't know anything about that company, but if I were to guess then
> I would say that it could be like:
> * they don't have any VMS Basic developers
> * they have C developers
> * management decided due to above to write new code in C instead of VMS 
> Basic
> * now they are realizing that they don't have C developers that know how 
> to call VMS Basic from C
> 
> :-)
> 
> Arne

Actually, it's a new development project.  Management decided that it would like to tighten up the rules for what dealers can return to Navistar.  The current software is inadequate.

This project requires communication between two unlike information systems that are written in different languages.  The only thing that they have in common is that both systems run under the same version of the OpenVMS operating system.  

The accounting system is TOLAS and is written in Basic.  It uses RMS indexed files for its data storage, not a relational database system.  

The inventory system for managing the inventories at the dealerships is a home-grown system called the Dealer Inventory Alliance (DIA).  It is written in C and uses 6 different RDBMSes for its data storage.  

Why is DIA written in C?  Ask Roland Hughes, aka, seasoned_geek.  The old-timers told me that he made that decision.

BTW, I own a copy of Roland's book, The Minimum You Need to Know About OpenVMS Software Development.  I have read it cover to cover.

In order to implement the new rules for returning parts, DIA needs to inquire what the return eligibility for each part is.  The inquiry subroutines are written in Basic.  Due to network latency and the need for reasonable turnaround times, we need to inquire about returns eligibility for a whole list of parts at one time, not one by one.  Hence, the need to inquire using arrays instead of scalars from DIA (written in C) to the inquiry subroutines (written in Basic).

Thus, Arne's guess is incorrect.
* Navistar has both VMS Basic developers and VMS C developers.
* I am writing the interface between DIA and the inquiry subroutines in a mix of both C and Basic.
* I have read all of the technical info that I have access to about how to call Basic from C.  Unfortunately, as others have noted, there are a lot of gaps in the technical documentation, especially as to how to pass arrays between different languages and how to construct the descriptors properly.

FWIW, I'm nearing completion of a work-around.  I believe that as of 21:00 American Central Time on Wednesday, November 6, 2019, I have the logic and interfaces correct.  However, I still have to do some unit testing before I can say for sure that my work-around works correctly.

Hope this helps.

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



More information about the Info-vax mailing list