Boreas
09-21-2006, 03:55 PM
Can an include file (that is being included by a script) call a procedure that is in the script?
Ex
//Include
procedure dosomething(num:integer);
begin
case num of
1: proc1
2: proc2
end;
end;
procedure reallybigproc(otherparameters, ddd);
begin
//stuff
dosomething(ddd);
//stuff
end;
//script
{.include upthere}
procedure proc1;
begin
end;
procedure proc2;
begin
end;
begin
//stuff
reallybigproc(someparams, 1);
//stuff
reallybigproc(someparams, 2);
//stuff
end.
The script writer can call the procedure multiple times, choosing which procedure the case of will choose. That part I know. But I want the script writer to be able to write proc1 and proc2 any way they want. (That's why proc1 and proc2 can't be in the include because the include writer can't predict them).
Also, can a procedure be a variable?
Ex
var
blah : procedure;
begin
blah := activateclient;
blah; //does activateclient
blah := setupsrl;
blah; //does setupsrl
end.
(obviously those examples don't work, I mean is there another way around it that would produce the same effect that these imaginary scripts would if they were real)
Edit: While I'm at it, what does gnome and chicken mean?
Ex
//Include
procedure dosomething(num:integer);
begin
case num of
1: proc1
2: proc2
end;
end;
procedure reallybigproc(otherparameters, ddd);
begin
//stuff
dosomething(ddd);
//stuff
end;
//script
{.include upthere}
procedure proc1;
begin
end;
procedure proc2;
begin
end;
begin
//stuff
reallybigproc(someparams, 1);
//stuff
reallybigproc(someparams, 2);
//stuff
end.
The script writer can call the procedure multiple times, choosing which procedure the case of will choose. That part I know. But I want the script writer to be able to write proc1 and proc2 any way they want. (That's why proc1 and proc2 can't be in the include because the include writer can't predict them).
Also, can a procedure be a variable?
Ex
var
blah : procedure;
begin
blah := activateclient;
blah; //does activateclient
blah := setupsrl;
blah; //does setupsrl
end.
(obviously those examples don't work, I mean is there another way around it that would produce the same effect that these imaginary scripts would if they were real)
Edit: While I'm at it, what does gnome and chicken mean?