473,394 Members | 2,031 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,394 software developers and data experts.

IDE Warning

Hi,
No matter how i do this, I get the same warning. I don't understand the
warning....
Dim FILETYPE as string() = {"tree;.tree;*.tree"}

for x as integer = 0 to ubound(FILETYPE)
Orginal line---------------------------------------
FILETYPE(0) = Lcase(FILETYPE(0).Concat(".", FILETYPE(0)))
--------------------------------------------------

new try...---------------------------------------
dim strx as string = FILETYPE(0)
strx = Lcase(FILETYPE(0).Concat(".",FILETYPE(0)))

the warning message i am getting is "Access of shared member, constant
member, enum member or nested type through an instance qualifying expression
will not be evaluated."

Can anyone explain this to me to help me understand it?
Brian
Aug 25 '08 #1
2 1095
Brian,

Concat is a shared method of the String class and should be accessed through
the class, not an instance of the class.

You should be using String.Concat instead of FILETYPE(0).Concat.

Kerry Moorman
"Brian" wrote:
Hi,
No matter how i do this, I get the same warning. I don't understand the
warning....
Dim FILETYPE as string() = {"tree;.tree;*.tree"}

for x as integer = 0 to ubound(FILETYPE)
Orginal line---------------------------------------
FILETYPE(0) = Lcase(FILETYPE(0).Concat(".", FILETYPE(0)))
--------------------------------------------------

new try...---------------------------------------
dim strx as string = FILETYPE(0)
strx = Lcase(FILETYPE(0).Concat(".",FILETYPE(0)))

the warning message i am getting is "Access of shared member, constant
member, enum member or nested type through an instance qualifying expression
will not be evaluated."

Can anyone explain this to me to help me understand it?
Brian
Aug 25 '08 #2
Brian wrote:
No matter how i do this, I get the same warning. I don't understand the
warning....
FILETYPE(0) = Lcase(FILETYPE(0).Concat(".", FILETYPE(0)))
the warning message i am getting is "Access of shared member, constant
member, enum member or nested type through an instance qualifying expression
will not be evaluated."
The Concat() method takes the string values that you /give/ it and bolts
them all together; it doesn't care which String /object/ you call the
method on (well, it obviously does because it's griping, but the
/result/ would be the same):

? "fred".Concat( "a", "b", "c" )
"abc"

? "bob".Concat( "a", "b", "c" )
"abc"

Different "starting" strings; same result.

To get around the confusion that the above might cause, the compiler is
now (VB'2005+) being /stricter/ in how you are allowed to call this (and
similar) methods. You have to use ...

String.Concat( ... )

.... instead. This is because Concat (and Join, and others) are Shared
methods on the String class, and you invoke them using the Class name,
not via an instance of that class.

Contrast this with the Split() method (an Instance method). This takes
the value of the String object on which you /call/ it and hacks /that/
up into an array of Strings so that ...

? "fred".Split( "e"c )
(something like)
"fr"
"d"

.... gives you a different answer from ...

? "bob".Split( "e"c )
(something like)
"bob"

HTH,
Phill W.
Aug 26 '08 #3

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

Similar topics

3
by: Bas Wassink | last post by:
Hello there, I'm having trouble understanding a warning produced by 'splint', a code-checker. The warning produced is: keywords.c: (in function keyw_get_string) keywords.c:60:31: Released...
3
by: Bill Burris | last post by:
How do I find what is causing this warning from the Linker? If I use /NODEFAULTLIB I get hundreds of undefined symbols. LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other...
3
by: DJTN | last post by:
I'm getting the following error when I try to compile my setup project in VS 2002. I have re-installed the .net framework 1.1 and it didnt solve the problem. WARNING: Unable to find dependency...
1
by: spanov | last post by:
i've got problem installing python-2.3.5 from sources on FreeBSD 5.3 root@server# ./configure > conf_log configure: WARNING: curses.h: present but cannot be compiled configure: WARNING:...
5
by: Peter Ritchie [C# MVP] | last post by:
I've purposely been ignoring a CA2122 warning in some C++ interop code I've been working on for quite some time. I've just recently had the cycles to investigate the warning. The warning message...
1
by: Ian | last post by:
I've just discovered the msclr::lock class in the C++ Support Library online documentation. This seems like a much cleaner way to implement thread protection than using...
5
by: holmescn | last post by:
what is the meaning of warning attributes ignored on template instantiation. i got it when i compiled stlport 5.1.3. anybody can help me ? thx!
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
4
by: cody | last post by:
It is possible to declare and use/instantiate a class with a uninitialized readonly field without even a compiler warning. Why don't I get warnings? public class Stuff { public readonly int a;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...

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.