473,511 Members | 10,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WriteLine does not always add NewLine

I have never seen WriteLine fail to produce a NewLine, at least, not until
now:

I was playing with an example given on pages 51-52 of the book "A Visual
Basic 6 Programmer's Toolkit".
The book is accompanied by files for that chapter in which an example uses
VB 6's Print to output to a Form..
When upgrading the code to VB .NET 2002, the upgrade wizard did not like
Print, so I replaced Print with Debug.Print in the VB 6 code.
and constructed the test below.

NewLine does get added for the first two WriteLine statements, but not for
those using the strBCD variable. Typically, the strBCD variable will consist
of non-printable characters, so I expect this is somehow messing up
WriteLine.

In addition, the & " / " & strCVL & " / " is output ONLY for the final
WriteLine.

Is this a known problem?
Is WriteLine supposed to treat non-printable characters in this way?
Or am I somehow screwing up?

The MKL function makes a BCD Encoded string out of a type Integer (Long in
VB 6).
The CVL function makes an Integer (Long in VB 6) out of the BCD encoded
string produced by MKL.

Spell and SpellDollar are relevant to this thread as each produces a
printable string, which WriteLine handles correctly, i.e., adds the NewLine
format effector.

---------------------------

Option Strict Off
Option Explicit On
Module modHKTests
Public Sub Main()
Dim lngInput As Integer
Dim strBCD As String
Dim strCVL As String
Dim strTemp As String
System.Diagnostics.Debug.WriteLine(mNumbers.Spell( 169.51))
System.Diagnostics.Debug.WriteLine(mNumbers.SpellD ollar(169.51))
For lngInput = 15 To 20
strBCD = MKL(lngInput)
strCVL = Str(CVL(strBCD))
strTemp = lngInput & ": " & strBCD & " / " & strCVL & " / "
System.Diagnostics.Debug.WriteLine(strTemp)
Next lngInput
lngInput = 16777216
strBCD = MKL(lngInput)
strCVL = Str(CVL(strBCD))
strTemp = lngInput & ": " & strBCD & " / " & strCVL & " / "
System.Diagnostics.Debug.WriteLine(strTemp)
lngInput = 2147483647
strBCD = MKL(lngInput)
strCVL = Str(CVL(strBCD))
strTemp = lngInput & ": " & strBCD & " / " & strCVL & " / "
System.Diagnostics.Debug.WriteLine(strTemp)
End Sub
End Module

--
http://www.standards.com/; See Howard Kaikow's web site.
Nov 20 '05 #1
7 5517
Hello,

"Howard Kaikow" <ka****@standards.com> schrieb:
[...]

Please don't post the same question more than once.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
Hello,

"Howard Kaikow" <ka****@standards.com> schrieb:
[...]

Please don't post the same question more than once.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
I posted again because the original posting is not showing up here.
I even unsubscribed to the newsgroup, then resubscribed.
I still do not see the original thread.

I've seen this problem of disappearing threads/posts only on the msft news
server.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,

"Howard Kaikow" <ka****@standards.com> schrieb:
[...]

Please don't post the same question more than once.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #4
"Howard Kaikow" <ka****@standards.com> schrieb
I posted again because the original posting is not showing up
here. I even unsubscribed to the newsgroup, then resubscribed.
I still do not see the original thread.

I've seen this problem of disappearing threads/posts only on the msft
news server.


When I saw your question the second time I also thought: Haven't I already
read it a very short time ago? :) Yes, I did, but I couldn't find it
anymore. Strange....

--
Armin

Nov 20 '05 #5
I posted again because the original posting is not showing up here.
I even unsubscribed to the newsgroup, then resubscribed.
I still do not see the original thread.

I've seen this problem of disappearing threads/posts only on the msft news
server.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,

"Howard Kaikow" <ka****@standards.com> schrieb:
[...]

Please don't post the same question more than once.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #6
"Howard Kaikow" <ka****@standards.com> schrieb
I posted again because the original posting is not showing up
here. I even unsubscribed to the newsgroup, then resubscribed.
I still do not see the original thread.

I've seen this problem of disappearing threads/posts only on the msft
news server.


When I saw your question the second time I also thought: Haven't I already
read it a very short time ago? :) Yes, I did, but I couldn't find it
anymore. Strange....

--
Armin

Nov 20 '05 #7
I Just recalled that I've also seen the problem with posts in non-MSFT
newsgroups on another server, so it must be an Outlook Express problem.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
"Howard Kaikow" <ka****@standards.com> schrieb
I posted again because the original posting is not showing up
here. I even unsubscribed to the newsgroup, then resubscribed.
I still do not see the original thread.

I've seen this problem of disappearing threads/posts only on the msft
news server.


When I saw your question the second time I also thought: Haven't I already
read it a very short time ago? :) Yes, I did, but I couldn't find it
anymore. Strange....

--
Armin

Nov 20 '05 #8

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

Similar topics

20
7877
by: TTroy | last post by:
Hello, I have found some peculiar behaviour in the fgets runtime library function for my compiler/OS/platform (Dev C++/XP/P4) - making a C console program (which runs in a CMD.exe shell). The...
7
6340
by: shawnk | last post by:
Hello Everyone How do you format format numbers right-justified using Console.WriteLine(), i.e I need to line up numbers in vertical columns and the MSDN documentation is pretty poor Here is the...
4
3567
by: alberto | last post by:
In this code for a console application: int n; n = Console.Read(); Console.WriteLine(n); Console.ReadLine();
3
3760
by: Roy Gourgi | last post by:
Hi, How would I set the width of lnSize to 6 in the statement Console.WriteLine("Size of {0} ", lnSize); Furthermore is there a way to combine these 3 statements into 1 ...
0
491
by: Howard Kaikow | last post by:
I have never seen WriteLine fail to produce a NewLine, at least, not until now: I was playing with an example given on pages 51-52 of the book "A Visual Basic 6 Programmer's Toolkit". The book...
0
791
by: Howard Kaikow | last post by:
I have never seen WriteLine fail to produce a NewLine, at least, not until now: I was playing with an example given on pages 51-52 of the book "A Visual Basic 6 Programmer's Toolkit". The book...
4
10261
by: Dennis C. Drumm | last post by:
I've noticed that using Console.WriteLine statements to debug a Windows Forms Application will sometimes write output to the VS 2005 Output window and sometimes it doesn't. I know that...
2
33821
by: Fred Dag | last post by:
Hi, When writing using both these methods ( StreamWriter.Write("\n") vs WriteLine() ) to a file and open in Notepad I see a special character instead of newlines with Write("\n") vs a newline...
13
2233
by: Fir5tSight | last post by:
Hi All, I have a simple VB code: Sub OutputLine(ByRef Level As String, ByRef InfoString As String) Const gSTDOUT As Integer = -11 Dim hStdOut, BytesWritten As Integer Dim s As String s =...
25
5599
by: Peter Michaux | last post by:
Hi, I'm thinking about code minimization. I can think of a few places where whitespace matters a + ++b a++ + b a - --b a-- -b when a line ends without a semi-colon in which case the new...
0
7245
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
7144
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
7356
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,...
1
5069
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...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.