You mean this?

  enum PhoneType {
    MOBILE = 0;
    HOME = 1;
    WORK = 2;
  }

  message PhoneNumber {
    required string number = 1;
    optional PhoneType type = 2 [default = HOME];

}
The zero is not a tag / field-number; it is just an enum value. The 2 on the
last line I've copied is a tag relating to a *use* of that enum.

Marc

On 19 April 2011 06:28, Canggih <cangca...@gmail.com> wrote:

> hello, i just wanna share.
>
> In Protobuf developer guide, in the sample proto file, there is a
> PhoneType enum data type, consist of MOBILE, HOME, and WORK. MOBILE
> use '0' as its tag number, and so on.
> Meanwhile, i'm using Protobuf plugin for Netbeans, for my project.
> When i was try to compile a proto file, there was an error. The error
> was in enum data type. Compiler couldn't compile enum data that had
> '0' tag number. Then, when I change to '1', it can run successfully.
>
> Any explanations?
>
> Thanks in advance
> Canggih
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>


-- 
Regards,

Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to