473,320 Members | 2,029 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,320 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 1426
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.