Thema: Delphi String: Copy, Pos

Einzelnen Beitrag anzeigen

Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#6

Re: String: Copy, Pos

  Alt 25. Okt 2003, 19:42
jo, dein project funzt einwandfrei


ich habe nochmal eine frage, und zwar...

das ist der original quelltext:

Zitat:
<html>

<head>

<title>CNC Reloaded - Battle Clans</title>

</head>

<body>

<center>

<h1>CNC:R Tiberian Sun Battle Clans</h1>

<h2>Text-Only version</h2>








<h3>Administrate Battle Clans</h3>

<table border="0" cellspacing="0" cellpadding="0">
<td width="200">

<font size="4">Clan name:</p></font></td><td width="400">

<font size="4">Best game ever</p></font></td><tr>
<td width="200">

<font size="4">Abbreviation:</p></font></td><td width="400">

<font size="4">TS</p></font></td><tr>
<td width="200">
</td><td width="400">
</td><tr>
<form action="clan.php?action=kick_member" method="POST">
<input type="hidden" name="admin_pass" value="00000000">
<input type="hidden" name="clan_name" value="TS">
<td width="200">

<font size="4">Kick member:</p></font></td><td width="400"><select name="kick_mem">

<option name="hehe">hehe</option>
<option name="haha">haha</option>
<option name="LooL">LooL</option>
<option name="keke">keke</option>
<option name="huhu">huhu</option>
<option name="lalilu">lalilu</option>
<option name="sudnevo">sudnevo</option>
<option name="heinz">heinz</option>
<option name="tcclanplz">tcclanplz</option>
<option name="uwe33">uwe33</option>

</select><input type="submit" value="Kick"></td></form>
<form action="clan.php?action=chage_motto" method="POST">
<input type="hidden" name="admin_pass" value="02580258">
<input type="hidden" name="clan_name" value="TS">
<td width="200">
</td><td width="400">
</td><tr>
<td width="200">

<font size="4">Motto:</p></font></td><td width="400">

<font size="4">TS!</p></font></td><tr>
<td width="200">

<font size="4">New motto:</p></font></td><td width="400">

<font size="4"><input type="text" size="50" maxlength="255" name="clan_motto"></p></font></td><tr>
<td width="200">
</td><td width="400">Leave blank for no new motto<input type="submit" value="Change">
</td>
</form>
<form action="clan.php?action=chage_admin" method="POST">
<input type="hidden" name="admin_pass" value="00000000">
<input type="hidden" name="clan_name" value="TS">
<td width="200">
</td><td width="400">
</td><tr>

nun möchte ich von "<select name="kick_mem">" bis "</select>" kopieren, dies mache ich mit:

Delphi-Quellcode:
procedure TForm2.Button3Click(Sender: TObject);
begin
  Memo1.Text := Copy(Memo1.Text, Pos('<select name="kick_mem">', Memo1.Text), Pos('</select>', memo1.Text));
end;
bei einem Klick auf den button sieht das memo dann so aus:

Zitat:
<select name="kick_mem">
<option name="hehe">hehe</option>
<option name="haha">haha</option>
<option name="LooL">LooL</option>
<option name="keke">keke</option>
<option name="huhu">huhu</option>
<option name="lalilu">lalilu</option>
<option name="sudnevo">sudnevo</option>
<option name="heinz">heinz</option>
<option name="tcclanplz">tcclanplz</option>
<option name="uwe33">uwe33</option>
</select><input type="submit" value="Kick"></td></form>
<form action="clan.php?action=chage_motto" method="POST">
<input type="hidden" name="admin_pass" value="02580258">
<input type="hidden" name="clan_name" value="TS">
<td width="200">
</td><td width="400">
</td><tr>
<td width="200">

<font size="4">Motto:</p></font></td><td width="400">

<font size="4">TS!</p></font></td><tr>
<td width="200">

<font size="4">New motto:</p></font></td><td width="400">

<font size="4"><input type="text" size="50" maxlength="255" name="clan_motto"></p></font></td><tr>
<td width="200">
</td><td width="400">Leave blank for no new motto<input type="submit" value="Change">
</td>
</form>
<form action="clan.php?action=chage_admin" method="POST">
<input type="hidden
bei einem zweitem klick so(wie es sein sollte):

Zitat:
<select name="kick_mem">
<option name="hehe">hehe</option>
<option name="haha">haha</option>
<option name="LooL">LooL</option>
<option name="keke">keke</option>
<option name="huhu">huhu</option>
<option name="lalilu">lalilu</option>
<option name="sudnevo">sudnevo</option>
<option name="heinz">heinz</option>
<option name="tcclanplz">tcclanplz</option>
<option name="uwe33">uwe33</option>
<
nun die frage, wieso muss ich 2mal klicken bis ich das so habe?
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat