FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Problema con vectores dinámicos
Hola que tal?.. tengo un problema al crear vectores dinámicos, los utilizo para almacenar reales, los vectores funcionan bien hasta cierto momento, desde ahi no puedo crear mas vectores y me salta un 'access violation' si trato de crear uno. Me imagino que debe ser por falta de memoria, no se si delphi le adjudica memoria a las aplicaciones y quizas no me esté dando.
Saludos Ariel Codigo: function concatenarVectores(vec1,vec2:TVecReal): TVecReal; var vecFinal: TVecReal; i,j,tope1,tope2: integer; begin SetLength(vecFinal,Length(vec1)+Length(vec2)-1); tope1 := Length(vec1)-1; tope2 := Length(vecFinal)-1; for i:=0 to tope1-1 do vecFinal[i]:=vec1[i]; for j:=tope1 to tope2 do vecFinal[j]:=vec2[j-tope1]; result := vecFinal; end; procedure TTriangulo.pintarTriangulo; var za,zb,zc,xa,xb,xc,xd,ha,hb,hc,XIni,XFin,HIni,HFin,HScan,ZIni,ZFin,ZScan: TVecReal; r,y,x,yNum,xInic,xFina:integer; vec: TVecPoint; h:byte; xInicial,xFinal,hInicial,hFinal,zInicial,zFinal: real; begin vec := ordenar(self.vertice1,self.vertice2,self.vertice3); xa := interpolar(vec[0].y,vec[2].y,vec[0].x,vec[2].x); ha := interpolar(vec[0].y,vec[2].y,vec[0].h,vec[2].h); za := interpolar(vec[0].y,vec[2].y,vec[0].z,vec[2].z); xb := interpolar(vec[0].y,vec[1].y,vec[0].x,vec[1].x); hb := interpolar(vec[0].y,vec[1].y,vec[0].h,vec[1].h); zb := interpolar(vec[0].y,vec[1].y,vec[0].z,vec[1].z); xc := interpolar(vec[1].y,vec[2].y,vec[1].x,vec[2].x); hc := interpolar(vec[1].y,vec[2].y,vec[1].h,vec[2].h); zc := interpolar(vec[1].y,vec[2].y,vec[1].z,vec[2].z); XIni := xa; XFin := concatenarVectores(xb,xc); HIni := ha; HFin := concatenarVectores(hb,hc); ZIni := za; ZFin := concatenarVectores(zb,zc); ...... El problema me lo da cuando concateno los vectores, me da un access violation cuando creo el vector dinámico en el procedimiento 1. Salú Última edición por aluduena fecha: 27-09-2004 a las 12:47:31. |
Herramientas | Buscar en Tema |
Desplegado | |
|
|
|