[PD] Instantiating an array field in a struct

Samuel Rye samuel.rye at gmail.com
Mon Jul 9 23:48:23 CEST 2007


Ah, I got the same error!  I didn't check if it actually created it though.
I'll just extend the struct though, that seems cleaner.

Cheers!

-Brendan

On 7/8/07, Frank Barknecht <fbar at footils.org> wrote:
>
> Hallo,
> Frank Barknecht hat gesagt: // Frank Barknecht wrote:
>
> > You create a "points" instance with [append] as well. The problem is,
> > that [append] needs to set one field of the struct, when creating an
> > instance through an incoming message. But you cannot set an array with
> > a message directly
>
> Oh, I just found out, that you *can* indeed do this and create an
> array directly, as in attached patch. Pd warns "error:
> pd-points.array1: not a number", it ignores the value of that number,
> but still creates the array. For clarity I would still recommend to do
> as below:
>
> > so you should extend your struct definition by at
> > least one float variable. The implicit variables "x" or "y" come to
> > mind.
> >
> > So the solution is: you use [struct points float x array array1 point]
> > instead of your defintion, and then append with [append points x].
>
> Ciao
> --
> Frank Barknecht                 _ ______footils.org_ __goto10.org__
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070709/195af271/attachment.htm>


More information about the Pd-list mailing list