PDA

Ver la Versión Completa : Liberar Arrays


altp
27-05-2004, 13:25:35
Hola a todos

Los Arrays dinámicos se liberan? Cómo?

Si declaro:

Type
TCampos_Pantalla = record
Campo : String;
Descripcion : TStrings;
end;
var
a_TCampos_Pantalla : array of TCampos_Pantalla;

Tengo que liberar Descripción que es de tipo TStrings?

Gracias

marto
27-05-2004, 13:41:07
Los Arrays dinámicos se liberan? Cómo?
Los arrays, no, su contenido, depende.


Tengo que liberar Descripción que es de tipo TStrings?

Sí, y por favor, usa la etiqueta [delphi] para pegar tu código.

altp
27-05-2004, 13:46:52
Gracias marto.

delphi.com.ar
27-05-2004, 15:39:12
Extraído de la ayuda de DelphiDynamic-array variables are implicitly pointers and are managed by the same reference-counting technique used for long strings. To deallocate a dynamic array, assign nil to a variable that references the array or pass the variable to Finalize; either of these methods disposes of the array, provided there are no other references to it. Dynamic arrays of length 0 have the value nil. Do not apply the dereference operator (^) to a dynamic-array variable or pass it to the New or Dispose procedure.

Saludos!