Hello, I have a problem typecasting OLEVariant to another object. When I do this in C# it is very simple:
object[] vertices = shape.Vertices as object[]; foreach (object vertex in vertices) { loc = vertex as Location; But in Delphi: procedure TForm1.CalcZonesBtnClick(Sender: TObject); var Zone: Shape; Vertices: array of OLEVariant; Vertex: OLEVariant; n: integer; Loc: Location; begin Zone := MP.Map.Shapes.AddDrivetimeZone(LocSonal, 15 / 1440); Vertices := Zone.Vertices; for n := Low(Vertices) to High(Vertices) do begin Vertex := Vertices[n]; Loc := Vertex as Location; The last line gives me a compiler error 'operator not applicable to this operant type'. any ideas ? --- Rgds, Wilfried http://www.mestdagh.biz __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://www.elists.org/mailman/listinfo/delphi-talk