I'm trying to write a program that looks for diffrent symbols such as ' or " and halts a loop.
In the loop all it does is take existing text from a memo and add stuff in front and behind.
My problem is I can't figure out how to search for one symbol in a single string.
I know you can use IndexOf to search a list of strings but that doesn't help me.
Any insight on the subject is welcome.
Thanks,
Ruggie
~
Heres a copy of the code I'm working with so you get a better idea of what I'm doing. The goal is to take html and strip it or transform it so it can be redrawn with javascript. But javascript is sensitive and the html code needs to be checked for sybols and action needs to be taken before the loop copies over the information.
Theres 3 TMemo fields.
Memo1 is the one the user types in.
CacheMemo is the one we copy the information in.
Memo2 is in a diffrent window and CacheMemo just gets copied over.
(I will most likely take this down to just two but for now its easier for me this way)
~
CacheMemo->Clear();
int TotalLines = Memo1->Lines->Count;
int CurrentLine = 0;
while (CurrentLine <= TotalLines && CurrentLine != TotalLines){
CacheMemo->Lines->Add("document.write('" + Memo1->Lines->Strings[ignore][CurrentLine][/ignore] + "');"
CurrentLine++;
}
~
Once again...
Thanks!!!
In the loop all it does is take existing text from a memo and add stuff in front and behind.
My problem is I can't figure out how to search for one symbol in a single string.
I know you can use IndexOf to search a list of strings but that doesn't help me.
Any insight on the subject is welcome.
Thanks,
Ruggie
~
Heres a copy of the code I'm working with so you get a better idea of what I'm doing. The goal is to take html and strip it or transform it so it can be redrawn with javascript. But javascript is sensitive and the html code needs to be checked for sybols and action needs to be taken before the loop copies over the information.
Theres 3 TMemo fields.
Memo1 is the one the user types in.
CacheMemo is the one we copy the information in.
Memo2 is in a diffrent window and CacheMemo just gets copied over.
(I will most likely take this down to just two but for now its easier for me this way)
~
CacheMemo->Clear();
int TotalLines = Memo1->Lines->Count;
int CurrentLine = 0;
while (CurrentLine <= TotalLines && CurrentLine != TotalLines){
CacheMemo->Lines->Add("document.write('" + Memo1->Lines->Strings[ignore][CurrentLine][/ignore] + "');"
CurrentLine++;
}
~
Once again...
Thanks!!!