Absolute/es

From Free Pascal wiki
Revision as of 08:51, 25 January 2020 by Trev (talk | contribs) (Fixed syntax highlighting; fixed typos)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) español (es) suomi (fi) français (fr) русский (ru)

El modificador Absolute hace que una variable se almacene en la misma dirección de memoria que otra variable.

Var
  sintI: ShortInt;
  lintI: LongInt absolute sintI;

begin
  // visualización correcta
  lintI := 20;
  ShowMessage(inttostr(lintI) + '  ' + inttostr(sintI)); // Se muestra: 20  20

  // visualización absurda
  lintI := 2000;
  ShowMessage(inttostr(lintI) + '  ' + inttostr(sintI)); // Se muestra: 2000 -45
end;