Click here to Skip to main content
13,260,330 members (42,251 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hai All,
In my VB Application i need to read null value....
Because after of null i get data ..... But because of null my data has been terminated ... Now how should i read data including null.......

Thanks in ADV
Posted 12-Mar-12 20:17pm
SAKryukov 13-Mar-12 1:20am
What do you call null in this case?
Himachandra 13-Mar-12 2:36am
i got some hex data from serialport ..... it has 8char size.... whenever null has been coming in that 8char data .... After of null char what ever the data has been discarded....... But i need to read all the 8chars including null.......
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

A null is nothing but a byte value of 0. So, scan your buffer after the read and look for a 0. There's your null.

Unless, of course, youre dealing with Unicode strings, in which case, it's two 0 values in a row.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please see my comment to the question. With the port, you transmit bytes, nothing else. It should make the answer apparent…


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 13 Mar 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100