| Author |
Message |
putukaca |
| Location: |
|
Post subject: error pada unit
Posted: 20/Aug/2006 12:43
|
|
onSkilled
Joined: 21-Sep-2005
Posts: 100
Status: Offline
|
|
code : pascal unit MsgDlg; interface function MyMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; Captions: array of string): Integer; implementation function MyMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; Captions: array of string): Integer; var aMsgDlg: TForm; i: Integer; dlgButton: TButton; CaptionIndex: Integer; begin aMsgDlg := CreateMessageDialog(Msg, DlgType, Buttons); captionIndex := 0; for i := 0 to aMsgDlg.ComponentCount - 1 do begin if (aMsgDlg.Components[i] is TButton) then begin dlgButton := TButton(aMsgDlg.Components[i]); if CaptionIndex > High(Captions) then Break; dlgButton.Caption := Captions[CaptionIndex]; Inc(CaptionIndex); end; end; Result := aMsgDlg.ShowModal; end; end.
begitu saya isikan di bagian uses dari form yg akan saya gunakan keluar error
[Error] MsgDlg.pas(5): Undeclared identifier: 'TMsgDlgType'
[Error] MsgDlg.pas(6): Undeclared identifier: 'TMsgDlgButtons'
[Error] MsgDlg.pas(14): Undeclared identifier: 'TForm'
[Error] MsgDlg.pas(16): Undeclared identifier: 'TButton'
[Error] MsgDlg.pas(19): Undeclared identifier: 'CreateMessageDialog'
[Error] MsgDlg.pas(21): 'DO' expected but identifier 'ComponentCount' found
[Error] MsgDlg.pas(23): ')' expected but identifier 'Components' found
[Error] MsgDlg.pas(25): Missing operator or semicolon
[Error] MsgDlg.pas(25): 'END' expected but ')' found
[Error] MsgDlg.pas(26): Missing operator or semicolon
[Error] MsgDlg.pas(27): Missing operator or semicolon
[Error] MsgDlg.pas(31): Declaration expected but identifier 'Result' found
[Error] MsgDlg.pas(32): '.' expected but ';' found
[Fatal Error] kustomer.pas(61): Could not compile used unit 'MsgDlg.pas'
ada yg salah pada unit tsb ya. sebenarnya itu suatu fungsi (dapet dr forum ini) yg saya bikin ke suatu unit. jadi kalo ada yg salah tolong diperbaiki masih newbee soalnya |
|
|
| |
|
|
|
 |
portege |
| Location: |
|
Post subject: error pada unit
Posted: 20/Aug/2006 14:23
|
|
onSkilled
Joined: 02-Jul-2006
Posts: 95
Status: Offline
|
|
|
putukaca wrote:
[code=pascal]unit MsgDlg;
interface
function MyMessageDialog(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; Captions: array of string): Integer;
implementation
Uses -nya mas? untuk tiap-tiap uses untuk komponen ada di Help-nya kok, seperti
uses
Forms, Class, dll... |
|
|
| |
|
|
|
 |
|
kaka-delphi |
| Location: Taziex |
|
Post subject:
Posted: 20/Aug/2006 15:44
|
|
onElite
Joined: 12-Oct-2005
Posts: 1050
Location: Taziex
|
|
Anda butuh class berikut : Dialogs, Forms, StdCtrls
tambahkan di klausa uses :
code : pascal uses Dialogs, Forms, StdCtrls;
|
|
|
| |
|
|
|
 |
|
|
|
|