473,657 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Left, Right Functions

I have:

If (Microsoft.Visu alBasic.Left(Te xtBox1.Text, 1) = "$") Then

TextBox1.Text = Microsoft.Visua lBasic.Right(Te xtBox1.Text,
TextBox1.Text.L ength - 1)

End If

Adding: Imports Microsoft.Visua lBasic

And removing the "Microsoft.Visu alBasic" from the Left and Right functions
gives me a compile error.

Why?


Nov 21 '05 #1
11 5102

"Bruce A. Julseth" <br***********@ attglobal.net> wrote in message
news:uS******** ******@TK2MSFTN GP09.phx.gbl...
I have:

If (Microsoft.Visu alBasic.Left(Te xtBox1.Text, 1) = "$") Then

TextBox1.Text = Microsoft.Visua lBasic.Right(Te xtBox1.Text,
TextBox1.Text.L ength - 1)

End If

Adding: Imports Microsoft.Visua lBasic

And removing the "Microsoft.Visu alBasic" from the Left and Right functions
gives me a compile error.

Why?


Never mind. I just read where these functions must be fully qualified...

Thanks...
Nov 21 '05 #2
"Bruce A. Julseth" <br***********@ attglobal.net> wrote in message
news:uS******** ******@TK2MSFTN GP09.phx.gbl...
I have:
If (Microsoft.Visu alBasic.Left(Te xtBox1.Text, 1) = "$") Then
TextBox1.Text = Microsoft.Visua lBasic.Right(Te xtBox1.Text,
TextBox1.Text.L ength - 1)
End If

Adding: Imports Microsoft.Visua lBasic
And removing the "Microsoft.Visu alBasic" from the Left and Right
functions gives me a compile error.


I agree, it /shouldn't/ give you an error and, I suspect, several attempts
at rebuilding the entire Solution will /probably/ make the problem go
away.

But then so would rewriting the above to use the String class methods,
as in :

If TextBox1.Text.S tartWith( "$" ) Then
TextBox1.Text = TextBox1.Text.S ubstring( 1 )
' OK; it /doesn't/ allow for when the text is /only/ "$" ...
End If

HTH,
Phill W.
Nov 21 '05 #3
"Bruce A. Julseth" <br***********@ attglobal.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..

"Bruce A. Julseth" <br***********@ attglobal.net> wrote in message
news:uS******** ******@TK2MSFTN GP09.phx.gbl... .. . .
Adding: Imports Microsoft.Visua lBasic
And removing the "Microsoft.Visu alBasic" from the Left and Right
functions gives me a compile error.

Never mind. I just read where these functions must be fully qualified...


/Where/ did you read that? Just curious ...

Regards,
Phill W.
Nov 21 '05 #4

"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:cu******** **@yarrow.open. ac.uk...
"Bruce A. Julseth" <br***********@ attglobal.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..

"Bruce A. Julseth" <br***********@ attglobal.net> wrote in message
news:uS******** ******@TK2MSFTN GP09.phx.gbl...

. . .
Adding: Imports Microsoft.Visua lBasic
And removing the "Microsoft.Visu alBasic" from the Left and Right
functions gives me a compile error.

Never mind. I just read where these functions must be fully qualified...


/Where/ did you read that? Just curious ...

Regards,
Phill W.


Here is where I found it:

ms-help://MS.VSCC/MS.MSDNVS/vblr7/html/vafctLeft.htm

Thanks..

Bruce

Nov 21 '05 #5
Bruce,

You should have a reference to your Microsoft.Visua lBasic namespace which is
when you use VSNet with VBNet as with the import standard set. (See your
project properties for that).
You can than do Right(whatever)

By the way the full path to the right function is
Microsoft.Visua lBasic.Strings. Right

Although I prefer the simple
If textbox1.text.s ubstring(0,1) = "$"

I hope this gives some idea's

Cor
Nov 21 '05 #6

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:uk******** ******@TK2MSFTN GP09.phx.gbl...
Bruce,

You should have a reference to your Microsoft.Visua lBasic namespace which is when you use VSNet with VBNet as with the import standard set. (See your
project properties for that).
You can than do Right(whatever)

By the way the full path to the right function is
Microsoft.Visua lBasic.Strings. Right

Although I prefer the simple
If textbox1.text.s ubstring(0,1) = "$"

I hope this gives some idea's

Cor


Cor:

By "reference to your Microsoft.Visua lBasic namespace ", do you mean that I
should have the following:

Imports Microsoft.Visua lBasic
..
Then the following should work? It doesn't. I get a compile error when the
web page is compiled

If (Left(TextBox1. Text, 1) = "$") Then

TextBox1.Text = Right(TextBox1. Text, TextBox1.Text.L ength - 1)

End If

If this is not what you mean, then I don't understand your reply.

Thanks.

Bruce
Adding:

Nov 21 '05 #7
Bruce,

