473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

unwanted characters in a textbox

I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 [][] how can I get rid of the [][]
characters????
Jul 24 '08 #1
6 1686
cmdolcet69 wrote:
I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 [][] how can I get rid of the [][]
characters????
Is your textbox a multiline textbox? If so the chars you see may be a
carriage return / line feed. Perhaps showing some code might help.

LS
Jul 24 '08 #2
cmdolcet69 wrote:
I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 [][] how can I get rid of the [][]
characters????
Is your textbox a multiline textbox? If so the chars you see may be a
carriage return / line feed. Perhaps showing some code might help.

LS
Jul 24 '08 #3
On Jul 24, 2:11 pm, Lloyd Sheen <a...@b.cwrote:
cmdolcet69 wrote:
I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 [][] how can I get rid of the [][]
characters????

Is your textbox a multiline textbox? If so the chars you see may be a
carriage return / line feed. Perhaps showing some code might help.

LS
There really isn;t any code all i do is pull the serial information
from a controller....what would be the best way to get those [] [] off?
Jul 25 '08 #4
On Jul 24, 2:11 pm, Lloyd Sheen <a...@b.cwrote:
cmdolcet69 wrote:
I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 [][] how can I get rid of the [][]
characters????

Is your textbox a multiline textbox? If so the chars you see may be a
carriage return / line feed. Perhaps showing some code might help.

LS
Lloyd, here the code the STRdata is tring to convert the
end.GetString(mabtRxbuf) but the string value coming over is for
example "0.10[][]

what is going on?
Public Function ReadValidatedData(ByVal Bytes2Read As Integer) As
Integer
Dim iReadChars, iRc As Integer
Dim strdata as string

' If Bytes2Read not specified uses Buffersize
If Bytes2Read = 0 Then Bytes2Read = miBufferSize
If mhRS = -1 Then
Throw New ApplicationException( _
"Please initialize and open port before using this
method")
Else
' Creates an event for overlapped operations
If meMode = Mode.Overlapped Then
pHandleOverlappedRead(Bytes2Read)
Else
' Non overlapped mode
ReDim mabtRxBuf(Bytes2Read - 1)
iRc = ReadFile(mhRS, mabtRxBuf, Bytes2Read,
iReadChars, Nothing)
Dim enc As New System.Text.ASCIIEncoding
STRdata = enc.GetString(mabtRxBuf)
If iRc = 0 Then
' Read Error
Throw New ApplicationException( _
"ReadFile error " & iRc.ToString)
Else
'commmented out because of issues with overflow
' Handles timeout or returns input chars
'If iReadChars < Bytes2Read Then
'Throw New IOTimeoutException("Timeout error")
'Else
mbWaitOnRead = True
Return (iReadChars)
End If
End If
End If
End Function
Jul 25 '08 #5
first it would be wise to figure out what the characters are

in excel enter the formula "=code(right(yourcell),1)) this will tell you the
character code for the last [] (replace youcell with the cell your data is in)

to know the fore last character use "=code(mid(yourcell,len(yourcell)-1,1))
(not 100% sure about the -1, might be -2... excel sometimes uses 1 as floor
and sometimes not)

If you get 10 and 13 you could enable wordwrap in excel (cellproperties,
second tab, one of the 3 checkboxes at the botom, and try again)

"cmdolcet69" wrote:
I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 [][] how can I get rid of the [][]
characters????
Jul 25 '08 #6
cmdolcet69 wrote:
On Jul 24, 2:11 pm, Lloyd Sheen <a...@b.cwrote:
>cmdolcet69 wrote:
>>I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 [][] how can I get rid of the [][]
characters????
Is your textbox a multiline textbox? If so the chars you see may be a
carriage return / line feed. Perhaps showing some code might help.

LS

Lloyd, here the code the STRdata is tring to convert the
end.GetString(mabtRxbuf) but the string value coming over is for
example "0.10[][]

what is going on?
Public Function ReadValidatedData(ByVal Bytes2Read As Integer) As
Integer
Dim iReadChars, iRc As Integer
Dim strdata as string

' If Bytes2Read not specified uses Buffersize
If Bytes2Read = 0 Then Bytes2Read = miBufferSize
If mhRS = -1 Then
Throw New ApplicationException( _
"Please initialize and open port before using this
method")
Else
' Creates an event for overlapped operations
If meMode = Mode.Overlapped Then
pHandleOverlappedRead(Bytes2Read)
Else
' Non overlapped mode
ReDim mabtRxBuf(Bytes2Read - 1)
iRc = ReadFile(mhRS, mabtRxBuf, Bytes2Read,
iReadChars, Nothing)
Dim enc As New System.Text.ASCIIEncoding
STRdata = enc.GetString(mabtRxBuf)
If iRc = 0 Then
' Read Error
Throw New ApplicationException( _
"ReadFile error " & iRc.ToString)
Else
'commmented out because of issues with overflow
' Handles timeout or returns input chars
'If iReadChars < Bytes2Read Then
'Throw New IOTimeoutException("Timeout error")
'Else
mbWaitOnRead = True
Return (iReadChars)
End If
End If
End If
End Function
You will need to find out what the two extra characters are.

In VS immediate window use:

?asc(STRdateSubstring(STRDataLength-1,1))
and
asc(songname.Substring(SongName.Length-2,1))

If the values returned are 13 and 10 you are getting a CR/LF
combination. If not this will help determine what the characters are.

LS
Jul 26 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Frank.Sebesta | last post by:
I have a wedge mag stripe reader that I swipe when ask to input information in a query. How do I filter the unwanted characters. Apparently there are two mag stripes that are read every time I...
4
by: David Beck | last post by:
I donwnload some files for processing every day that have unwanted characters in them. In VB6 I use the InputB to read in the text and the StrConv. vLinesFromFile =...
11
by: anony | last post by:
Hello, I can't figure out why my parameterized query from an ASP.NET page is dropping "special" characters such as accented quotes & apostrophes, the registered trademark symbol, etc. These...
1
by: Chris Kettenbach | last post by:
Good Morning, I have a text box on a webform I use to display a phone number. The database field does not contain parentheses or hyphens. I want the use to be able to change the textbox text and...
16
by: lovecreatesbeauty | last post by:
/* When should we worry about the unwanted chars in input stream? Can we predicate this kind of behavior and prevent it before debugging and testing? What's the guideline for dealing with it? ...
3
by: et | last post by:
How can I strip out unwanted characters in a string before updating the database? For instance, in names & addresses in our client table, we want only letters and numbers, no punctuation. Is...
11
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in...
4
by: vvenk | last post by:
Hello: I have a string, "Testing_!@#$%^&*()". It may have single and double quotations as well. I would like to strip all chararcters others than a-z, A-Z, 0-9 and the comma. I came across...
1
by: davidson1 | last post by:
hai friends.. I have the following code which should the user to enter only alphabetic characters...but this program...allow user to enter { } |\`~ characters also..how to avoid that......... ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.