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

Arne Vajhøj arne at vajhoej.dk
Fri Nov 8 17:04:22 EST 2019


On 11/8/2019 2:10 PM, Dave Froble wrote:
> On 11/8/2019 1:27 PM, Simon Clubley wrote:
>> On 2019-11-08, Bob Gezelter <gezelter at rlgsc.com> wrote:
>>> Been there, done that. In a variety of language combinations, some
>>> involving BASIC, some not.
>>
>> So have I in a variety of languages, but never involving DEC Basic...
>>
>> The kind of thing I was thinking of was if a C routine could pass
>> a null terminated string _directly_ into a DEC Basic function or
>> if DEC Basic functions could only receive strings when passed in
>> by descriptor.
> 
> Consider what is happening when a calling routine passes some data by 
> reference.  All that is being done is providing an address to a 
> location.  Yes, some languages allow for some declarations and testing. 
> But still, it is just an address.
> 
> Now consider the target routine.  It needs some direction as to what it 
> can or should do with that incoming argument.  If it is expecting a WORD 
> integer, then it needs a word integer in the argument list.  If it is 
> expecting a descriptor, then it needs to set up the proper descriptor in 
> the argument list.
> 
> It is when there is not agreement on what is at that location in memory 
> that the fun starts.
> 
> Now, most of the VMS languages play rather well in such an environment. 
> Then there is C, which does not play well in that environment.  There is 
> the VMS calling standard, and, there is the VMS data types.  Use them, 
> and things can work well.  C is not a native VMS language, as far as I 
> know, and doesn't embrace the calling standard, nor the data types.

C (and C++) is the native (=generating native code) language on VMS that
is the least VMSish regarding calls.

But it is also a very flexible language, so it is usually not that
hard to create something VMSish manually.

> As for what type of strings Basic supports, as far as I know it's only 
> strings defined by a descriptor.  Not sure if Basic supports all types 
> of string descriptors.

Based on this and the previous thread:

D : good
S : works for readonly fail for write
VS : ?

Arne



More information about the Info-vax mailing list