Article View: borland.public.csharpbuilder.language.csharp
Article #572Re: ArrayList get problem.
From: JRobert
Date: Wed, 11 Aug 2004 08:01
Date: Wed, 11 Aug 2004 08:01
78 lines
2940 bytes
2940 bytes
Hello!
Marc Rohloff [TeamB] wrote:
>
> You should get the error
> 'System.Collections.ArrayList' does not contain a definition
> for 'Item' ' here.
>
I've now got this errorcode you mention, plese see below.
> The correction would be:
> curOpcode=(OPCODE_NODE[])OPCodeGroups[(opcode&0xf000)>>12];
>
Yes this works now!, Thanks a lot!
> If this doesn't solve your problem please put together a complete
> example showing the error. Your example is missing a lot of detail.
>
Case 1.
If the Static modifier infront ArrayList is missing then i get the
error:
[C# Fehler] m68k.cs(714): 'madis.m68kDisassembler.OPCodeGroups' deutet
auf 'Feld' hin, wo 'Klasse' erwartet wurde
English: 'madis.m68kDisassembler.OPCodeGroups' points on an Array where
a Class is beeing expected.
Case 2.
Including the static modifier gives the error you've mentioned.
[C# Fehler] m68k.cs(714): 'System.Collections.ArrayList' enth�lt keine
Definition f�r 'Item'
-------------> CODE <-------------------
_Class:_
public class m68kDisassembler
{
private static M68KType cpu_type;
private static string tstr = "";
private *static* ArrayList OPCodeGroups;
private static OPCODE_NODE[] curOpcode;
.
.
_Constructor:_
public m68kDisassembler()
{
#region Init OPCode Group Array for fast evaluation
OPCodeGroups = new ArrayList(16);
OPCodeGroups.Add((OPCODE_NODE[]) Group_0x0);
OPCodeGroups.Add((OPCODE_NODE[]) Group_0x1);
OPCodeGroups.Add((OPCODE_NODE[]) Group_0x2);
.
.
}
_Method_
public static string disassemble(byte[] memptr, uint index, out uint
opsize)
{
ushort opcode = 0;
tstr = "";
opcode=memptr[index];
opcode<<=8;
opcode|=memptr[index+1];
curOpcode=(OPCODE_NODE[])OPCodeGroups.Item[(opcode&0xf000)>>12];
.
}
-------------> END CODE <-------------------
Regards,
Robert
Technical Details
Message-ID:
<4119c4b5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!news.tele.dk!news.tele.dk!small.news.tele.dk!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<411910a7$1@newsgroups.borland.com> <1g4pi3sjwhqr7.dlg@marcrohloff.40tude.net>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,e82952e970601dc8 X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII Date: Wed, 11 Aug 2004 09:01:48 +0100 From: JRobert <tsync@cronospec.de> User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.csharpbuilder.language.csharp Subject: Re: ArrayList get problem. References: <411910a7$1@newsgroups.borland.com> <1g4pi3sjwhqr7.dlg@marcrohloff.40tude.net> In-Reply-To: <1g4pi3sjwhqr7.dlg@marcrohloff.40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 80.135.115.7 Message-ID: <4119c4b5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1092207797 80.135.115.7 (11 Aug 2004 00:03:17 -0700) Lines: 78 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!news.tele.dk!news.tele.dk!small.news.tele.dk!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail