comp.lang.ada
 help / color / mirror / Atom feed
* COM problem
@ 2009-08-25 16:48 Pablo
  2009-08-25 19:07 ` Adam Beneschan
  2009-08-26  1:50 ` Steve D
  0 siblings, 2 replies; 9+ messages in thread
From: Pablo @ 2009-08-25 16:48 UTC (permalink / raw)


I have a field type Field_Type whose record values I have to set into
a variant variable. How do I do this?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COM problem
  2009-08-25 16:48 COM problem Pablo
@ 2009-08-25 19:07 ` Adam Beneschan
  2009-08-26 18:06   ` Chrono
  2009-08-26 19:47   ` Chrono
  2009-08-26  1:50 ` Steve D
  1 sibling, 2 replies; 9+ messages in thread
From: Adam Beneschan @ 2009-08-25 19:07 UTC (permalink / raw)


On Aug 25, 9:48 am, Pablo <pablit...@gmail.com> wrote:
> I have a field type Field_Type whose record values I have to set into
> a variant variable. How do I do this?

I can't speak for anyone else, but personally, I don't understand what
you're asking for.  If you provided an example, even an example
containing incorrect Ada code (or even code in some other programming
language) that attempts to do what you're trying to accomplish, it
might help some of us understand your question.

                                -- Adam



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COM problem
  2009-08-25 16:48 COM problem Pablo
  2009-08-25 19:07 ` Adam Beneschan
@ 2009-08-26  1:50 ` Steve D
  2009-08-26 18:07   ` Chrono
  2009-08-26 19:47   ` Chrono
  1 sibling, 2 replies; 9+ messages in thread
From: Steve D @ 2009-08-26  1:50 UTC (permalink / raw)


"Pablo" <pablittto@gmail.com> wrote in message 
news:1e5e4fd4-5de0-46e6-8c58-d2c7a6fb222a@k6g2000yqn.googlegroups.com...
>I have a field type Field_Type whose record values I have to set into
> a variant variable. How do I do this?


If you're using GNATCOM (for example):

  float_value : float := 42.0;
  variant_value : GNATCOM.Types.VARIANT;
  ...
  value := GNATCOM.VARIANT.To_VARIANT( float_value );


You can find GNATCOM at: http://sourceforge.net/projects/gnavi/files/

Regards,
Steve




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COM problem
  2009-08-25 19:07 ` Adam Beneschan
@ 2009-08-26 18:06   ` Chrono
  2009-08-26 19:42     ` Adam Beneschan
  2009-08-26 19:47   ` Chrono
  1 sibling, 1 reply; 9+ messages in thread
From: Chrono @ 2009-08-26 18:06 UTC (permalink / raw)


On 25 ago, 16:07, Adam Beneschan <a...@irvine.com> wrote:
> On Aug 25, 9:48 am, Pablo <pablit...@gmail.com> wrote:
>
> > I have a field type Field_Type whose record values I have to set into
> > a variant variable. How do I do this?
>
> I can't speak for anyone else, but personally, I don't understand what
> you're asking for.  If you provided an example, even an example
> containing incorrect Ada code (or even code in some other programming
> language) that attempts to do what you're trying to accomplish, it
> might help some of us understand your question.
>
>                                 -- Adam

Hi Adam, below I give some details...could you help me? Thanks.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COM problem
  2009-08-26  1:50 ` Steve D
@ 2009-08-26 18:07   ` Chrono
  2009-08-27  3:57     ` Steve D
  2009-08-26 19:47   ` Chrono
  1 sibling, 1 reply; 9+ messages in thread
From: Chrono @ 2009-08-26 18:07 UTC (permalink / raw)


On 25 ago, 22:50, "Steve D" <nospam_steve...@comcast.net> wrote:
> "Pablo" <pablit...@gmail.com> wrote in message
>
> news:1e5e4fd4-5de0-46e6-8c58-d2c7a6fb222a@k6g2000yqn.googlegroups.com...
>
> >I have a field type Field_Type whose record values I have to set into
> > a variant variable. How do I do this?
>
> If you're using GNATCOM (for example):
>
>   float_value : float := 42.0;
>   variant_value : GNATCOM.Types.VARIANT;
>   ...
>   value := GNATCOM.VARIANT.To_VARIANT( float_value );
>
> You can find GNATCOM at:http://sourceforge.net/projects/gnavi/files/
>
> Regards,
> Steve

You understood what I meant... but my problem is that my variable is a
record. Say us, I have a Field_Type defined as a record like
   type Field_Type is
      record
         Truth : GNATCOM.Types.VARIANT_BOOL;
         Determination    : Interfaces.C.double;
      end record;
so in my code I set the values like
   Field : Field_Type  := (Truth => 1, Determination => 5.323423423);

Then I have to convert this Field_Type Field into a Variant type
   My_Variant : aliased GNATCOM.Types.VARIANT;   ***

