Autor Beitrag
Bethsoftfan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Sa 29.12.07 18:29 
Hallo,

Eine Frage :

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, Menus;

type
  TForm1 = class(TForm)
    ScrollBox1: TScrollBox;
    Image1: TImage;
    MainMenu1: TMainMenu;
    Einstellungen1: TMenuItem;
    Auflsung1: TMenuItem;
    procedure Auflsung1Click(Sender: TObject);
     private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  procedure AI(IntiligenzEinfach : integer);

  end

  implementation

{$R *.dfm}

uses Unit2;

procedure TForm1.Auflsung1Click(Sender: TObject);
begin
Form2.Visible := true;
end;


procedure AI(IntiligenzEinfach : integer);
InterresseAnLand  : integer;
GegnerLand        : integer;
FreundLand        : integer;
UnbassierbarLand  : integer;
PassierbarLangsam : integer;
PassierbarSchnell : integer;
begin
if GegnerLand = 1       then
InterresseAnLand     := InterresseAnLand + 1;
if FreundLand = 1        then
InterresseAnLand     := InterresseAnLand + 3;
if UnpassierbarLand = 1  then
InterresseAnLand     := InterresseAnLand + 0;
if PassierbarLanglam = 1 then
InterresseAnLand     := InterresseAnLand + 2;
if PassierbarSchnell = 1 then
InterresseAnLand     := InterresseAnLand + 4;
end;
end.


Fehler :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
[DCC Fehler] Unit1.pas(42): E2070 Unbekannte Direktive: 'InterresseAnLand'
[DCC Fehler] Unit1.pas(42): E2029 Deklaration erwartet, aber ':' gefunden
[DCC Warnung] Unit1.pas(49): W1023 Vorzeichenbehaftete und -lose Typen werden verglichen - beide Operanden werden erweitert
[DCC Warnung] Unit1.pas(51): W1023 Vorzeichenbehaftete und -lose Typen werden verglichen - beide Operanden werden erweitert
[DCC Warnung] Unit1.pas(53): W1023 Vorzeichenbehaftete und -lose Typen werden verglichen - beide Operanden werden erweitert
[DCC Warnung] Unit1.pas(55): W1023 Vorzeichenbehaftete und -lose Typen werden verglichen - beide Operanden werden erweitert
[DCC Warnung] Unit1.pas(57): W1023 Vorzeichenbehaftete und -lose Typen werden verglichen - beide Operanden werden erweitert


so, was ist falsch?
Ich weiß ist einwenig dreist :roll:

Bitte helft mir! :flehan:
weiß nicht was falsch ist :nixweiss:

Achso die undifinirten Bezeichner sind nicht wichtig!(mach ich später!)
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Sa 29.12.07 18:33 
1. TForm1.AI(..)
2. var fehlt

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Bethsoftfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Sa 29.12.07 18:44 
Das kommt davon, wenn man (so wie ich) zu faul ist erst das var zu schreiben ;)

danke!

was bedeuten eigentlich
ausblenden Delphi-Quelltext
1:
[DCC Warnung] Unit1.pas(55): W1023 Vorzeichenbehaftete und -lose Typen werden verglichen - beide Operanden werden erweitert					


?
DrRzf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 260

Win XP Prof
D7 Enterprise
BeitragVerfasst: Sa 29.12.07 18:44 
und das end in zeile 27 ist vermutlich auch zuviel

du testest variablen auf = 1 obwohl du ihnen noch nie einen wert zugewisen hast.
ob das nicht gewaltig schief geht :mahn:
ausserdem erhöhst du interesseanland obwohl auch nicht initialisiert wurde....

variablen die in einer procedure oder function declariert wurden werden nicht automatisch initialisiert.
wogegen global deklarierte standardmässig mit 0 vorinitialisiert werden.

_________________
rein statistisch gesehen darf man keiner statistik trauen die man nicht selbst gefälscht hat.


Zuletzt bearbeitet von DrRzf am Sa 29.12.07 18:48, insgesamt 1-mal bearbeitet
Bethsoftfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Sa 29.12.07 18:47 
danke auch dir!

äh er zeigt mir an :
[Delphi]
..
var
Form1 : TForm1;
procedure Form1.AI(IntiligenzEinfach : integer);
..
[Delphi]

Fehler :
[Delphi:201de5b9c2]
[DCC Fehler] Unit1.pas(25): E2004 Bezeichner redefiniert: 'Form1'
[/delphi:201de5b9c2]


Zuletzt bearbeitet von Bethsoftfan am Sa 29.12.07 18:51, insgesamt 3-mal bearbeitet
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Sa 29.12.07 18:47 
neue Frage = neuer Thread :wink:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Bethsoftfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Sa 29.12.07 18:53 
Ja dachte ich mir, ich mach nen neuen Thread!

arrg jetzt kann ich net mehr editieren also jetzt zeigt er mir an:
ausblenden Delphi-Quelltext
1:
2:
3:
var
  Form1: TForm1;
  procedure Form1.AI(IntiligenzEinfach : integer);


Fehler :
ausblenden Delphi-Quelltext
1:
[DCC Fehler] Unit1.pas(25): E2004 Bezeichner redefiniert: 'Form1'					


also ich hab die Stelle ausgeschnitten, es ist zeile 23-25!


Zuletzt bearbeitet von Bethsoftfan am Sa 29.12.07 18:55, insgesamt 1-mal bearbeitet
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Sa 29.12.07 18:54 
Oh tut mir leid ich hatte gedacht das du das in TForm1 deeklariert hast. Sowei es erst war war es richtig. :oops:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 29.12.07 18:56 
ausblenden Delphi-Quelltext
1:
2:
3:
var 
  Form1: TForm1; 
  procedure TForm1.AI(IntiligenzEinfach : integer);



muss aber auch in TForm1=class deklariert sein.
ausblenden Delphi-Quelltext
1:
procedure AI(IntiligenzEinfach : integer);					


Zuletzt bearbeitet von LorenzS am Sa 29.12.07 18:58, insgesamt 1-mal bearbeitet
Bethsoftfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP, Linux OpenSuSE 10.3 mit Compiz Fusion :cool:
Delphi 2007 Prof. Delphi 5
BeitragVerfasst: Sa 29.12.07 18:57 
Shit happens, besonderst mir!

Danke echt, musste aber ein paar Rechtschreibfehler beheben!

Ok die nächste Frage kommt bestimmt ;)

@Lorenz leider zuspät!