comp.lang.ada
 help / color / mirror / Atom feed
From: Kilgallen@SpamCop.net (Larry Kilgallen)
Subject: Re: combine Ada with MS VS C++
Date: 16 Mar 2005 08:18:51 -0600
Date: 2005-03-16T08:18:51-06:00	[thread overview]
Message-ID: <iB0eoGAzMvsw@eisner.encompasserve.org> (raw)
In-Reply-To: 1110978291.469762.247330@g14g2000cwa.googlegroups.com

In article <1110978291.469762.247330@g14g2000cwa.googlegroups.com>, ich_bin_elvis@hotmail.com writes:

> Im working on an project where we have an drone traversing a field on
> GPS signals, this project is written in MS VS C++. Our plan is to "pull
> out" the most saefty critical code to ada. We have created an DLL file
> and imported the adadll.lib file in MS VS C++. We have managed to move
> some functions for distance and angle to ada. These functions return
> only one "double" but the problem is that the VS C++ code holds a lot
> of global variables.Some times our functions need to update more than
> one variable. Is there a possibilyty to return more than one variable
> from ada to MS VS C++(This is where the main is).

The typical approach to this with Ada is to create not a function
but a procedure.  A procedure can have multiple output parameters,
one of which could be the new value for the global.

The only real disadvantage this has over a function is that functions
can return arrays of undetermined (prior to the call) size, but that does
not seem to be your situation (and would be hard to receive in C++ anyway.



  reply	other threads:[~2005-03-16 14:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-16 13:04 combine Ada with MS VS C++ ich_bin_elvis
2005-03-16 14:18 ` Larry Kilgallen [this message]
2005-03-16 14:53   ` ich_bin_elvis
2005-03-16 16:42     ` Martin Krischik
2005-04-12 10:18       ` ich_bin_elvis
2005-04-12 14:38         ` ich_bin_elvis
2005-03-16 21:44     ` Ludovic Brenta
2005-03-16 22:18       ` Randy Brukardt
2005-03-17  3:32 ` David Botton
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox