Ich habe mehrere Funktionen, mit dem gleichen Namen, die dasselbe mit verschiedenen Datentypen tun:
Code: Alles auswählen
function LimitTo(var Value: float; min, max: Float): integer;
function LimitTo(var Value: integer; min, max: integer): integer;
function LimitTo(Value, min, max: FloatArray): FloatArray; //FloatArray = n-dimensional vector
Code: Alles auswählen
LimitTo(Velocity[0], -Properties.MaxSpeed, Properties.MaxSpeed); //ships.pas: Zeile 399
//Velocity = FloatArray
//Properties.MaxSpeed = Float
Code: Alles auswählen
ships.pas(399,65) Error: Incompatible type for arg no. 3: Got "Extended", expected "LongInt"
extmath.pas(410,10) Hint: Found declaration: LimitTo(var LongInt,LongInt,LongInt):LongInt;
extmath.pas(395,10) Hint: Found declaration: LimitTo(var Extended,Extended,Extended):LongInt;
vectormath.pas(431,10) Hint: Found declaration: LimitTo(FloatArray,FloatArray,FloatArray):Dynamic Array Of Single;
ships.pas(667) Fatal: There were 1 errors compiling module, stopping
MFG
Komoluna