PRB: ReadMethod Returns Name of Method at Run Time (236097)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. In Visual FoxPro, create a new project.
  2. 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
  3. Save the new program file as main.prg.
  4. Change to the Documents tab, highlight Forms and click the New button.
  5. 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
    					
  6. Save the form as Form1 and close the designer.
  7. On the Project Manager, click the Build button and build an executable file named Mytest.exe.
  8. 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.

REFERENCES

For additional information about ReadMethod, please click the article number below to view the article in the Microsoft Knowledge Base:

190547 ReadMethod Only Returns Method Text From Visual Class


Modification Type:MajorLast Reviewed:2/15/2005
Keywords:kbOOP kbpending kbprb kbXBase KB236097 kbAudDeveloper