掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
参照ユニットの同名関数呼び出し切り替え (ID:43796)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
たとえば function IntToStr(Value,Length: Integer;C: Char = '0'):String; var S : String; begin if Length <= 0 then begin Result := IntToStr(Value); end else begin S := StringOfChar(C,Length); S := S + IntToStr(Value); Result := Copy(S,System.Length(S)-Length+1,Length); end; end; な感じで パラメータが異なるやつならば Overload すれば可能 (SysUtils.IntToStr と共存可能) ---------- function Length(Value: String): Integer; begin Result := System.Length(Value); end; にしてしまうと Stringのみで DynamicArray に対応できなくなる (今回の話) function Length(Value: String): Integer; overload; begin Result := System.Length(Value); end; function Length(Value: array of Byte): Integer; overload; begin Result := System.Length(Value); end; function Length(Value: array of Char): Integer; overload; begin Result := System.Length(Value); end; で個別に作ると System.Length と 同じパラメータになるでの 呼び出しがあいまいと怒られる 自作 Length のパラメータが System.Length と異なるならば Overload すれば共存可能
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.