Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Probleme mit einer For-Schleife (https://www.delphipraxis.net/86002-probleme-mit-einer-schleife.html)

Nils_13 7. Feb 2007 18:08


Probleme mit einer For-Schleife
 
Hi,

sl ist:
Code:
 #include
 {
   class main = StdClass
   {
     #proc+
     main
     run
     #proc-
   }
 }
 
 proc main
 {
   CreateSButton(10, 10, 20, 50)
 }
 
 proc run
 {
   main
 }
proc ist:
Code:
 main
 run
Warum bekomme ich jeweils 2x die Meldung "main is correct" und "run is correct", statt nur 1x (gewünscht) ?
Delphi-Quellcode:
 for i := 0 to sl.Count - 1 do
     if Copy(Trim(sl[i]), 1, 4) = 'proc' then
       for j := 0 to procs.Count - 1 do
         if Pos(sl[i], procs[j]) > -1 then
           ShowMessage(procs[j] + ' is correct.');

Gruber_Hans_12345 7. Feb 2007 18:13

Re: Probleme mit einer For-Schleife
 
Delphi-Quellcode:
 for i := 0 to sl.Count - 1 do
     if Copy(Trim(sl[i]), 1, 4) = 'proc' then
       for j := 0 to procs.Count - 1 do
         if Pos(procs[j], sl[i]) > 0 then     // <<<<< eventuell mal so probieren
           ShowMessage(procs[j] + ' is correct.');
[edit], wobei ich mir nicht ganz sicher bin, was du genau machen willst ...

Nils_13 7. Feb 2007 18:35

Re: Probleme mit einer For-Schleife
 
Thx. Das war es :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz