>Hi folks,
>
>For several weeks now I have been working on a Thor utility which will be available soon. This tool uses many Foxtools functions which are exposed in an object typically called loEditorwin, check
https://github.com/VFPX/PEMEditor/blob/master/Documentation/pemeditor_editorwindow_object.md for details.
>
>My work has been delayed for a long time since the program failed occasionally, and seemingly with no pattern for when and how it failed. The errors were incomplete, inconsistent and the debugger didn't provide any help either.
>
>The program copies data programmatically back and forth between the editor and the clipboard, and manipulates it in between. But sometimes some of the data "disappeared" for no reason I could explain, and it made me lose my mind, and much of my hair...! :-)
>
>I was ready to give up, but as a last resort I tried to add a short delay. Lo and behold, that fixed it! And now I want to share it with all of you.
>
>To reproduce the error, try the following code:
>
>
>_cliptext=''
>For lnX = 1 to 10
>* Wait Window '' timeout 0.001
> _cliptext = _cliptext + Transform(lnX) + Chr(13)+Chr(10)
>Endfor
>Wait Window _cliptext
>
>
>Run it several times, and you will notice that sometimes the list of numbers isn't complete, and sometimes it is.
>
>Now remove the comment (*) and run it again. Now you will get the correct result every time!
>
>Conclusion: VFP needs some time to "settle" when you move data to and from the clipboard. A very small delay won't be noticeable, but it will fix the problem!
Instead of WAIT WINDOW could you try DOEVENTS?
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up