Nim's object variants are from Pascal, they are what you need. Smth like:
    
    
    Data = object {.packed.}
                case b: byte
                of 0:  AsChannelStatus01: TChannelStatus01
                of 1: AsVoltageList: array[0..127, single]
                # ...
                else: discard
    

Reply via email to