[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Defining array constant

yue_nicholas

8/6/2006 12:56:00 PM

Hi,

I need to define two constant of array type, what is the recommended
way to do that?

rb_define_const(module, "MASK", ...mask value...is float[4][4]);
rb_define_const(module, "LIGHTTINT", ...color value...is float[3]);

I have seen example for string and integer but not for arrays.

Cheers

1 Answer

Logan Capaldo

8/6/2006 1:15:00 PM

0


On Aug 6, 2006, at 9:00 AM, yue_nicholas@hotmail.com wrote:

> Hi,
>
> I need to define two constant of array type, what is the recommended
> way to do that?
>
> rb_define_const(module, "MASK", ...mask value...is float[4][4]);
> rb_define_const(module, "LIGHTTINT", ...color value...is float[3]);
>
> I have seen example for string and integer but not for arrays.
>
> Cheers
>
>

Look at README.EXT. Specifically rb_ary_new and friends.