473,320 Members | 1,862 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.

Microsoft.VisualBasic.String.Left

I have two questions with regards to the LEFT function.

I ran into a problem with the LEFT function today. I knew it was a valid
Function, but when I tried to use it, it was getting interpreted as the LEFT
location of a control or something like that, instead of the LEFT function.
(I want to extract the left portion of a string). Anyway, I knew what I
needed was to find out what IMPORTS I was missing. After finding a posting on
MSDN that spoke about a similar issue, I realized I did not need an imports,
but I need to refer to it like Microsoft.VisualBasic.String.Left and it
worked fine. In fact, using Microsoft.VisualBasic.String as an import did not
allow me to use just the LEFT function by itself. I'm assuming this si
because there is already another LEFT defined.

Now my questions.

1. I assume there is a better way of doing this now with VB.Net 2005 since I
need to reference it the way I did. Is there a different command I should be
using in VB.Net 2005 in place of the VB6 way of doing it?

2. I know of a method/function I want to use. In this case, it was LEFT.
But, I don't know the namespace I need to include in my Imports section.
Knowing the command I want to use, how can I find out what Imports I need to
reference to use it?

Thanks,
Greg
Oct 22 '07 #1
6 6732
"Greg" <Ac**********@newsgroups.nospamschrieb
I have two questions with regards to the LEFT function.

I ran into a problem with the LEFT function today. I knew it was a
valid Function, but when I tried to use it, it was getting
interpreted as the LEFT location of a control or something like
that, instead of the LEFT function. (I want to extract the left
portion of a string). Anyway, I knew what I needed was to find out
what IMPORTS I was missing. After finding a posting on MSDN that
spoke about a similar issue, I realized I did not need an imports,
but I need to refer to it like Microsoft.VisualBasic.String.Left and
it worked fine. In fact, using Microsoft.VisualBasic.String as an
import did not allow me to use just the LEFT function by itself. I'm
assuming this si because there is already another LEFT defined.

Now my questions.

1. I assume there is a better way of doing this now with VB.Net 2005
since I need to reference it the way I did. Is there a different
command I should be using in VB.Net 2005 in place of the VB6 way of
doing it?

TheString.SubString(0, ...)
2. I know of a method/function I want to use. In this case, it was
LEFT. But, I don't know the namespace I need to include in my
Imports section. Knowing the command I want to use, how can I find
out what Imports I need to reference to use it?
Alt+F12 (or "symbol search" in Edit menu): "Left" <enter>
Armin
Oct 22 '07 #2
"Greg" <Ac**********@newsgroups.nospamwrote in message
news:3A**********************************@microsof t.com...
>I have two questions with regards to the LEFT function.

I ran into a problem with the LEFT function today. I knew it was a valid
Function, but when I tried to use it, it was getting interpreted as the
LEFT
location of a control or something like that, instead of the LEFT
function.
(I want to extract the left portion of a string). Anyway, I knew what I
needed was to find out what IMPORTS I was missing. After finding a posting
on
MSDN that spoke about a similar issue, I realized I did not need an
imports,
but I need to refer to it like Microsoft.VisualBasic.String.Left and it
worked fine. In fact, using Microsoft.VisualBasic.String as an import did
not
allow me to use just the LEFT function by itself. I'm assuming this si
because there is already another LEFT defined.

Now my questions.

1. I assume there is a better way of doing this now with VB.Net 2005 since
I
need to reference it the way I did. Is there a different command I should
be
using in VB.Net 2005 in place of the VB6 way of doing it?

2. I know of a method/function I want to use. In this case, it was LEFT.
But, I don't know the namespace I need to include in my Imports section.
Knowing the command I want to use, how can I find out what Imports I need
to
reference to use it?

Thanks,
Greg
The LEFT, RIGHT and MID function all run fine in my copy of VS2005 Pro.
Perhaps you need to reference the Microsoft.Visualbasic library.
Oct 22 '07 #3
Thanks for the info on the Symbol Search. I was using the Object Browser and
it seems they both pretty much return the same thing, so I guess I must have
been on the right track. I just have a hard time finding something useful
sometimes using these tools.

Anyway, regarding the SubString method. I typed in my variable,
txtVariable... and SubString did not appear in the listing. Again, I figured
I was missing an Imports and I added System.String as one option. Still it
did not work. Just as I was getting ready to tell you it does not work, I
realized I needed to do it this way. txtVariable.TEXT.SubString(x,y). Now it
works just as needed.

Thanks.

Thanks,
Greg

"Armin Zingler" wrote:
"Greg" <Ac**********@newsgroups.nospamschrieb
I have two questions with regards to the LEFT function.

I ran into a problem with the LEFT function today. I knew it was a
valid Function, but when I tried to use it, it was getting
interpreted as the LEFT location of a control or something like
that, instead of the LEFT function. (I want to extract the left
portion of a string). Anyway, I knew what I needed was to find out
what IMPORTS I was missing. After finding a posting on MSDN that
spoke about a similar issue, I realized I did not need an imports,
but I need to refer to it like Microsoft.VisualBasic.String.Left and
it worked fine. In fact, using Microsoft.VisualBasic.String as an
import did not allow me to use just the LEFT function by itself. I'm
assuming this si because there is already another LEFT defined.

