µTasker Forum
µTasker Forum => µTasker general => Topic started by: thamanjd on May 26, 2008, 09:40:20 AM
-
Can anybody point me to or like to share code for string to unsigned short (16bit) routine? this will be for reading an edit box from a web page to configure a tcp port number.
-
Hi
You should be able to use fnDecStrHex() to do this.
Eg:
usValue = (unsigned short)fnDecStrHex("12345");
If the input is in ASCII Hex the equivalent fnHexStrHex() can be used.
Eg:
usValue = (unsigned short)fnHexStrHex("aB24");
aB is used to show that the input is case-insensitive
Regards
Mark
-
Thanks, that worked out great.
JD