By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,694 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,694 IT Pros & Developers. It's quick & easy.

WriteLine does not always add NewLine

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.