Normally (I saw now that you are using Visual Studio Net or Visual Studio
Basic), there should be a automaticly reference when you have created a form
project using new project.

That you can see in the solution explorer which is usual a right side. In
that is a (directory) tab References, when you open that you should see all
your refences and in that "Microsoft.Visu alBasic". When not, than you can
set it by rightclicking on the tab and do add reference. A terrible box
shows up, however there you will find, select and add it using the Net
references.

Not direct related to that however to avoid that you have to set that long
path before the Right are the imports, that you can set in top of every
program, but also in your project properties (right clicking in that same
solution explorer on the project and than properties). In that is a section
Imports.

There are all the standard imports placed.

I hope this tells it, otherwise feel free to reply again.

Cor
Nov 21 '05 #8
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> schrieb:
> Adding: Imports Microsoft.Visua lBasic
> And removing the "Microsoft.Visu alBasic" from the Left and Right
> functions gives me a compile error.

Never mind. I just read where these functions must be fully qualified...


/Where/ did you read that? Just curious ...


There can be a name clash with a form's 'Left' property, for example.
Nevertheless, you don't need to fully qualify the function name. Specifying
the name of the module containing the 'Left' method ('Strings.Left' ) is
sufficient in most cases.

--
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 #9
Bruce,
And removing the "Microsoft.Visu alBasic" from the Left and Right functions
gives me a compile error. Remember that a Form has a Left & Right property that hides the Left & Right
functions.

Normally what I do is use an import alias in my Forms, something like:

Imports VB = Microsoft.Visua lBasic
If (VB.Left(TextBo x1.Text, 1) = "$") Then

TextBox1.Text = VB.Right(TextBo x1.Text,
TextBox1.Text.L ength - 1)

End If
Hope this helps
Jay

"Bruce A. Julseth" <br***********@ attglobal.net> wrote in message
news:uS******** ******@TK2MSFTN GP09.phx.gbl...I have:

If (Microsoft.Visu alBasic.Left(Te xtBox1.Text, 1) = "$") Then

TextBox1.Text = Microsoft.Visua lBasic.Right(Te xtBox1.Text,
TextBox1.Text.L ength - 1)

End If

Adding: Imports Microsoft.Visua lBasic

And removing the "Microsoft.Visu alBasic" from the Left and Right functions
gives me a compile error.

Why?

Nov 21 '05 #10

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

Similar topics

7
8422
by: Wayne Wengert | last post by:
I use statements like LEFT(textstring,6) in my app. I have "Imports Microsoft.VisualBasic" at the top of the code but to use LEFT I have to code : Microsoft.VisualBasic.Left(sting, integer) If I code just "Left" it is flagged as an error with the message "Public Overloads Property Left() As Integer has no parameters and its return type cannot be indexed"
8
38630
by: A.M | last post by:
Hi, Using C#, what is the equivalent of functions Left, Right and Mid that we had in vb6? Thanks, Alan
12
23920
by: patang | last post by:
This is really silly question. Dim s As String s = "the" s = Right(s, 2) Why this gives me compilation error? (This works in VB6 .. what do I have to do to make it work in VB.Net) I have imported this:
9
20006
by: Wayne Wengert | last post by:
In VB6 I used to use the Left and Right functions a lot. e.g. strString = Left(txtTexbox1.Text, 20). In VB.NET I know I can prefix those functions with Microsoft.VisualBasic.Left but I suspect there is a .NET method to accomplish this? Wayne
19
3578
by: gk245 | last post by:
I have something like this: printf("Enter numbers: "); scanf ("%i", &number); If the user put in a bunch of numbers (like 4568), instead of just one number, i know that you can extract the right most digit with this: right_number = number % 10; /* print the number */
4
1755
by: UJ | last post by:
I have a long list of items that the user will be able to select from. When they select an item, I'd like to have more detailed information appear on the right side of the screen. I've already got a datagrid set up with the clicking working correctly. Problem is, I'd like to have the list be scrollable but leave the info on the right alone. What can I put around the datagrid so that the entire thing becomes scrollable? TIA - Jeff.
9
58228
by: sql guy123 | last post by:
I normally use MS ACCESS vs MS SQL,, which has a left() and right() function. I need to use MS SQL for this project but I am not familiar with it. I have read a few books, but can not figure out how to do this. Please help. If I need to compare the first 4 letters of a field, with the first four letters of another field, how can I do this? Select field1, field2 FROM table1 Where left(field1,4)=left(field2,4)
5
2707
by: Timeri | last post by:
This is a bit confusing until you actually see what I'm talking about but the main content of my page is not growing with the right column. I want the main content (left/larger column) to take into account the right deck (right column) so that both end at the same place. *********************************************************** Here's the URL... http://www.siteiq.net/TEST/index-new.html ...
32
2185
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 VB.Net 2005? Thank You Greg
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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 we have to send another system
2
1734
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.