Autor Beitrag
F.Art
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Sa 28.12.02 02:44 
Ich würde gerne einen beliebigen Text sperren lassen egal ob er groß,klein oder gemischt geschrieben ist.
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Sa 28.12.02 02:51 
Wo wie was?
thebe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

WinXP Home
D6 Enterprise
BeitragVerfasst: Sa 28.12.02 02:51 
Bitte WAS ?

Wo willste den Text sperren lassen ?


Formulier ma ne anständige Frage womit man was anfangen kann, dann könnte man Dir auch helfen...
chefkoch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP pro
D7
BeitragVerfasst: Sa 28.12.02 02:56 
Probiers hiermit:
ausblenden Quelltext
1:
 if upcase(edit1.text) = 'HALLO' then blabla					

dann setzt der den text in edit1 auf NUR GROSSBUCHSTABEN

das mit dem sperren is deine Sache !

cya

chefkoch
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 28.12.02 12:21 
oder du machst das mit POS !!! die fuktio gibt dir die position eines strings in einem andresn zurück !!! wenn du z.b. nicht willst das hallo in dem string vorkommt, aber der user hallodu eintrippt bringt dir die methode von oben nix.[/code]

_________________
In the beginning was the word.
And the word was content-type: text/plain.
chefkoch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP pro
D7
BeitragVerfasst: Sa 28.12.02 14:34 
Machen wir es 'fart' (*lol*) nich so schwer :


ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
function textwegmachfunction(eingabe, auszuschliessen : string) : string;
var hilf : string;
    i    : integer;
begin
     hilf := '';
     ///pos ist caseINsensitive
     if pos(auszuschliessen,eingabe) > 0 then
      begin
        for i := 1 to pos(auszuschliessen,eingabe)-1 do
        hilf := hilf + eingabe[i];
        for i := pos(auszuschliessen,eingabe)+5 to length(eingabe) do
         hilf := hilf + eingabe[i];
      end;
        textwegmachfunction := hilf;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
     edit1.text := textwegmachfunction(edit1.text,'hallo');
end;




Viel Spaß beim anwenden


chefkoch

_________________
Chaos, Panic, Disorder - My work here is done


Zuletzt bearbeitet von chefkoch am Fr 13.02.04 09:34, insgesamt 1-mal bearbeitet
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Sa 28.12.02 15:04 
Irgendwie funkt das bei mir nicht richtig. Er ersetzt alle wörter.
Ich habe mir noch überlegt das es vieleicht für meine Zwecke besser ist aus einem wort zB Hallöchen nach hall suchen lassen und das er dann sperrt.
chefkoch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP pro
D7
BeitragVerfasst: Sa 28.12.02 15:07 
Sag doch einfach mal, was du eingibst

und was rauskommen soll

Von EVA mach ich dir das V ;)=

C ya

chefkoch
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Sa 28.12.02 19:41 
Ich will einfach nur zB ne eMail Adresse sperren.
zB jederman@gmx.de das er das gmx nicht akzeptiert.
chefkoch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP pro
D7
BeitragVerfasst: Sa 28.12.02 19:43 
hä ?

also aus jedermann@gmx.de


soll jedermann@.de erstellt werden .. oder nur ne message
die sagt.. "nönö .. will ich nich" ??

:?: :?: :?: :?: :?: :?:
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Sa 28.12.02 19:45 
Nur ne Message dies ist nicht möglich und soll natürlich dann zu end springen.
chefkoch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP pro
D7
BeitragVerfasst: Sa 28.12.02 19:54 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
if pos('gmx.de',edit1.text) = 0 then
     begin
        //Hier kommt der sche*** hin, den er machen soll, wenn "@gmx.de" nich drin is
        messagedlg('is okay !',mtinformation,[mbok],0);
     end
     else
     begin
          messagedlg('GMX stinkt !',mterror,[mbok],0);
          edit1.text := 'GMX stinkt !';
     end;




fertitsch !


chefkoch
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Sa 28.12.02 20:01 
Genau so wollte ich das aber er sollte zwischen groß,klein oder gemischt nicht unterscheiden.

Aber schonmal THX
chefkoch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP pro
D7
BeitragVerfasst: Sa 28.12.02 20:07 
pos ist von hause aus caseINseNsiTive ... Also IsT DAS ÜBEerhaUpt Kein ProBleM ..
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Sa 28.12.02 20:15 
Ich weis ja nicht was du mir sagen wolltest.
Aber das mit groß und klein macht er so nicht.
chefkoch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP pro
D7
BeitragVerfasst: So 29.12.02 00:34 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
if pos(uppercase('gmx.de'),uppercase(edit1.text)) = 0 then 
     begin 
        //Hier kommt der sche*** hin, den er machen soll, wenn "@gmx.de" nich drin is 
        messagedlg('is okay !',mtinformation,[mbok],0); 
     end 
     else 
     begin 
          messagedlg('GMX stinkt !',mterror,[mbok],0); 
          edit1.text := 'GMX stinkt !'; 
     end;


das sollte gehen
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: So 29.12.02 01:38 
Jo THX genau so ist es nach meiner Vorstellung.