locked
Config files RRS feed

  • Question

  • I am running Visual Foxpro.  Somewhere there is a .config.vfp or .config.fpw which is being used automatically on start up to set my default directory and my F2 function key.  I want to change that config file and I can't find it.  I have done multiple searches on my C: disk, all without success.  It's supposed to be in the same folder as vfp.exe but it isn't.  Any suggestions about where to look?  Could it be a hidden file?

    Also, I tried creating a new config.vfp and config.fpw and locating it in the same folder as the vfp.exe file.  But the config files are not being recognized.  Any suggestions???

    Thanks.

    623Bookends

    Thursday, February 9, 2012 4:19 PM

Answers

  • SYS(2019)  returns the current config file name and location.  It could also be in virtual store on W7.

    VFP also stores configuration in Registry: You may also look at Tools - Options - File Locations - Startup Program, Default Directory etc.

    • Marked as answer by 623bookends Friday, February 17, 2012 4:45 AM
    Thursday, February 9, 2012 6:03 PM
  • To define a function key, you would use the on key label command
    To define a global procedure you could place something like the following in your startup .prg:
    
    on key label f2 do myproc.prg
    
    when exiting the app, reset the f2 key by issueng on key label on its own as in:
    
    on key label f2
    
    
    
    To define a procedure in a specific screen, create the procudre then issue:
    
    on key label f2 myform.myproc
    
    again when exiting the screen, reset the funtion key as in:
    
    on key label f2

    HTH

    Mike z

    • Marked as answer by 623bookends Friday, February 17, 2012 4:46 AM
    Friday, February 10, 2012 1:40 AM
  • Hi,

    You could also point your startup program by defining this in Tools->Options...->Page File Locations  now select in this grid colum File Type the Startup Program here you set in the colum Location the full-path of your starting programm. Do click "Set As Default" button and also the "OK"

    Koen

    • Proposed as answer by Naomi N Sunday, February 12, 2012 9:41 PM
    • Marked as answer by 623bookends Friday, February 17, 2012 4:47 AM
    Friday, February 10, 2012 7:24 PM
  • When you save from the Tools | Options dialog, it applies only to the current session unless you click Set as Default.

    Tamar

    • Marked as answer by 623bookends Friday, February 17, 2012 4:47 AM
    Friday, February 10, 2012 9:28 PM
    Answerer

All replies

  • SYS(2019)  returns the current config file name and location.  It could also be in virtual store on W7.

    VFP also stores configuration in Registry: You may also look at Tools - Options - File Locations - Startup Program, Default Directory etc.

    • Marked as answer by 623bookends Friday, February 17, 2012 4:45 AM
    Thursday, February 9, 2012 6:03 PM
  • I checked the config file location using sys(2019).  It told me where the config.fpw is located.  I found the file and opened it and the commands in it are not in effect.  For example, there is a designation of what the F3 key should be (I defined it).  But when I press F3, nothing happens.

    I also checked on tools, options for the file location of startup.  It's blank.  I inserted the path and location of config.fpw, closed the program and restarted it.  The startup file location was blank again.

    Don't know if I mentioned this but I am using WIN7(64).

    Many thanks.

    623bookends

    Friday, February 10, 2012 12:04 AM
  • To define a function key, you would use the on key label command
    To define a global procedure you could place something like the following in your startup .prg:
    
    on key label f2 do myproc.prg
    
    when exiting the app, reset the f2 key by issueng on key label on its own as in:
    
    on key label f2
    
    
    
    To define a procedure in a specific screen, create the procudre then issue:
    
    on key label f2 myform.myproc
    
    again when exiting the screen, reset the funtion key as in:
    
    on key label f2

    HTH

    Mike z

    • Marked as answer by 623bookends Friday, February 17, 2012 4:46 AM
    Friday, February 10, 2012 1:40 AM
  • Thanks, Mike.  What I have failed to do so far is to get the startup program to startup automatically.  In tools, file locations, the location for startup is blank.  The location for config.fpw is also blank.  I tried to modify that by putting in a location but the location I put in doesn't stay.  The next time I run VFP the file location is blank again.

    Thanks for your input.

    623bookends

    Friday, February 10, 2012 4:28 PM
  • Hi,

    You could also point your startup program by defining this in Tools->Options...->Page File Locations  now select in this grid colum File Type the Startup Program here you set in the colum Location the full-path of your starting programm. Do click "Set As Default" button and also the "OK"

    Koen

    • Proposed as answer by Naomi N Sunday, February 12, 2012 9:41 PM
    • Marked as answer by 623bookends Friday, February 17, 2012 4:47 AM
    Friday, February 10, 2012 7:24 PM
  • When you save from the Tools | Options dialog, it applies only to the current session unless you click Set as Default.

    Tamar

    • Marked as answer by 623bookends Friday, February 17, 2012 4:47 AM
    Friday, February 10, 2012 9:28 PM
    Answerer
  • It worked.  Many thanks.

    623bookends

    Friday, February 10, 2012 11:16 PM
  • To follow up on this, the startup file which I set to run on startup sets function 2 to "X".  But somewhere there is a config file which is setting function 2 to "Y".  I can't find where that config file is.  Sys(2019) tells me where the config file is and there is such a file in the folder which Sys(2019) tells me but the commands in it are not the ones going into effect when the program starts.  Very confusing.  I can override the mysterious config file from the command window but that's alot of work.

    623bookends

    Friday, February 10, 2012 11:35 PM
  • Did you check the Virtual Store?

    Something like:

    C:\Users\<YourUserName>\AppData\Local\VirtualStore\Program Files (x86)\Microsoft Visual FoxPro 9\

    Saturday, February 11, 2012 12:10 PM
  • I have now but nothing turned up.  I think the answer is that a file called startprog is being used as the source of the startup commands.  It's in the default folder.  In any event, I've tried using it and so far it's been helpful.

    Thanks for your suggestion.  I was not aware of a VirtualStore before your suggestion arrived.

    623bookends

    Sunday, February 12, 2012 2:29 AM