Now my questions.

1. I assume there is a better way of doing this now with VB.Net 2005
since I need to reference it the way I did. Is there a different
command I should be using in VB.Net 2005 in place of the VB6 way of
doing it?


TheString.SubString(0, ...)
2. I know of a method/function I want to use. In this case, it was
LEFT. But, I don't know the namespace I need to include in my
Imports section. Knowing the command I want to use, how can I find
out what Imports I need to reference to use it?

Alt+F12 (or "symbol search" in Edit menu): "Left" <enter>
Armin
Oct 22 '07 #4
On Oct 22, 3:30 pm, Greg <AccessVBA...@newsgroups.nospamwrote:
I have two questions with regards to the LEFT function.

I ran into a problem with the LEFT function today. I knew it was a valid
Function, but when I tried to use it, it was getting interpreted as the LEFT
location of a control or something like that, instead of the LEFT function.
(I want to extract the left portion of a string). Anyway, I knew what I
needed was to find out what IMPORTS I was missing. After finding a posting on
MSDN that spoke about a similar issue, I realized I did not need an imports,
but I need to refer to it like Microsoft.VisualBasic.String.Left and it
worked fine. In fact, using Microsoft.VisualBasic.String as an import did not
allow me to use just the LEFT function by itself. I'm assuming this si
because there is already another LEFT defined.
I used to reference the Left function with:

Imports Microsoft.VisualBasic = VB

VB.Left(string, 10)
>
Now my questions.

1. I assume there is a better way of doing this now with VB.Net 2005 since I
need to reference it the way I did. Is there a different command I should be
using in VB.Net 2005 in place of the VB6 way of doing it?
There is no direct replacement in the .NET framework. You can perform
the same effective function with the .Substring method in the String
class.
>
2. I know of a method/function I want to use. In this case, it was LEFT.
But, I don't know the namespace I need to include in my Imports section.
Knowing the command I want to use, how can I find out what Imports I need to
reference to use it?
The help file. I just did a search on "left string function" and one
of the the first hits was:

http://msdn2.microsoft.com/en-us/lib...ft(VS.80).aspx

Which clearly indicates that the function is referenced in the
Microsoft.VisualBasic namespace.

>
Thanks,
Greg

Oct 22 '07 #5
Hi Greg,

Would you mind letting me know the result of the suggestions? If you need
further assistance, feel free to let me know. I will be more than happy to
be of assistance.

Have a great day!

Sincerely,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 25 '07 #6
Just taking a moment to update you on where I'm at.

Rather than using the LEFT function from the Microsoft.VisualBasic library I
am using the SubString instead. I want to avoid using older VB 6.0 types of
methods and functions when at all possible.

"Jialiang Ge [MSFT]" wrote:
Hi Greg,

Would you mind letting me know the result of the suggestions? If you need
further assistance, feel free to let me know. I will be more than happy to
be of assistance.

Have a great day!

Sincerely,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 25 '07 #7

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

Similar topics

2
by: RitaG | last post by:
Hi. I have a utility program that has a form that allows a user to select a file. I'm then using the LEFT Function to get some information. sNewFilePathName = Left(sFilePathName, iCnt) I'm...
15
by: Phill. W | last post by:
Is anyone writing VB.Net (2003) code /without/ referencing the Microsoft.VisualBasic namespace(?), regardless of whether its Import'ed or not? The Powers That Be here are trying to introduce a...
14
by: frostalicious | last post by:
Used VB.NET (on my client PC) to convert VB6 executable to .NET executable. Placed the .exe file on a network drive on my server. From client, ran .NET Wizards "Trust an Assembly" to make the...
7
by: Dale Beane | last post by:
When I try to run a program in the debugger I get the following error message. Any help? 'Microsoft.VisualBasic.Left' is not declared or the module containing it is not loaded in the debugging...
34
by: Craig Buchanan | last post by:
Which vb.net object is the best match for the vb6 collection class? Specifically, I would like to be able to access the Item property with an index or a key string. I wrote my own class that...
8
by: Dave | last post by:
I'm trying to import Microsoft.VisualBasic to use the IsNumeric function in my C# code but all I see is: Microsoft.VisualBasic.VBCodeProvider while using Intellisense... From samples shouldn't...
3
by: AWW | last post by:
RichTextBox.Text = string & vbCR works but if I extract a substring with microsoft.visualbasic.left then vbCR stops working. I can do F5 executes with/without the Left and the vbCr does/doesNot...
32
by: Greg | last post by:
I know I can use the Microsoft.VisualBasic.Left function to get the left portion of a string, but I would prefer to avoid using any Microsoft.VisualBasic namespace items. What is the equivilant in...
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
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...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.