Feroc1ty
2009-11-30 16:58:18
Does scar have any form of polymorphism because I would find it useful for a function I'm making.
2009-11-30 16:58:18
2009-11-30 18:21:01
2009-11-30 18:26:49
From: morttt
All Scars have the same phenotypes, so i don't think Scars are polymorphic.
But of course Scars don't belong to a panmictic population anyway, so the whole question of polymorphism is irrelevant. They do, however, occupy the same habitat at the same time, so i can see where the idea came from.
2009-11-30 18:43:53
From: morttt
All Scars have the same phenotypes, so i don't think Scars are polymorphic.
But of course Scars don't belong to a panmictic population anyway, so the whole question of polymorphism is irrelevant. They do, however, occupy the same habitat at the same time, so i can see where the idea came from.
2009-11-30 19:27:16
2009-11-30 21:12:14
In computer science, polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface. The concept of parametric polymorphism applies to both data types and functions. A function that can evaluate to or be applied to values of different types is known as a polymorphic function. A data type that can appear to be of a generalized type (e.g., a list with elements of arbitrary type) is designated polymorphic data type like the generalized type from which such specializations are made.
2009-12-01 17:00:41
2009-12-01 17:01:41
function dothis(arr: TVariantArray):variant;
var i : integer;
begin
for i := 0 to 3 do
writeln(arr[i]);
end;2009-12-01 17:33:20
2009-12-01 18:24:54
From: Feroc1ty
Well, is there any way I can make a function or a procedure take extra optional parameters?
Ex:
Procedure(opt1,opt2);
Procedure(opt1,opt2,opt3);
2009-12-01 18:49:48
From: senrath
Nope, sorry. SCAR cannot handle overloading methods.
2009-12-01 19:03:01
2009-12-01 19:04:30
From: Feroc1ty
sigh woulda been too perfect to have that available, shoulda known that by now, anything you want you probly wont get
2009-12-01 19:05:32
From: Awkwardsaw
well, what exactly do you want?
2009-12-01 19:06:59
From: Blumblebee
I'm thinking maybe polymorphism in SCAR?
2009-12-01 19:09:11
2009-12-01 20:14:55
program New;
{.Include SRL/SRL.scar}
function isbool(v : variant):boolean;
begin
try
if v or (not v) then
result := true;
except
end;
end;
function mouseuptext(Arr : TVariantarray): boolean;
begin
mmouse(arr[0], arr[1], arr[2], arr[3]);
if high(arr) >= 5 then
if arr[5] <> null then
begin
result := isuptext(arr[5]);
if not result then exit;
end;
result := true;
if (high(arr) < 4) then exit;
if not isbool(arr[4]) then
exit;
mouse(arr[0], arr[1], arr[2], arr[3], arr[4]);
end;
begin //[x, y, rx, ry, left(opt), uptext(opt)]
mousespeed := 15;
mouseuptext([306, 280, 0, 0]);
end.
mouseuptext([306, 280, 0, 0, true, 'wat']);2009-12-01 20:42:09
2009-12-01 20:43:53
From: Feroc1ty
no point in trying to add confusing crap to bypass the issue, was simply seeing if i could make it simpler but ill just make 2 functions instead of having 1.
2009-12-01 22:59:28
From: Awkwardsaw
although this may be useless, and a little confusing/ messy, but this is a little example.program New;
{.Include SRL/SRL.scar}
function isbool(v : variant):boolean;
begin
try
if v or (not v) then
result := true;
except
end;
end;
function mouseuptext(Arr : TVariantarray): boolean;
begin
mmouse(arr[0], arr[1], arr[2], arr[3]);
if high(arr) >= 5 then
if arr[5] <> null then
begin
result := isuptext(arr[5]);
if not result then exit;
end;
result := true;
if (high(arr) < 4) then exit;
if not isbool(arr[4]) then
exit;
mouse(arr[0], arr[1], arr[2], arr[3], arr[4]);
end;
begin //[x, y, rx, ry, left(opt), uptext(opt)]
mousespeed := 15;
mouseuptext([306, 280, 0, 0]);
end.
if you test it out, and mess with it a little bit, this will either move the mouse, move the mouse, and check the uptext, both and click the mouse, or just click the mouse depending on what parameters you set up.
where
mouseuptext([306, 280, 0, 0, true, 'wat']);
you NEED the first 4 parameters, if you do not want to click, then make "true" to 0, or ''. if you dont want to check an uptext, then simply dont set that parameter. if you just want to move the mouse, just fill in the first 4 parameters
am i helping/ making sence?
2009-12-01 23:26:30
2009-12-02 06:51:24
2009-12-02 17:29:42
2009-12-02 17:51:37