PRB: ReadMethod Returns Name of Method at Run Time

ID: Q236097


The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 6.0


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:


  3. DO FORM form1
    READ EVENTS 
  4. Save the new program file as main.prg.


  5. Change to the Documents tab, highlight Forms and click the New button.


  6. Add the following to the events in the form:


  7. FORM.LOAD:
    
    WAIT WINDOW THIS.READMETHOD('CLICK') 
    FORM.CLICK:
    
    'THIS IS THE CODE IN THE CLICK OF THE FORM 
    FORM.UNLOAD:
    
    CLEAR EVENTS 
  8. Save the form as Form1 and close the designer.


  9. On the Project Manager, click the Build button and build an executable file named Mytest.exe.


  10. 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.


  11. 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 numbers below to view the articles in the Microsoft Knowledge Base:

Q190547 ReadMethod Only Returns Method Text From Visual Class
Q130440 INFO: Reserved Words in Visual FoxPro

Additional query words:

Keywords : kbOOP kbVFp600 kbXBase kbGrpFox kbDSupport
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: August 12, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.