Wednesday, December 22, 2010

PEM Editor tip: Using StartPEMEditor.prg

The 'normal' way for starting PEM Editor is to do so by using the menu items in the VFP Main Menu ('New Property ...', 'New Method ...', and 'Edit Property / Method ...'.)

There is an alternative to this -- StartPEMEditor.prg.  This file is created when you install PEM Editor (running PEMEditor.APP) and is found in the folder where PEM Editor is installed.

This can be quite handy, for a few reasons:
  • It can allow you to set up your IDE programmatically. 
  • It can allow you to bring up PEM Editor via a hot key.
  • It can allow you.to access the IDE features of PEM Editor even if the PEM Editor form is closed.
StartPEMEditor.prg is compiled with a reference to the full path name where PEM Editor is installed.  Thus it can be copied anywhere on disk (presumably to somewhere on your path).  It can be called one of three ways:
  1. StartPEMEditor() - brings up the normal PEMEditor form.
  2. StartPEMEditor(2) - brings up the Document TreeView form.
  3. StartPEMEditor(.Null.) - instantiates the PEM Editor object (_oPEMEditor), enabling the IDE features of PEM Editor, without opening either of the forms (This is a new feature in version 6.50.)

3 comments:

  1. could you document this in StartPEMEditor() itself ?! i fiddled with it a while until i resolved to starting it without parameters and executing '_oPEmeditor.oUtils.oPEMEditor.Hide()' - took me a while to find that too.

    It's only now that i find out about the .null. param, but .. better late then never :/

    ReplyDelete
  2. Eduard -- Good suggestion, I will include that in the next release. Certainly non-intuitive parameter, I know, but I did not want to disturb previous uses.

    ReplyDelete
  3. Hello Jim. Thanks for such a wonderful tool.
    How do I dock the PEMEditor window programmatically?
    I want it docked to with my Command Window when VFP start.

    Thank you,


    Regy

    ReplyDelete