how to resize a repeated field

631 views
Skip to first unread message

Romain François

unread,
Nov 10, 2009, 5:04:02 AM11/10/09
to Protocol Buffers
Hello,

For example if I have a repeated int32 field that currently contains 10
elements, and I want to modify the field to only contain 3 elements.

Is there a way to achieve this using the methods of the Reflection
class, or do I have to first ClearField, and then call AddInt32 three
times ?

Many thanks,

Romain

--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/EAD5 : LondonR slides
|- http://tr.im/BcPw : celebrating R commit #50000
`- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc

Romain François

unread,
Nov 10, 2009, 7:18:50 AM11/10/09
to Protocol Buffers
On 11/10/2009 11:04 AM, Romain François wrote:
>
> Hello,
>
> For example if I have a repeated int32 field that currently contains 10
> elements, and I want to modify the field to only contain 3 elements.
>
> Is there a way to achieve this using the methods of the Reflection
> class, or do I have to first ClearField, and then call AddInt32 three
> times ?
>
> Many thanks,
>
> Romain
>

Hi,

Sorry for wasting bandwidth, I should use RemoveLast I guess.

Reply all
Reply to author
Forward
0 new messages