Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#57

Re: problem mit else nach end

  Alt 21. Feb 2008, 17:28
Hi,

Dann mach ich auch mal mit.. Aber was du dir merken solltest: end beendet nicht die procedure Um eine Procedure zu verlassen muss entweder der Code der procedure vollständig bis zum procedure-end; durchlaufen sein oder du rufst exit; auf.

Hier der Code anständig formatiert! (Ohne Kommentare)

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Name := edit1.Text;
  Clan_Tag := edit2.Text;
  ip := edit3.text;
  port := edit4.text;

  D_Name := InputBox('Dateiname', 'Bitte Dateinamen eingeben!', 'Link');
  AssignFile(F, d_name + '.txt');
  check_n;
  check_c;
  Rewrite(F);

  if RadioButton2.Checked then
  begin
    if CheckBox1.Checked then
      Writeln(F, '[center][url=http://www.gametracker.com/server_info/89.202.196.35:16570/]'
               + '[img]http://cache.www.gametracker.com/server_info/89.202.196.35:16570/'
               + 'b_350x20_C692108-381007-FFFFFF-000000.png[/img][/url][/center]');
    if CheckBox2.Checked then
      Writeln(F, '[center][url=http://www.2142-stats.de/'
                + name + '+stats.html][img]http://sigs.2142-stats.com/'
                + name + '_player_31422.png[/img][/url][/center]');
    if CheckBox3.Checked then
      if (Trim(Edit2.Text) <> '') then
        Writeln(F, '[center][url=http://www.gametracker.com/server/'
          + IP + ':' + port + '/player/' + clan_tag + '%20' + name
          + '/][img]http://cache.www.gametracker.com/player/' + clan_Tag + '%20'
          + name + '/' + IP + ':' + port + '/b_560x95.png[/img][/url][/center]')
      else
        Writeln(F, '[center][url=http://www.gametracker.com/server/'
                 + IP + ':' + port + '/player/' + name
                 + '/][img]http://cache.www.gametracker.com/player/'
                 + name + '/' + IP + ':' + port + '/b_560x95.png[/img][/url][/center]')
  end;

  if RadioButton1.Checked then
  begin
    if CheckBox1.Checked then
      Writeln(F, '<p align="center"><a href="http://www.gametracker.com/server_info/'
               + IP + ':' + port + '/"><img border="0" '
               + 'src="http://cache.www.gametracker.com/server_info/'
               + IP + ':' + port + '/b_350x20_C692108-381007-FFFFFF-000000.png"></a></p>');

    if CheckBox2.Checked then
      Writeln(F, '<p align="center"><a href="http://www.2142-stats.de/'
                + name + '+stats.html"><img border="0" src="http://sigs.2142-stats.com/'
                + name + '_player_31422.png"></a></p>');

    if CheckBox3.Checked then
      if (Trim(form1.Edit2.Text) <> '') then
        Writeln(F, '<p align="center"><a href="http://www.gametracker.com/server/'
                  + IP + ':' + port + '/player/' + clan_tag + '%20' + name
                  + '/"><img border="0" src="http://cache.www.gametracker.com/player/'
                  + clan_Tag + '%20' + name + '/' + IP + ':' + port + '/b_560x95.png"></a></p>')
      else
        Writeln(F, '<p align="center"><a href="http://www.gametracker.com/server/'
                 + IP + ':' + port + '/player/' + name + '/"><img border="0"
                 + 'src="http://cache.www.gametracker.com/player/'
                 + name + '/' + IP + ':' + port +'/b_560x95.png"></a></p>')
  end;
  CloseFile(F);
  MessageDlg('Datei "' + d_name + '.txt" wurde erstellt', mtInformation, [mbOk], 0);
  close;
end;
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat