Created
March 26, 2015 05:54
-
-
Save seraphy/372e48d27cae9dcd50f9 to your computer and use it in GitHub Desktop.
Inno Scriptで関数ポインタを使う方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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