Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

delphi call function from its name

interface

type
  TNodeFunction = function(AInput: String): String;

implementation

function Func1(AInput: String): String;
begin
   result := AInput;
end;

function Func2(AInput: String): String;
begin
   result := 'Fooled You';
end;

function Func3(AInput: String): String;
begin
   result := UpperCase(AInput);
end;

procedure Demonstration;
var
  SomeFunc, SomeOtherFunc: TNodeFunction;
begin

     SomeOtherFunc = Func3;

     SomeFunc := Func1;
     SomeFunc('Hello');   // returns 'Hello'
     SomeFunc := Func2;
     SomeFunc('Hello');   // returns 'Fooled You'

     SomeOtherFunc('lower case'); // returns 'LOWER CASE'

end;
Comment

PREVIOUS NEXT
Code Example
Typescript :: minimum requirements to start it company 
Typescript :: Fechas - Solución resta un día en dato 
Typescript :: nest js decorator 
Typescript :: import tsa test 
Typescript :: vector with N equal entries R 
Typescript :: mongoose get all documents big 
Typescript :: best way to convert string to number typescript 
Typescript :: git remove two commits but not the code 
Typescript :: vim remove surrounding brackets with surround plugin 
Typescript :: get popular posts on laravel 
Typescript :: how to execute the same test case for multiple time using testng? 
Typescript :: weights [0.03333567, 0.07472567, 0.10954318, 0.13463336, 0.14776211, 0.14776211, 0.13463336, 0.10954318, 0.07472567, 0.03333567] 
Typescript :: res.write prints html tags as text in express 
Typescript :: adding import of app routing module 
Typescript :: check jasmine version 
Typescript :: ips in range typescript 
Typescript :: Error: "Filesystem" plugin is not implemented on android 
Typescript :: how to print the elements of a array using range based for loop 
Typescript :: Laravel 8 working with subdomain routing but its not working 
Typescript :: Get the Post Categories From Outside the Loop 
Typescript :: endurance testing 
Typescript :: node scripts delay 
Typescript :: express server in vscode extension 
Typescript :: TypeError: autodiscover_tasks() takes at least 2 arguments (1 given) celery 
Cpp :: fast i/o in c++ 
Cpp :: print std map 
Cpp :: c++ file is empty 
Cpp :: Count set bits in an integer c++ 
Cpp :: fatal error: opencv2/opencv.hpp: No such file or directory 
Cpp :: error: ‘memset’ was not declared in this scope in cpp 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =