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

I'll bet there is a better way of doing this

P: n/a
I can't seem to get the one-line equivalent of this:
Dim tmp() As Integer = {100}

HistoryRichTextBox.SelectionTabs = tmp

This is a VB6 conversion. Is that still the way to do it?

Mid(aHistoryRichTextBox.Text, lLpCnt, 1) <> vbCr

So much has changed!

Thanks


Nov 21 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Dim tmp() As Integer = {100}
HistoryRichTextBox.SelectionTabs = tmp(0)

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

" Just Me" <ne********@a-znet.com> wrote in message
news:eZ**************@tk2msftngp13.phx.gbl...
I can't seem to get the one-line equivalent of this:
Dim tmp() As Integer = {100}

HistoryRichTextBox.SelectionTabs = tmp

This is a VB6 conversion. Is that still the way to do it?

Mid(aHistoryRichTextBox.Text, lLpCnt, 1) <> vbCr

So much has changed!

Thanks

Nov 21 '05 #2

P: n/a
* " Just Me" <ne********@a-znet.com> scripsit:
I can't seem to get the one-line equivalent of this:
Dim tmp() As Integer = {100}

HistoryRichTextBox.SelectionTabs = tmp


\\\
HistoryRichTextBox.SelectionTabs = New Integer() {100}
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

P: n/a
Sorry, my response is incorrect, see Herfrieds for the correct
implementation. ( I didnt check the RTB property )
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Dim tmp() As Integer = {100}
HistoryRichTextBox.SelectionTabs = tmp(0)

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

" Just Me" <ne********@a-znet.com> wrote in message
news:eZ**************@tk2msftngp13.phx.gbl...
I can't seem to get the one-line equivalent of this:
Dim tmp() As Integer = {100}

HistoryRichTextBox.SelectionTabs = tmp

This is a VB6 conversion. Is that still the way to do it?

Mid(aHistoryRichTextBox.Text, lLpCnt, 1) <> vbCr

So much has changed!

Thanks


Nov 21 '05 #4

P: n/a
Thanks to both - I new there was a better way!
" Just Me" <ne********@a-znet.com> wrote in message
news:eZ**************@tk2msftngp13.phx.gbl...
I can't seem to get the one-line equivalent of this:
Dim tmp() As Integer = {100}

HistoryRichTextBox.SelectionTabs = tmp

This is a VB6 conversion. Is that still the way to do it?

Mid(aHistoryRichTextBox.Text, lLpCnt, 1) <> vbCr

So much has changed!

Thanks

Nov 21 '05 #5

P: n/a
I wonder why you didn't answer the second question?

This is a VB6 conversion. Is that still the way to do it?
Mid(aHistoryRichTextBox.Text, lLpCnt, 1) <> vbCr
I know you both know the answer

Of course I appreciated anything I get - but I was wondering?

Thanks again for the help

" Just Me" <ne********@a-znet.com> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl...
Thanks to both - I new there was a better way!
" Just Me" <ne********@a-znet.com> wrote in message
news:eZ**************@tk2msftngp13.phx.gbl...
I can't seem to get the one-line equivalent of this:
Dim tmp() As Integer = {100}

HistoryRichTextBox.SelectionTabs = tmp

This is a VB6 conversion. Is that still the way to do it?

Mid(aHistoryRichTextBox.Text, lLpCnt, 1) <> vbCr

So much has changed!

Thanks


Nov 21 '05 #6

P: n/a

Try....

aHistoryRichTextBox.Text.Substring(lLpCnt, 1) <> vbCrLf

Hope this helps.

" Just Me" <ne********@a-znet.com> wrote in message
news:u9**************@TK2MSFTNGP10.phx.gbl...
I wonder why you didn't answer the second question?

This is a VB6 conversion. Is that still the way to do it?
Mid(aHistoryRichTextBox.Text, lLpCnt, 1) <> vbCr
I know you both know the answer

Of course I appreciated anything I get - but I was wondering?

Thanks again for the help

" Just Me" <ne********@a-znet.com> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl...
Thanks to both - I new there was a better way!
" Just Me" <ne********@a-znet.com> wrote in message
news:eZ**************@tk2msftngp13.phx.gbl...
I can't seem to get the one-line equivalent of this:
Dim tmp() As Integer = {100}

HistoryRichTextBox.SelectionTabs = tmp

This is a VB6 conversion. Is that still the way to do it?

Mid(aHistoryRichTextBox.Text, lLpCnt, 1) <> vbCr

So much has changed!

Thanks



Nov 21 '05 #7

P: n/a
Just Me,

Although I use the method as Matt, is in VBNet the Mid a normal method

Microsoft.visualbasic

http://msdn.microsoft.com/library/de...rykeywords.asp

This is not a compatibility class however a full dotNet part.

Just to add.

Cor
Nov 21 '05 #8

P: n/a

Thanks to both

Guess I'm trying to do thing the "new" way and often am not sure.
Nov 21 '05 #9

P: n/a
On 2004-08-26, Matt S <ma**@toomuchspamalready.com> wrote:

Try....

aHistoryRichTextBox.Text.Substring(lLpCnt, 1) <> vbCrLf


aHistoryRichTextBox.Text.Substring(lLpCnt - 1, 1) <> vbCrLf

would be more accurate. Mid is one-based, .NET strings are 0-based.

That's one reason I think it's a good idea to get away from the legacy
functions as much as possible. The little things like index differences
will kill you.

Nov 21 '05 #10

P: n/a
David,

Which legacy functions, there are a lot of legacy functions imported from C
as well. Choose for yourself what are the good ones. That is in my opinion a
better advice.

In my opinion are by instance the convert functions from VB very powerfull.

Cor

Nov 21 '05 #11

P: n/a
On 2004-08-26, Cor Ligthert <no**********@planet.nl> wrote:
David,

Which legacy functions, there are a lot of legacy functions imported from C
as well. Choose for yourself what are the good ones. That is in my opinion a
better advice.


"Choose for yourself" is what everybody does eventually, of course, but
it doesn't provide much guidance for somebody new to the language. As
for which functions to avoid, I'd advise new users to avoid the
VisualBasic namespace as much as possible, and I find that even new
users have an intuitive sense of which functions are in there. If one
later decides that there's useful stuff in MS.VBasic, by all means go
ahead and use it, *after* you understand what the pitfalls and
trade-offs are.
Nov 21 '05 #12

P: n/a
There is one advantage in using the Left, Right, and Mid in that they are
somewhat forgiving. For example if you have variable length strings, the
string a = "123" when used as Left(a, 5) will give you "123" whereas
a.substring(0,5) will give you an exception.

"David" wrote:
On 2004-08-26, Cor Ligthert <no**********@planet.nl> wrote:
David,

Which legacy functions, there are a lot of legacy functions imported from C
as well. Choose for yourself what are the good ones. That is in my opinion a
better advice.


"Choose for yourself" is what everybody does eventually, of course, but
it doesn't provide much guidance for somebody new to the language. As
for which functions to avoid, I'd advise new users to avoid the
VisualBasic namespace as much as possible, and I find that even new
users have an intuitive sense of which functions are in there. If one
later decides that there's useful stuff in MS.VBasic, by all means go
ahead and use it, *after* you understand what the pitfalls and
trade-offs are.

Nov 21 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.