Autor Beitrag
Mindforce
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Sa 21.10.06 13:44 
Hi,

hab mal wieder Probleme mit meinem CCX compiler :P

Undzwar hat ich alle nötigen Prmtrs in Edits stehen :P
Nur vertragen sich TMsgDlgType und TCaption nicht :?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
if MessageDlg(OIForm.button1quell_mass.Text,
              (OIForm.button1quell_mass_1.text),
              [(OIForm.button1quell_mass_2.text)],0) = (OIform.button1quell_mass_3.text) then
              {dummy};


Wie kann ich das ändern?
hier mal die Compiler Meldungen! Irgendwo steckt auch ein inttostr fehler! ^^

[Fehler] formular1pas.pas(120): E2010 Inkompatible Typen: 'TMsgDlgType' und 'TCaption'
[Fehler] formular1pas.pas(121): E2001 Ordinaltyp erforderlich
[Fehler] formular1pas.pas(121): E2010 Inkompatible Typen: 'string' und 'Integer'
[Fataler Fehler] compilerpas.pas(78): F2063 Verwendete Unit 'formular1pas.pas' kann nicht compiliert werden

THX für Hilfe!

M!ndforce

_________________
Our force; in mind.
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Do 26.10.06 14:02 
*PUSH* ^^

_________________
Our force; in mind.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Do 26.10.06 15:42 
Hallo,

Hast du MessageDlg mit Application.MessageBox verwechselt? Schau doch dazu einfach mal in der Delphi Hilfe nach, die nennt dir da dann auch immer die geforderten Parameter, wenn solche Fehler auftreten.

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 27.10.06 12:42 
Hallo,

Was ist der CCX compiler?

Du versuchst einen MessageDlg anzuzeigen, die Parameter übergibst Du als String und der Vergleichs-Ausdruck der If-Anweisung ist auch ein String.
Daher die Fehlermeldungen.

user profile iconMindforce hat folgendes geschrieben:
Wie kann ich das ändern?

Am besten Du schreibst Dir einige Funktion, dessen Rückgabewert vom entsprechenden Typ ist,
also:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
function MessageDlg(const Msg: string;
                            DlgType: TMsgDlgType;
                            Buttons: TMsgDlgButtons;
                            HelpCtx: integer): Word;


OIForm.button1quell_mass.Text >> const Msg: string = ok

(OIForm.button1quell_mass_1.text) >> DlgType: TMsgDlgType = Fehler
>> Inkompatible Typen: 'TMsgDlgType' und 'TCaption'
>> String in TMsgDlgType umwandeln, z.B.:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
function StrToMsgDlgType(s: String): TMsgDlgType;
begin
  if s = 'mtWarning' then Result := mtWarning
    else if s = 'mtError' then Result := mtError
    //usw...


[(OIForm.button1quell_mass_2.text)] >> Buttons: TMsgDlgButtons = Fehler
>> Ordinaltyp erforderlich
>> TMsgDlgButtons ist ein set(Menge), die Werte sind Ordinaltypen
>> String(s) in set umwandeln, z.B.:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
function StrToMsgDlgButtons(aCLB: TCheckListBox): TMsgDlgButtons;
begin
  Result := [];
  if Pos('mbYes',s) > 0 then Result := Result + [mbYes];
  if Pos('mbNo',s) > 0 then Result := Result + [mbNo];
  //usw...


(OIform.button1quell_mass_3.text) mit Word; vergleichen = Fehler
>> Inkompatible Typen: 'string' und 'Integer'
mrNone, mrOk... sind definierte Integer-Konstanten
>> String in entsprechende Konstanten umwandeln, z.B.:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
function StrToMessageDlgResult(s: String): Word;
begin
  if s = 'mrNone' then Result := mrNone
    else if s = 'mrOk' then Result := mrOk
    //usw...


Der Aufruf würde dann in etwa so aussehen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if MessageDlg('Es funktioniert',
              StrToMsgDlgType('mtWarning'),
              StrToMsgDlgButtons('mbYes mbNo'),0) = 
                              StrToMessageDlgResult('mrYes'then
              {dummy};

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Fr 03.11.06 19:27 
Bohaaa.
Darauf bin ich nicht gekommen, alles extern zu deklarieren...

THX! Ich werds ausprobieren, wenn ich daran weiter arbeite :P

M!ndforce

_________________
Our force; in mind.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 03.11.06 19:33 
Hallo,

bitte :) , und was is nu der CCX compiler?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )