This is driving me nuts... Incoming hex strings from a Dictionary object - they all seem to be ok as 'strings', but I've tried several methods to return the values in those fields... Ended up with this expanded code to find the issue.
for (UInt16 i = 0; i < Convert.ToUInt16(addressList["NUM_ALIAS"],16); i++)
{
// loop through all blocked values
UInt16 blockSize = Convert.ToUInt16(addressList["LEN_ALIAS_FROM"], 16);
UInt16 blockBase = Convert.ToUInt16(addressList["ALIASFROM"], 16);
UInt16 blockAddr = blockBase + (i * blockSize);
// use the values
:::
}
The syntax checker indicates an error -underlining- >>>blockBase + (i * blockSize)<<<
ERROR: Cannot implicitly convert type int to ushort
Thoughts appreciated - and I can learn something! FLAGGED AS DUPLICATE? I can't see it anywhere else with my issue. ((Can mod please link to the duplicate so I/we can see it ?)) Aah - ok the duplicate was shown up the top after I opened it for editing and saved it.