473,396 Members | 1,756 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,396 software developers and data experts.

really strange error

Greetings all,

I've been working and reworking some legacy vb.net 1.1 code for a
couple of months now and have just encountered an un-googleable error:

Expression is not an array or a method, and cannot have an argument
list.

This is happening for the Mid fct call in the following block of code:

dim tStr,uStr as string
tStr = "abc def ghi"
uStr = Mid( tStr, 1, 1 )

Now, this code is contained within a case block of a select case
statement.

The imports for the file are:

imports System
imports System.Data
imports System.Data.SqlClient
imports System.Text
imports Microsoft.Office.Interop

The file is parsing an Excel spreadsheet.

Other files in my project use the Mid fct without issue, and if I
prefix Mid with "Microsoft.VisualBasic.", everything is ok.

Anyone have any clues? I'm thoroughly stumped.

Thanks in advance,
Robert McCall

Apr 4 '06 #1
4 1072
Well, that was quick: I had a class member variable named mId (one of
my favorites), and the case-insensitivity of VB got me. C# is much
more to my liking, but, excuses aside, sorry for the bandwidth.

Apr 4 '06 #2
hi Robert,

how about:

uStr = Microsoft.VisualBasic.Mid(tStr, 1, 1)

?

-t

robertmccall ha scritto:
Greetings all,

I've been working and reworking some legacy vb.net 1.1 code for a
couple of months now and have just encountered an un-googleable error:

Expression is not an array or a method, and cannot have an argument
list.

This is happening for the Mid fct call in the following block of code:

dim tStr,uStr as string
tStr = "abc def ghi"
uStr = Mid( tStr, 1, 1 )

Now, this code is contained within a case block of a select case
statement.

The imports for the file are:

imports System
imports System.Data
imports System.Data.SqlClient
imports System.Text
imports Microsoft.Office.Interop

The file is parsing an Excel spreadsheet.

Other files in my project use the Mid fct without issue, and if I
prefix Mid with "Microsoft.VisualBasic.", everything is ok.

Anyone have any clues? I'm thoroughly stumped.

Thanks in advance,
Robert McCall


Apr 4 '06 #3
"robertmccall" <rm*****@cbplan.com> schrieb:
I've been working and reworking some legacy vb.net 1.1 code for a
couple of months now and have just encountered an un-googleable error:

Expression is not an array or a method, and cannot have an argument
list.

This is happening for the Mid fct call in the following block of code:

dim tStr,uStr as string
tStr = "abc def ghi"
uStr = Mid( tStr, 1, 1 )

Now, this code is contained within a case block of a select case
statement.

The imports for the file are:

imports System
imports System.Data
imports System.Data.SqlClient
imports System.Text
imports Microsoft.Office.Interop

The file is parsing an Excel spreadsheet.

Other files in my project use the Mid fct without issue, and if I
prefix Mid with "Microsoft.VisualBasic.", everything is ok.


Right-click 'Mid' and choose "Go to Definition". Which type is shown? If
it's not 'Microsoft.VisualBasic.Strings', then a type clash exists and you
need to qualify 'Mid' either using 'Microsoft.VisualBasic.Strings' or
'Microsoft.VisualBasic'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 4 '06 #4
I you are going to use Visual Basic functions a lot like Mid, left, etc, then
as easy way to do it is to add an imports statement with an alias;

Imports VB = Microsoft.VisualBasic

then, use VB.Mid(.... or VB.Left(....
--
Dennis in Houston
"robertmccall" wrote:
Well, that was quick: I had a class member variable named mId (one of
my favorites), and the case-insensitivity of VB got me. C# is much
more to my liking, but, excuses aside, sorry for the bandwidth.

Apr 4 '06 #5

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

Similar topics

0
by: Kris Vanherck | last post by:
yesterday i started getting this strange error when i try to run my asp.net project: Compiler Error Message: CS0006: Metadata file 'c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net...
10
by: Don Wash | last post by:
Hi! I'm pretty frustrated learning ASP.NET. I'm learning ASP.NET by downloading samples from various ASP.NET websites and none of the samples worked so far. The SAME error was shown whenever I...
5
by: Nathan Sokalski | last post by:
When I view my index.aspx page any time after the first time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize)...
0
by: ivb | last post by:
Hi all, I am using DB2 8.1.11.1 on NT with ASP.NET 1.1 When application make connection to database (via ADO.NET), it set "Connection timeout" parameter to 30 seconds. After, when my webpage...
28
by: lovecreatesbeauty | last post by:
Besides printing out for example " a.out: p113.c:8: main: Assertion `0' failed. Aborted " and a switch option NDEBUG, what other benefits does assert() provide in any scope of designing,...
14
by: dba_222 | last post by:
Dear experts, Again, sorry to bother you again with such a seemingly dumb question, but I'm having some really mysterious results here. ie. Create procedure the_test As
3
by: Shelly | last post by:
I am encountering two strange problems. First one: I get a "server misconfiguration error", but only sometimes. It occurs on the first screen that accesses the database on a submit. This error...
7
by: bajichuan | last post by:
Hello! I have the world's strangest linking error, and I'm hoping that someone can help me sort it out. I recently installed and compiled a library called LinBox without a problem. I have an...
23
by: mike3 | last post by:
Hi. I seem to have made some progress on finding that bug in my program. I deactivated everything in the bignum package that was used except for the returning of BigFloat objects. I even...
6
BeemerBiker
by: BeemerBiker | last post by:
I can't get rid of a "deleted" record in a database. Even if I delete it the record shows back up the next time I do an update. The following code generates an error message when using...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
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,...
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...
0
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,...

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.