switch (formatData ToUpper ()) {
Case "ABCD" :
MFormat=Enums. ModbusDataFormat. ABCD.
break;
Case "CDAB" :
MFormat=Enums. ModbusDataFormat. CDAB;
break;
Case "BADC" :
MFormat=Enums. ModbusDataFormat. BADC;
break;
Case "DCBA" :
MFormat=Enums. ModbusDataFormat. DCBA;
break;
Case "ABCDEFGH" :
MFormat=Enums. ModbusDataFormat. ABCDEFGH;
break;
Case "GHEFCDAB" :
MFormat=Enums. ModbusDataFormat. GHEFCDAB;
break;
Case "BADCFEHG" :
MFormat=Enums. ModbusDataFormat. BADCFEHG;
break;
Case "HGFEDCBA" :
MFormat=Enums. ModbusDataFormat. HGFEDCBA;
break;
Default:
MFormat=Enums. ModbusDataFormat. None;
break;
}
CodePudding user response:
FormatData value is converted into capital, according to the conversion value select the branch, for mFormat gives corresponding enumeration valuesCodePudding user response:
13 years old users, you're not, if not learn c #, learning other languages can know what's the meaning of ah ~ this is according to the string formatData mFormat fu enumeration values