I've written a code in while loop that finds all occurences of a string in a text. Works great, but now I want to stop the loop at the end, because on each cycle it finds a given string and highlites it in the text. So I want it to stop so that user sees every instance and let him continue by pressing the key. Im sure it can be done, but don't know how.
2007-12-30
15:08:22
·
0 answers
·
asked by
CooK
2
in
Computers & Internet
➔ Programming & Design
quote:"When he stops pressing the key"
I'm interested in him beginnig oressing the key. The point is: The code works exactly as I want, except that it does all in loops. Every cycle of the loop finds the word user has entered, highlights it, then goes to the begginning, find another ocurence if there is one, highlights it (but of course, dehighlight the previous one) and so on until the last ocurence is found. Then the loop exits leaving only the last ocurence highlighted. I want to put a statement in a program to pause the loop after first cycle, as then it highlights the first ocurence, and then to wait for user to press a key if he wants to see another match, and so on. break and continue are of no use here as they exit the loop, which I don't want. I have already achieved proper exit from my loop
2007-12-30
16:09:45 ·
update #1