Home Help Center

Sequence inside a structure

msorenssonmsorensson Member Markus SorenssonOrganization: MSTECHProject: ice testing
I´m trying to put a sequence inside a structure but I get a Slice compilation error. Is it possible?

structure MyStructure{
  sequence<byte> someData;
  sequence<byte> moreData;

Thanks for your help


  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Markus

    You can put sequences inside a struct , note that the correct keyword is "struct" not "structure", actually you cannot define the sequence type inside the struct but you can write what you want as follow:
    module Demo
    sequence<byte> ByteSeq;
    struct MyStructure
        ByteSeq someData;
        ByteSeq moreData;

    Hope this help,
Sign In or Register to comment.