Microsoft KB Archive/236097

= PRB: ReadMethod Returns Name of Method at Run Time =

Article ID: 236097

Article Last Modified on 2/15/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q236097



SYMPTOMS
At design time, calling the ReadMethod function returns the text of the specified method. At run time, calling the ReadMethod function returns only the name of the method.



Steps to Reproduce Behavior
 In Visual FoxPro, create a new project.  Change to the Code tab, highlight Programs and click the New button. Add the following code in the code window: DO FORM form1 READ EVENTS  Save the new program file as main.prg. Change to the Documents tab, highlight Forms and click the New button.  Add the following to the events in the form: FORM.LOAD: WAIT WINDOW THIS.READMETHOD('CLICK') FORM.CLICK: 'THIS IS THE CODE IN THE CLICK OF THE FORM FORM.UNLOAD: CLEAR EVENTS  Save the form as Form1 and close the designer. On the Project Manager, click the Build button and build an executable file named Mytest.exe.</li> Change back to the Code tab in the Project Manager, highlight Main.prg, and click the Run button. Note that when the form is launched, a WAIT WINDOW appears with the text that was entered in the Click method of the form. Close the form with the close box. Now, launch Windows Explorer and navigate to the directory that contains Mytest.exe (built earlier in step 7). Double-click the executable. Note that a WAIT WINDOW with only the method name 'Click' appears.</li></ol>

<div class="references_section">