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"
How can I get the VisualBasic version of Left as the default?
--
------------------------------------
Wayne Wengert wa***@wengert.org 7 8398
Did you use Left as a variable or function name?
"Wayne Wengert" <wa***@wengert.org> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl... 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"
How can I get the VisualBasic version of Left as the default? -- ------------------------------------ Wayne Wengert wa***@wengert.org
Are there other namespaces that implement a "Left". The form in question has
the following namespaces
Imports Microsoft.VisualBasic
Imports System.IO
Imports System.Char ' Allows use of ControlChars.nnnn
Imports System.Data.OleDb
Wayne
"dfsdf" <sd****@sdfsdff.dfs> wrote in message
news:Ob********************@rwcrnsc51.ops.asp.att. net... Did you use Left as a variable or function name?
"Wayne Wengert" <wa***@wengert.org> wrote in message news:OB**************@TK2MSFTNGP10.phx.gbl... 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"
How can I get the VisualBasic version of Left as the default? -- ------------------------------------ Wayne Wengert wa***@wengert.org
You don't have to manually import the Microsoft.VisualBasic namespace --
Visual Studio does that implicitly for VB projects. You should be able to
use "Left" (and other VB keywords) automatically, without the Imports...
statement and without using the fully-qualified name.
Your problem looks like a namespace conflict. Try right-clicking on the
Left keyword in the module, and select "Go to definition" -- it'll bring up
the object browser, and highlight the method it's trying to use (the other
Left.)
Just to play Devil's advocate, have you considered using the .Net framework
equivalents for Left and other VB keywords? For example, you could replace
"x = Left(MyString, 5)" with x = MyString.Substring(0, 5). There's nothing
wrong with using the VB functions, but in my opinion it's generally a better
practice to use the .Net equivalents when possible.
Check out these links: http://msdn.microsoft.com/library/de...et0_update.asp http://msdn.microsoft.com/vbasic/usi...tinternals.asp
Hope this helps,
Robert Jacobson
"Wayne Wengert" <wa***@wengert.org> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl... 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"
How can I get the VisualBasic version of Left as the default? -- ------------------------------------ Wayne Wengert wa***@wengert.org
Hmmm.. that gets me....
<System.ComponentModel.BrowsableAttribute(False) ,
System.ComponentModel.DesignerSerializationVisibil ityAttribute(0),
System.Windows.Forms.SRCategoryAttribute("CatLayou t"),
System.Windows.Forms.SRDescriptionAttribute("Contr olLeftDescr"),
System.ComponentModel.EditorBrowsableAttribute(0)>
Public Property Left As Integer
Member of System.Windows.Forms.Control
I don't see how to find what control has a "Left" property. I'll check out
the links you provided.
Wayne
"Robert Jacobson" <rj**********************@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... You don't have to manually import the Microsoft.VisualBasic namespace -- Visual Studio does that implicitly for VB projects. You should be able to use "Left" (and other VB keywords) automatically, without the Imports... statement and without using the fully-qualified name.
Your problem looks like a namespace conflict. Try right-clicking on the Left keyword in the module, and select "Go to definition" -- it'll bring
up the object browser, and highlight the method it's trying to use (the other Left.)
Just to play Devil's advocate, have you considered using the .Net
framework equivalents for Left and other VB keywords? For example, you could
replace "x = Left(MyString, 5)" with x = MyString.Substring(0, 5). There's
nothing wrong with using the VB functions, but in my opinion it's generally a
better practice to use the .Net equivalents when possible.
Check out these links:
http://msdn.microsoft.com/library/de...et0_update.asp http://msdn.microsoft.com/vbasic/usi...tinternals.asp Hope this helps, Robert Jacobson
"Wayne Wengert" <wa***@wengert.org> wrote in message news:OB**************@TK2MSFTNGP10.phx.gbl... 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"
How can I get the VisualBasic version of Left as the default? -- ------------------------------------ Wayne Wengert wa***@wengert.org
Wayne,
Remember Left & Right are a properties of System.Windows.Forms.Control,
System.Windows.Forms.Form inherits from Control.
If you want to use the VB.Left or VB.Right functions within a Form or
UserControl, you need to prefix it with a namespace.
One handy method is to use
Imports VB = Microsoft.VisualBasic
for your import, then you can use VB.Left to call the function.
Hope this helps
Jay
"Wayne Wengert" <wa***@wengert.org> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl... 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"
How can I get the VisualBasic version of Left as the default? -- ------------------------------------ Wayne Wengert wa***@wengert.org
Great tip - didn't know you could do that.
Wayne
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl... Wayne, Remember Left & Right are a properties of System.Windows.Forms.Control, System.Windows.Forms.Form inherits from Control.
If you want to use the VB.Left or VB.Right functions within a Form or UserControl, you need to prefix it with a namespace.
One handy method is to use
Imports VB = Microsoft.VisualBasic
for your import, then you can use VB.Left to call the function.
Hope this helps Jay
"Wayne Wengert" <wa***@wengert.org> wrote in message news:OB**************@TK2MSFTNGP10.phx.gbl... 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"
How can I get the VisualBasic version of Left as the default? -- ------------------------------------ Wayne Wengert wa***@wengert.org
re devils advocate - note that the VB string handling
functions are in some but not all cases faster than using
SubString - there is an MS doc that covers this but I
havent got the url to hand
hth
guy -----Original Message----- You don't have to manually import the
Microsoft.VisualBasic namespace --Visual Studio does that implicitly for VB projects. You
should be able touse "Left" (and other VB keywords) automatically, without
the Imports...statement and without using the fully-qualified name.
Your problem looks like a namespace conflict. Try right-
clicking on theLeft keyword in the module, and select "Go to
definition" -- it'll bring upthe object browser, and highlight the method it's trying
to use (the otherLeft.)
Just to play Devil's advocate, have you considered using
the .Net frameworkequivalents for Left and other VB keywords? For example,
you could replace"x = Left(MyString, 5)" with x = MyString.Substring(0,
5). There's nothingwrong with using the VB functions, but in my opinion it's
generally a betterpractice to use the .Net equivalents when possible.
Check out these links:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnguinet/html/drguinet0_update.asp http://msdn.microsoft.com/vbasic/usi...standing/defau
lt.aspx?pull=/library/en-
us/dv_vstechart/html/vbtchmicrosoftvisualbasicnetinternals.
asp Hope this helps, Robert Jacobson
"Wayne Wengert" <wa***@wengert.org> wrote in message news:OB**************@TK2MSFTNGP10.phx.gbl... 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 tocode : 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"
How can I get the VisualBasic version of Left as the
default? -- ------------------------------------ Wayne Wengert wa***@wengert.org
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Claire |
last post by:
Hello,
I am having a problem in my struts application with the checkboxes in
my form. I have an array of checkboxes, some of which may be already
selected when the form loads. My problem is when...
|
by: Bruce Duncan |
last post by:
I'm a bit new to MySQL (know MS SQL well...and that may be the
problem...getting the syntax confused) and I'm having a join problem...can
anyone offer some help? Here's my problem:
I have table1...
|
by: JesusFreak |
last post by:
From: us_traveller@yahoo.com (JesusFreak)
Newsgroups: microsoft.public.scripting.jscript
Subject: toolbar script problem
NNTP-Posting-Host: 192.92.126.136
Recently, I downloaded the following...
|
by: B McDonald |
last post by:
Hi. I am trying to straighten out some DIV issues in the rendering of my
no-tables CSS website. Right now the biggest issue is trying to render 2
columns several DIVs deep in the box model for my...
|
by: Stephen Melia |
last post by:
Hello,
I've just done a redesign of website, and it's gone terribly wrong for
Internet Explorer 6. I have a two column layout, and for some reason
links in the right hand column cannot be...
| |
by: books1999 |
last post by:
Hi there,
I have a problem with this css/div and i cannot work it out. I would
like either container to be able to push the background box to grow but
in Firefox it overflows. Can someone find a...
|
by: knoxautoguy |
last post by:
This problem has consumed a lot of my time, and I'm aftraid someone
will tell me that my whole approach to this objective is wrong;
however, I would like to know if there is a way to do this.
I...
|
by: sjickells |
last post by:
Hi
I am having a problem using asp:TextBox's in a transparent table.
I have a background image on the page and a table in the middle of the
page. I have set the background colour of the table...
|
by: davidson1 |
last post by:
Hai friends..for menu to use in my website..i found in one website....pl look below website....
http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm
i downloaded 2 files....
...
|
by: pradeepjain |
last post by:
I have a 3 column layout left<->content<->right<->.I made a css and html in such a manner that when there is no left sidebar the content region starts from left side and takes whole width of left on...
|
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...
| |
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,...
|
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |