Skip to content

Instantly share code, notes, and snippets.

@seraphy
Created March 26, 2015 05:54
Show Gist options
  • Save seraphy/372e48d27cae9dcd50f9 to your computer and use it in GitHub Desktop.
Save seraphy/372e48d27cae9dcd50f9 to your computer and use it in GitHub Desktop.
Inno Scriptで関数ポインタを使う方法
[Code]
type
Tproc = procedure(const msg: String);
Tfunc = function(const value: Integer): String;
procedure sample_proc(const msg: String);
begin
Log(msg);
end;
function sample_func(const value: Integer): String;
begin
Result := IntToStr(value);
end;
procedure sample;
var
proc_ptr: Tproc;
func_ptr: Tfunc;
begin
proc_ptr := @sample_proc;
func_ptr := @sample_func;
proc_ptr(func_ptr(123));
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment