Aus einem String Teile herausfiltern
Verfasst: 02.01.2005 16:02
Frohes neues Jahr euch allen
Ich mache einen Chat mit meheren Raümen um nicht immer einen neuen Server auf zu machen habe ich mir das ausgedacht:
Hiermit wollte ich die Infos rausfiltern aber irgendwie mach ich da was falsch
:
Das bekomme ich immer raus:
Obwohl das ergebnis eigentlich das hier sein sollte:
THx 4 Help MJP 
Ich mache einen Chat mit meheren Raümen um nicht immer einen neuen Server auf zu machen habe ich mir das ausgedacht:
Code: Alles auswählen
{ROOM}TestRoom{/ROOM}{CLIENT}PIMP{/CLIENT}{MESSAGE}TEST{/MESSAGE}{FONT}ARIAL{/FONT}{COLOR}black{/COLOR}{BGCOLOR}green{/BGCOLOR}{SIZE}26{/SIZE}Code: Alles auswählen
Nachricht.s="{ROOM}TestRoom{/ROOM}{CLIENT}PIMP{/CLIENT}{MESSAGE}TEST{/MESSAGE}{FONT}ARIAL{/FONT}{COLOR}black{/COLOR}{BGCOLOR}green{/BGCOLOR}{SIZE}26{/SIZE}"
sytxR = FindString(Nachricht, "{/ROOM}", 1)
room.s= Mid(Nachricht,7,sytxR) :Debug room
;-Clientabrage
sytxC = FindString(Nachricht, "{CLIENT}", 1)
sytxC2= FindString(Nachricht, "{/CLIENT}", 1)
client.s= Mid(Nachricht,sytxC+8,sytxC2) :Debug client
;-Nachricht
sytxM = FindString(Nachricht, "{MESSAGE}", 1)
sytxM2= FindString(Nachricht, "{/MESSAGE}", 1)
message.s= Mid(Nachricht,sytxM+9,sytxM2) :Debug message
;-Font
sytxF = FindString(Nachricht, "{FONT}", 1)
sytxF2= FindString(Nachricht, "{/FONT}", 1)
font.s= Mid(Nachricht,sytxF+6,sytxF2) :Debug font
;-Farbe
sytxCo = FindString(Nachricht, "{COLOR}", 1)
sytxCo2= FindString(Nachricht, "{/COLOR}", 1)
color.s= Mid(Nachricht,sytxCo+7,sytxCo2) :Debug color
;-Farbe
sytxBc = FindString(Nachricht, "{BGCOLOR}", 1)
sytxBc2= FindString(Nachricht, "{/BGCOLOR}", 1)
bgcolor.s= Mid(Nachricht,sytxBc+8,sytxBc2) :Debug bgcolor
;-Groesse
sytxS = FindString(Nachricht, "{SIZE}", 1)
sytxS2= FindString(Nachricht, "{/SIZE}", 1)
size.s= Mid(Nachricht,sytxS+7,sytxS2) :Debug size
Code: Alles auswählen
TestRoom{/ROOM
PIMP{/CLIENT}{MESSAGE}TEST{/MESSAG
TEST{/MESSAGE}{FONT}ARIAL{/FONT}{COLOR}black{/COLOR}{BGC
ARIAL{/FONT}{COLOR}black{/COLOR}{BGCOLOR}green{/BGCOLOR}{SIZE}26{/SIZE}
black{/COLOR}{BGCOLOR}green{/BGCOLOR}{SIZE}26{/SIZE}
green{/BGCOLOR}{SIZE}26{/SIZE}
26{/SIZE}
Code: Alles auswählen
TestRoom
PIMP
TEST
ARIAL
black
green
26