473,394 Members | 1,674 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,394 software developers and data experts.

Porblem in reading Chr(0)

Hai Guys,
I'm facing a problem in reading the file values. When the record contains
the Chr(0) i can get the value till Chr(0). After Chr(0), I'm unable to get
the value. It's getting truncated.
When I tried with Console Application and tried to print it out, It's
working perfect. But when I'm using the Web Services to access the same
function, it's not getting the value.
Please help it's very urgent
Regards,
Venki

--
Expect the Worst,
Hope for the Best
Jul 21 '05 #1
3 1429
Venki <Ve***@discussions.microsoft.com> wrote:
I'm facing a problem in reading the file values. When the record contains
the Chr(0) i can get the value till Chr(0). After Chr(0), I'm unable to get
the value. It's getting truncated.
When I tried with Console Application and tried to print it out, It's
working perfect. But when I'm using the Web Services to access the same
function, it's not getting the value.


I'm sure it *is* getting the value - it's that whatever you're then
*doing* with it is stripping it or doesn't know how to handle it.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
Hai Jon,
Welcome back.
Both of use discussed the same topic a month ago. I'm still not rectified
it. As You said, I tried with a Console Application. The value are getting
fine. It's displaying the string what I want. I have a string like below

234mat1cat456bat'0'rat - let's assume this the whole string '0' represent
Chr(0) in the file
lsStr = "234mat1cat456bat'0'rat"
I first extracted mat and cat. I want to extract bat and rat. I used the
following to extract.

checkString = Mid(lsStr,1,10) - it gave the first part. Working perfectly.

But when I tried to execute following the problem started.
checkString = mid(lsStr,11) - it gave as "456 - not even end quotes

When I tried with following logic to read, ot gave a empty string or it
passes a empty string

extStr = Mid(checkString,4) - it has to extract bat'0'rat. But it is not.
I'm using Web Services to read the file. Please help. It's very urgnt.

Regards,
Venkatarajan

"Jon Skeet [C# MVP]" wrote:
Venki <Ve***@discussions.microsoft.com> wrote:
I'm facing a problem in reading the file values. When the record contains
the Chr(0) i can get the value till Chr(0). After Chr(0), I'm unable to get
the value. It's getting truncated.
When I tried with Console Application and tried to print it out, It's
working perfect. But when I'm using the Web Services to access the same
function, it's not getting the value.


I'm sure it *is* getting the value - it's that whatever you're then
*doing* with it is stripping it or doesn't know how to handle it.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3
Venki <Ve***@discussions.microsoft.com> wrote:
Welcome back.
Both of use discussed the same topic a month ago. I'm still not rectified
it. As You said, I tried with a Console Application. The value are getting
fine. It's displaying the string what I want. I have a string like below

234mat1cat456bat'0'rat - let's assume this the whole string '0' represent
Chr(0) in the file
lsStr = "234mat1cat456bat'0'rat"
I first extracted mat and cat. I want to extract bat and rat. I used the
following to extract.

checkString = Mid(lsStr,1,10) - it gave the first part. Working perfectly.

But when I tried to execute following the problem started.
checkString = mid(lsStr,11) - it gave as "456 - not even end quotes
That sounds like a display problem again, rather than an actual strange
string.
When I tried with following logic to read, ot gave a empty string or it
passes a empty string

extStr = Mid(checkString,4) - it has to extract bat'0'rat. But it is not.
I'm using Web Services to read the file. Please help. It's very urgnt.


Rather than using Mid, try using the standard .NET string manipulation
methods - Substring etc.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4

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

Similar topics

6
by: David Gray | last post by:
Greetings all, I'm working on a program that allows a user to enter notes in a multiline textbox. I would like to be able to read the contents of the textbox (as records - one per line) and...
6
by: Dietrich Epp | last post by:
Are there any good modules for reading a bitstream? Specifically, I have a string and I want to be able to get the next N bits as an integer. Right now I'm using struct.unpack and bit operations,...
11
by: Venkatarajan | last post by:
hai, At present I'm facing a strange problem. We are converting a project from VB to .NET One record contains Chr(0). Let the record be of length 1800. In the 50th byte of a record a chr(0) is...
3
by: CJM | last post by:
Does anyone have any experience of using barcode reading software with ASP applications? I have an ASP-based application where Serial No's are entered manually. The users want to move across to...
0
by: mahsa | last post by:
hi i have this code it has error that "stream was not readable" im new in xml do you have any idea?i have to pass data to site and get the reason in xm regards ... mahs // Put user code to...
9
by: jeff M via .NET 247 | last post by:
I'm still having problems reading EBCDIC files. Currently itlooks like the lower range (0 to 127) is working. I have triedthe following code pages 20284, 20924, 1140, 37, 500 and 20127.By working I...
3
by: Venki | last post by:
Hai Guys, I'm facing a problem in reading the file values. When the record contains the Chr(0) i can get the value till Chr(0). After Chr(0), I'm unable to get the value. It's getting truncated....
23
by: shank | last post by:
I have the below code found on an ASP site. <% arrName = Split(Request("TextArea"),",") %> <% For i = LBound(arrName) To UBound(arrName) Response.Write "ID: " & arrName(i) & "<br>" Next %>
1
by: Diego F. | last post by:
Hello. I'm having problems reading data from a socket. In my test, I see the maximum size to get data from the socket is 8192 bytes. In my tests, if I send less that 8192, the readen data have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.