增加function或procedure發生錯誤 |
尚未結案
|
deng0219
一般會員 發表:4 回覆:6 積分:2 註冊:2004-07-04 發送簡訊給我 |
unit Utility; interface uses
SysUtils, Classes, StrUtils, DateUtils, DB; function myTrim(s : string) : string;
function Fill(Val: String; Len: integer; FillChar: char): string; overload;
function Fill(Val: String; Len: integer; FillChar: char;Pos:Boolean): string; overload;
function Fill(Val: integer; Len : integer; FillChar : char): string; overload;
function ConvertDate(strDate:string):String;
function FillSpace(Text: String): String;
function IsValidDBDateTime(aDateTime: TDateTime): boolean;
function ReverseStr(S:string):string;
function ReverseChStr(S:string):string;
function GetMaxSupply(RankCode: String): Integer;
function FontSizeControl(Str: String; StrFontSize, LinePutWord, MaxPutWord: Integer):Integer;
function CheckString(Str: String):String;
function CheckFiles: Strig; <--加了這行後就出現錯誤,不知道為什麼
procedure CopyDataSet(srcDataSet, destDataSet: TDataSet); implementation
.
.
.
.
. 不加就不會出現錯誤.....真的很奇怪是為什麼呢??(加procedure也一樣) 錯誤訊息 Unsatisfied forward or external declaration: 'CheckFiles'
|
Zard
尊榮會員 發表:24 回覆:396 積分:539 註冊:2003-11-26 發送簡訊給我 |
引言: unit Utility; interface uses SysUtils, Classes, StrUtils, DateUtils, DB; function myTrim(s : string) : string; function Fill(Val: String; Len: integer; FillChar: char): string; overload; function Fill(Val: String; Len: integer; FillChar: char;Pos:Boolean): string; overload; function Fill(Val: integer; Len : integer; FillChar : char): string; overload; function ConvertDate(strDate:string):String; function FillSpace(Text: String): String; function IsValidDBDateTime(aDateTime: TDateTime): boolean; function ReverseStr(S:string):string; function ReverseChStr(S:string):string; function GetMaxSupply(RankCode: String): Integer; function FontSizeControl(Str: String; StrFontSize, LinePutWord, MaxPutWord: Integer):Integer; function CheckString(Str: String):String; function CheckFiles: Strig; <--加了這行後就出現錯誤,不知道為什麼 procedure CopyDataSet(srcDataSet, destDataSet: TDataSet); implementation . . . . . 不加就不會出現錯誤.....真的很奇怪是為什麼呢??(加procedure也一樣) 錯誤訊息 Unsatisfied forward or external declaration: 'CheckFiles'宣告後若沒有實作該函式, 編譯器就會跳出這種警告訊息, 所以你至少要在implementation加上定義, 例如: implementation . . . function CheckFiles(): String; begin Result := ''; end; |
deng0219
一般會員 發表:4 回覆:6 積分:2 註冊:2004-07-04 發送簡訊給我 |
unit Utility; interface uses
SysUtils, Classes, StrUtils, DateUtils, DB, Registry; Function ZGetMyDocumentPath(): String; implementation Function ZGetMyDocumentPath(): String;
begin
with TRegistry.Create do
begin
try
RootKey := HKEY_LOCAL_MACHINE; <--compiler後出現HKEY_LOCAL_MACHINE 沒有宣告
OpenKey('\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', True);
Result := ReadString('Personal');
finally
Free;
end;
end;
end; 為什麼會出現我沒有宣告的問題......在繼承TForm的Unit就可以為什麼呢??
|
hahalin
版主 發表:295 回覆:1698 積分:823 註冊:2002-04-14 發送簡訊給我 |
|
LargeWon
一般會員 發表:3 回覆:10 積分:2 註冊:2002-12-24 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |