Autor Beitrag
Jagg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 22.11.02 10:11 
Hallo,Leutz !

Ich habe eine Suchfunktion,die nach dem Feld "Artist" oder "Title" sucht !
Jetzt möchte ich auch noch eine Funktion haben,daß er nach "Artist " UND "Title" sucht !

Die Funktion soll diesen Vorgang ausführen :
Ich habe ein EditFeld,dadrin sollen die Namen von Artist und Title reingeschrieben werden,in etwa so "Jennifer Lopez - Jenny from the Block".
Dann soll er nach (Artist,Title) suchen,aber weil noch das Zeichen "-" dazwischen ist,klappt es wahrscheinlich nicht,d.h. man muss dem Programm sagen,das der diese "-" rausschneiden soll und dann suchen !
(Die Funktion ist so ähnlich wie bei Kazaa)

Ich habe hier mal ein Code :
ausblenden Quelltext
1:
Table1.Locate ('Artist;Title',Edit1.Text,[loCaseInsensitive,loPartialKey]);					


(Das ist jetzt nur die Suche !)
(Für das andere Problem habe ich keinen Code,ehrlich gesagt weiss ich auch gar nicht,wie ich anfangen soll)

Könnt ihr mir helfen ?

Jagg !

[/u]
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Fr 22.11.02 11:13 
Hi
eigentlich ist das genausowenig Problem wie die Suche nach einem Stichwort. Du musst deinen Eingabestring zerlegen und anschliessend den Suchvorgang starten:
ausblenden Quelltext
1:
2:
3:
4:
i := Pos('-', Edit1.Text);
Artist := Copy(Edit1.Text, 1, i-1);
Titel := Copy(Edit1.Text, i+1, Length(Edit1.Text) - i);
Table1.Locate('Artist;Titel', VarArrayOf([Artist, Titel]), [loCaseInsensitive, loPartialKey);

Das Problem ist allerdings: Was machst du wenn auch der Interpret oder der Titel selbst schon ein - enthält, oder wenn bei der Eingabe zuerst der Titel eingegeben wird. :?

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 22.11.02 11:56 
.... also,das ist ne gute Frage !
ich glaube,das kann nur Bill Gates beantworten !
oder weiss jemand wie das geht :-) ?

Jagg !
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Fr 22.11.02 12:09 
Was spricht denn gegen zwei Eingabefelder :roll:

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 22.11.02 12:16 
Gar nichts,aber ich hätte es so wie ich beschrieben habe !

Jagg !
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Fr 22.11.02 12:19 
Dann bleibt dir nur noch den Code den ich oben geschrieben hab zu benutzen und auf die Einsicht der Anwender zu hoffen :mrgreen:

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 22.11.02 12:21 
Ok !
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 22.11.02 12:47 
var i := integer ;
artist,titel : string;

stimmt das ??? LSC ?

Jagg !

PS : Bei deinem Code !
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Fr 22.11.02 13:11 
Ja stimmt :!:

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 22.11.02 13:16 
ok danke geht jetzt alles
jetzt geht es weiter mit den rigisterkarten
fragen kommen bestimmt

Jagg!
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 22.11.02 13:17 
Hi jagg,+

ausblenden Quelltext
1:
var i := integer ;					


Das hier stimmt aber nicht ! Was hat ein Gleichheitszeichen in einer Variablen-Deklaration zu suchen ? Nicht, daß Du daran scheiterst. :mrgreen:

Gruß
Hansa