Autor Beitrag
arnydaniel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80

hoffentlich bald Linux
Delphi 6
BeitragVerfasst: Mi 08.06.05 15:47 
Hi,

ich steh vor forgendem Problem:
In meiner Anwendung soll ein Fenster aufgerufen werden, was folgende Bedingungn erfüllen soll:
1. Das Hauptfenster(welches geöffnet bleiben sollte) muss IMMER hinter diesem Fenster sein
2. Es müssen Variablen an das Hauptform übergeben werden.

Also von Prinzip wie eine OpenDialog (nur ganz anderst).
Wie macht man das am besten?

_________________
Wenn jeder nur an sich denkt, wird an jeden gedacht.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 08.06.05 16:05 
user profile iconarnydaniel hat folgendes geschrieben:
1. Das Hauptfenster(welches geöffnet bleiben sollte) muss IMMER hinter diesem Fenster sein

ausblenden Delphi-Quelltext
1:
DeinFormular.ShowModal;					


user profile iconarnydaniel hat folgendes geschrieben:
2. Es müssen Variablen an das Hauptform übergeben werden.

Wie meinst du das genau?
arnydaniel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80

hoffentlich bald Linux
Delphi 6
BeitragVerfasst: Mi 08.06.05 16:35 
Das Programm existiert zum großteil erst in meinem Kopf, aber dass neu geöffnete Form soll eine Prozedur in meiner Main-Unit auslösen (Welche auf dem Main-Form neue Buttons erstellt).
Ich hoffe es ist verständlich

_________________
Wenn jeder nur an sich denkt, wird an jeden gedacht.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 08.06.05 17:06 
Ist kein Problem. Die entsprechende Procedure rufst du mit z.B.
ausblenden Delphi-Quelltext
1:
Unit1.MeineProcedure(MeinParameter);					

auf. Du musst jedoch die Unit als uses eintragen... ;)
arnydaniel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80

hoffentlich bald Linux
Delphi 6
BeitragVerfasst: Mi 08.06.05 17:23 
Auf diese Idee bin ich auch schon gekommen. es funktionuert halt nicht!
Ich hab mal ein ganz einfaches Programm gemacht, wo ich das so gemacht hab wie gesagt. Es ist im Anhang, ihr könnt ja mal reinschauen!
Einloggen, um Attachments anzusehen!
_________________
Wenn jeder nur an sich denkt, wird an jeden gedacht.
Mottor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mi 08.06.05 17:39 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
  TForm1 = class(TForm)
  ...
  public
    procedure ende();
    { Public-Deklarationen }
  end;

...

procedure TForm1.ende();
begin
  halt;
end;
arnydaniel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80

hoffentlich bald Linux
Delphi 6
BeitragVerfasst: Mi 08.06.05 18:12 
Ja danke, so klappts!!

_________________
Wenn jeder nur an sich denkt, wird an jeden gedacht.
arnydaniel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80

hoffentlich bald Linux
Delphi 6
BeitragVerfasst: Do 09.06.05 13:23 
Es ist ein weiteres Problem aufgetreten:
Ich kann jetzt die Procedure aufrufen, aber:
die Fkt greift auf einen Array zu, der für verschieden ScrollBoxes steht. An dieser Stelle zeigt er mir eine Zugriffsverletzung an!

Hab hier mal einen Code-Ausschnitt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure Tform1.add(atlname: string; klasse:string; verein:string; l_11:real; l_12:real; l_21:real; l_22:real; l_31:real; l_32:real; l_41:real; l_42:real);
begin
  sb[Form1.klasse2id(klasse)].HorzScrollBar.Position:=0; //auch das Form1. bringt nichts
  sb[klasse2id(klasse)].VertScrollBar.Position:=0;
...


Habt ihr ne Idee?

_________________
Wenn jeder nur an sich denkt, wird an jeden gedacht.
Mottor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Do 09.06.05 14:08 
Zugriffsverletzung ist 'runtime' Error.
Prüf alles:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure Tform1.add(atlname: string; klasse:string; verein:string; l_11:real; l_12:real; l_21:real; l_22:real; l_31:real; l_32:real; l_41:real; l_42:real);
var i: integer;
begin
  i := klasse2id(klasse);
  if (i < Low(sb)) or (i > High(sb)) then
    ShowMessage('Out of range')
  else if not Assigned(sb[i]) then
    ShowMessage('sb['+IntToStr(i)+'] is nil');
...
arnydaniel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80

hoffentlich bald Linux
Delphi 6
BeitragVerfasst: Do 09.06.05 14:23 
Es war meine Fehler (logscih)
Hab beim Aufruf der Procedure 2 Parameter vertauscht!

_________________
Wenn jeder nur an sich denkt, wird an jeden gedacht.