Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   Liberar Arrays (https://www.clubdelphi.com/foros/showthread.php?t=10732)

altp 27-05-2004 13:25:35

Liberar Arrays
 
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

Cita:

Empezado por altp
Los Arrays dinámicos se liberan? Cómo?

Los arrays, no, su contenido, depende.

Cita:

Empezado por altp
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 Delphi
Cita:

Dynamic-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!


La franja horaria es GMT +2. Ahora son las 18:04:07.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi