Is it possible to somehow create a short alias to variable

  Kiến thức lập trình

In my function I want to create a shorthand for variable to shorten the code but
if I understand it correctly, PascalScript used in Inno Setup doesn’t support neither pointers nor references, am I right? Are there any other ways to do that? This is the example of what I want to achive (using Pascal pointers):

[Code]
var
  // Long names example
  MagicElementsOfStrangeButter: Array of Integer;
  IndexOfSelectedLongCurve: Integer;

// Example
procedure MyProcedure();
begin
  MagicElementsOfStrangeButter[IndexOfSelectedLongCurve] := 7;
  // More code that uses MagicElementsOfStrangeButter[IndexOfSelectedLongCurve]
  // Note: I don't want to create a local copy of target variable, use it, and then assign it to original variable.
end;

// Desired look
procedure MyProcedure();
  Temp: ^Integer;
begin
  Temp := @MagicElementsOfStrangeButter[IndexOfSelectedLongCurve];
  Temp^ := 7;
  // More code that uses Temp
end;

LEAVE A COMMENT