Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case-sensetivity

Status
Not open for further replies.

BobbaFet

Programmer
Feb 25, 2001
903
NL
How can i make a NON-case sensetive replace dialog???
(I'm sorry, but I am not very experienced with
programming ...)

Thanx allot,

BobbaFet Everybody has a right to my opinion.
E-mail me at cwcon@programmer.net
 
If you are using the standard Replace dialog it has an options property, and you can use frHideMatchCase to hide the "match case" box.

Are you writing the search/replace code yourself? What are you searching and replacing in?
 
Hi, thank you for responding, TealWren.

Yes I'm am writing the code myself because it's
for an autoinsert function I'm making to add specific
pieces of code under certain tags. It's going to be for
a TMemo field.

It has to search for two seperate tags and replace them
with my code. If one of the two tags exists, it has to replace it with my code. Otherwise it has to give an error.

Then it has to save the upgraded document.

I sure do hope you can help me.

BobbaFet Everybody has a right to my opinion.
E-mail me at cwcon@programmer.net
 
Hi BobbaFet,

How I would go about searching through a memo for specific tags is to loop through the lines and use the pos function to see if what you are looking for is there. For example,

tag := uppercase(tag);
x:= 0
while x < memo1.lines.count do
begin
if pos(tag, uppercase(memo1.lines[x])>0 then
begin
//I've found it! replace with new value
end
else
inc(x);
end;

(I haven't tried to compile that code - may have errors!) This way it is case insensitive because you are comparing uppercase tag with uppercase line.

Hope that helps!
TealWren
 
Hey TealWren,

That sounds like a really good idea.

Thanx allot,

BobbaFet Everybody has a right to my opinion.
E-mail me at cwcon@programmer.net
 
Hey TealWren,

I want to thank you very much. Although almost nothing is
left of your code, the UpperCase() idea works like a charm!
Thank you very much !!!

BobbaFet Everybody has a right to my opinion.
E-mail me at cwcon@programmer.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top