New topic: Represent data correctly from datagram place in memory block
<http://forums.realsoftware.com/viewtopic.php?t=26185> Page 1 of 1 [ 5 posts ] Previous topic | Next topic Author Message carlfitzsimmons Post subject: Represent data correctly from datagram place in memory blockPosted: Sat Jan 24, 2009 4:10 pm Joined: Tue Sep 19, 2006 5:10 pm Posts: 76 I just received some help on parsing a datagram and that works fine. Now I need to display the returned values correctly in a listbox. When I send out the following in a UDP format 10.8.32.105:2424, IO24 I receive back from that device 494F32340011BA02049B and have placed this in a memory block which appears as 494F 3234 0011 BA02 049B in the debugger. 494F3234 displays correctly as text which is IO24. The problem I am trying to solve is how to display the rest 0011 BA02 049B If you break this down the values are a correct MAC address 00 11 BA 02 04 9B but need to be converted to ASCII to be displayed as Text. If I could grab the low/high nibble from each byte I could easily convert. Any suggestions would be helpful? Top jefftullin Post subject: Re: Represent data correctly from datagram place in memory blockPosted: Sat Jan 24, 2009 4:17 pm Joined: Wed Nov 15, 2006 3:50 pm Posts: 232 Quote:So if the binary data that represents 2 bytes is 9B - valid 2 bytes for a MAC whose ASCII equivalent is õ what conversion is available to convert õ to 9B? This must be out there and at the moment I have not found it. Have you tried Hex()? Top carlfitzsimmons Post subject: Re: Represent data correctly from datagram place in memory blockPosted: Sat Jan 24, 2009 6:02 pm Joined: Tue Sep 19, 2006 5:10 pm Posts: 76 9B is what I want to display, however it is not in ASCII form from the datagram. I see it in the datagram only in the debugger under the binary tab of the memory block in the debugger. Hex does not work unless there is some way to pad the data. Top npalardy Post subject: Re: Represent data correctly from datagram place in memory blockPosted: Sat Jan 24, 2009 6:24 pm Joined: Sat Dec 24, 2005 8:18 pm Posts: 4319 Location: Canada, Alberta, Near Red Deer hex returns a string see if the string it return is 2 characters long and if not add a "0" to the front _________________ My web site Great White Software RBLibrary.com REALbasic learning Top timhare Post subject: Re: Represent data correctly from datagram place in memory blockPosted: Sat Jan 24, 2009 6:26 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 4236 Location: Portland, OR USA Do a search on these forums for StrToHex. Tim Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 5 posts ]
-- Over 900 classes with 18000 functions in one REALbasic plug-in. The Monkeybread Software Realbasic Plugin v8.1. <http://www.monkeybreadsoftware.de/realbasic/plugins.shtml> [email protected]
