Re: subscription example.. Integer_Array

3 views
Skip to first unread message

Ricardo Aguirre

unread,
Jan 29, 2012, 5:26:42 PM1/29/12
to ya...@googlegroups.com
I have a doubt,
I'm not really skilled using ada, and now I have some problems.
 
I just want to publish a  simple integer_Array that contain 3 integers values (1,2,3)
Theorically it should work but I get arange check failed
Can you give a hand?
I don't understand really well ada generics, and I lost a complete day...
This is my code:

And this is what I get:

Thank you

--Panzón



2012/1/28 Maciej Sobczak <see.my....@gmail.com>
On Jan 27, 5:41 pm, Ricardo Aguirre <el.mas...@gmail.com> wrote:

> I have another doubt:
> I saw that yami4 can send all Parameters defined in its package Parametershttp://www.inspirel.com/yami4/doc/ada/YAMI.Parameters.html
> There I can make basic typed_arrays (boolean, string, integer, etc) or
> nested types
> Looks really easy but
>
> I want to define a nestedtype that inside its collection, it has
> 1.- some basic Params type elements                               \\ I'm
> sure that I can define this
> 2.- an array of another (previously defined) nested type    \\ I don't know
> how to define this
>
> Do you know if it is possible, to define something like that?

In the current YAMI4 version it is not possible to create an array of
nested Parameters objects. This functionality might become part of
some future release.

Currently the workaround for this is to express the same data in a
different data structure that does not depend on arrays of Parameters.

> I see that you don't use idl on your examples.

That's right - YAMI4 does not use any static description of data
structures.
Please check the following article for some explanation:

http://www.inspirel.com/articles/What_Is_Wrong_With_IDL.html

Regards,

--
Maciej Sobczak * http://www.inspirel.com

Maciej Sobczak

unread,
Jan 30, 2012, 1:20:58 PM1/30/12
to yami4
On Jan 29, 11:26 pm, Ricardo Aguirre <el.mas...@gmail.com> wrote:
> I have a doubt,
> I'm not really skilled using ada, and now I have some problems.

> This is my code <http://pastebin.com/6h2WTJFZ>:
>
> And this is what I get <http://pastebin.com/mkZ42mSr>:

Just as the compiler says:

frame_publisher.adb:92:43: warning: value not in range of subtype of
"My_Index_Type" defined at line 52
frame_publisher.adb:92:43: warning: "Constraint_Error" will be raised
at run time

What you have in line 92 is:

Ada.Text_IO.Put_Line ("Ball_PositionX " &
My_Int_Type'Image (Position2(0)));

and the type definitions are:

type My_Int_Type is new Integer;
type My_Index_Type is new Positive;
type My_Int_Array is array (My_Index_Type range <>)
of My_Int_Type;

This means that indices in your array are positive numbers and you use
0. Try 1 instead if you mean the first array element.

Please note that this is not the YAMI4 problem and it does not really
belong to this discussion group.

Ricardo Aguirre

unread,
Jan 30, 2012, 1:31:17 PM1/30/12
to ya...@googlegroups.com
I can't belive it!
I feel really really stupid

Thank you men






--Panzón
Reply all
Reply to author
Forward
0 new messages