Due to I have to execute a method
   Method (Parameter_Doesnotmatter, My_Variant'access);

*** So this is the problem... would you please help me? Thanks so much.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COM problem
  2009-08-26 18:06   ` Chrono
@ 2009-08-26 19:42     ` Adam Beneschan
  0 siblings, 0 replies; 9+ messages in thread
From: Adam Beneschan @ 2009-08-26 19:42 UTC (permalink / raw)


On Aug 26, 11:06 am, Chrono <pablit...@gmail.com> wrote:
> On 25 ago, 16:07, Adam Beneschan <a...@irvine.com> wrote:
>
> > On Aug 25, 9:48 am, Pablo <pablit...@gmail.com> wrote:
>
> > > I have a field type Field_Type whose record values I have to set into
> > > a variant variable. How do I do this?
>
> > I can't speak for anyone else, but personally, I don't understand what
> > you're asking for.  If you provided an example, even an example
> > containing incorrect Ada code (or even code in some other programming
> > language) that attempts to do what you're trying to accomplish, it
> > might help some of us understand your question.
>
> >                                 -- Adam
>
> Hi Adam, below I give some details...could you help me? Thanks.

Ahh, I see---I thought it was a general Ada question; I didn't realize
that it had to do with GNATCOM, which I don't know anything about.
Sorry.

                                     -- Adam



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COM problem
  2009-08-25 19:07 ` Adam Beneschan
  2009-08-26 18:06   ` Chrono
@ 2009-08-26 19:47   ` Chrono
  1 sibling, 0 replies; 9+ messages in thread
From: Chrono @ 2009-08-26 19:47 UTC (permalink / raw)


On 25 ago, 16:07, Adam Beneschan <a...@irvine.com> wrote:
> On Aug 25, 9:48 am, Pablo <pablit...@gmail.com> wrote:
>
> > I have a field type Field_Type whose record values I have to set into
> > a variant variable. How do I do this?
>
> I can't speak for anyone else, but personally, I don't understand what
> you're asking for.  If you provided an example, even an example
> containing incorrect Ada code (or even code in some other programming
> language) that attempts to do what you're trying to accomplish, it
> might help some of us understand your question.
>
>                                 -- Adam

Thanks even though.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COM problem
  2009-08-26  1:50 ` Steve D
  2009-08-26 18:07   ` Chrono
@ 2009-08-26 19:47   ` Chrono
  1 sibling, 0 replies; 9+ messages in thread
From: Chrono @ 2009-08-26 19:47 UTC (permalink / raw)


On 25 ago, 22:50, "Steve D" <nospam_steve...@comcast.net> wrote:
> "Pablo" <pablit...@gmail.com> wrote in message
>
> news:1e5e4fd4-5de0-46e6-8c58-d2c7a6fb222a@k6g2000yqn.googlegroups.com...
>
> >I have a field type Field_Type whose record values I have to set into
> > a variant variable. How do I do this?
>
> If you're using GNATCOM (for example):
>
>   float_value : float := 42.0;
>   variant_value : GNATCOM.Types.VARIANT;
>   ...
>   value := GNATCOM.VARIANT.To_VARIANT( float_value );
>
> You can find GNATCOM at:http://sourceforge.net/projects/gnavi/files/
>
> Regards,
> Steve

And you, Steve, any idea?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: COM problem
  2009-08-26 18:07   ` Chrono
@ 2009-08-27  3:57     ` Steve D
  0 siblings, 0 replies; 9+ messages in thread
From: Steve D @ 2009-08-27  3:57 UTC (permalink / raw)


"Chrono" <pablittto@gmail.com> wrote in message 
news:61b5f53d-51f5-4f8e-8586-b176a75bb139@c14g2000yqm.googlegroups.com...
> On 25 ago, 22:50, "Steve D" <nospam_steve...@comcast.net> wrote:
>> "Pablo" <pablit...@gmail.com> wrote in message
>>
>> news:1e5e4fd4-5de0-46e6-8c58-d2c7a6fb222a@k6g2000yqn.googlegroups.com...
>>
>> >I have a field type Field_Type whose record values I have to set into
>> > a variant variable. How do I do this?
>>
>> If you're using GNATCOM (for example):
>>
>>   float_value : float := 42.0;
>>   variant_value : GNATCOM.Types.VARIANT;
>>   ...
>>   value := GNATCOM.VARIANT.To_VARIANT( float_value );
>>
>> You can find GNATCOM at:http://sourceforge.net/projects/gnavi/files/
>>
>> Regards,
>> Steve
>
> You understood what I meant... but my problem is that my variable is a
> record. Say us, I have a Field_Type defined as a record like
>   type Field_Type is
>      record
>         Truth : GNATCOM.Types.VARIANT_BOOL;
>         Determination    : Interfaces.C.double;
>      end record;
> so in my code I set the values like
>   Field : Field_Type  := (Truth => 1, Determination => 5.323423423);
>
> Then I have to convert this Field_Type Field into a Variant type
>   My_Variant : aliased GNATCOM.Types.VARIANT;   ***
>
> Due to I have to execute a method
>   Method (Parameter_Doesnotmatter, My_Variant'access);
>
> *** So this is the problem... would you please help me? Thanks so much.


You probably need to create a local of type GNATCOM.TYPES.VARIANT ... 
.something along the lines:

  My_Variant : aliased GNATCOM.Types.VARIANT;
  ...
  My_Variant := GNATCOM.VARIANT.To_VARIANT( Field.Truth );
  Method( Parameter_Doesnotmatter, My_Variant'access );

Unfortunately I haven't used Ada much in the last couple of years, and I 
don't have a compiler handy to verify this, but this is where I would start.

Regards,
Steve 




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-08-27  3:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-25 16:48 COM problem Pablo
2009-08-25 19:07 ` Adam Beneschan
2009-08-26 18:06   ` Chrono
2009-08-26 19:42     ` Adam Beneschan
2009-08-26 19:47   ` Chrono
2009-08-26  1:50 ` Steve D
2009-08-26 18:07   ` Chrono
2009-08-27  3:57     ` Steve D
2009-08-26 19:47   ` Chrono

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