public struct VariablesGenerica { public ushort varWord0; public ushort varWord1; public ushort varWord2; public ushort varWord3; public ushort varWord4; public ushort varWord5; public ushort varWord6; public ushort varWord7; public ushort varWord8; public ushort varWord9; public ushort varWord10; public ushort varWord11; public ushort varWord12; public ushort varWord13; public ushort varWord14; public ushort varWord15; public ushort varWord16; public ushort varWord17; public ushort varWord18; public ushort varWord19; public ushort varWord20; public ushort varWord21; public ushort varWord22; public ushort varWord23; }
// v esta creado como v = new VariablesGenerica(); public VariablesGenerica actualizarstructs() { v.varWord0 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord1 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord2 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord3 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord4 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord5 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord6 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord7 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord8 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord9 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord10 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord11 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord12 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord13 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord14 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord15 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord16 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord17 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord18 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord19 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord20 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord21 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord22 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); v.varWord23 = (ushort)rand.Next(ushort.MinValue, ushort.MaxValue); return v; }
VariablesGenerica vari;vari= ClaseLoquesea.actualizarstructs();
if(vari.variable1==4){.....