Antonio,
One of the constructors of the ArrayList class accepts an ICollection as
parameter. Stack is a class that implements the ICollection interface. So
what I am suggesting here is to use a temporary class to push your objects,
and then create the ArrayList from the stack.
.locals init ([0] class [mscorlib]System.Collections.Stack stack,
[1] class [mscorlib]System.Collections.ArrayList arraylist)
newobj instance void [mscorlib]System.Collections.Stack::.ctor()
stloc.0
ldloc.0
ldc.i4.s 123
box [mscorlib]System.Int32
callvirt instance void
[mscorlib]System.Collections.Stack::Push(object)
ldloc.0
ldc.i4 456
box [mscorlib]System.Int32
callvirt instance void
[mscorlib]System.Collections.Stack::Push(object)
ldloc.0
newobj instance void
[mscorlib]System.Collections.ArrayList::.ctor(class [mscorlib]
System.Collections.ICollection)
stloc.1
Maybe having a temporary variable is not the most elegant solution, but it
is something that VB.NET and C# compilers often do.
Gabriele
> I am curretly porting an open source language www.harbour-project.org to
> .NET.
[quoted text clipped - 22 lines]
>
> Antonio
Antonio Linares - 30 Jun 2003 15:05 GMT
Gabriele,
Thanks for your suggestion, but I got it working using Mattias advice,
regards,
Antonio