Welcome, Guest
Username: Password: Remember me
This public forum is meant for questions and discussions about Visual FoxPro
  • Page:
  • 1

TOPIC:

cmd with FoxPro 12 Jun 2021 14:03 #18813

  • neewbee
  • neewbee's Avatar
  • Topic Author


  • Posts: 2
  • Hello there. I have a Problem and hope someone can help me. I want to open CMD from the Fox Pro programm and put in an command. This works fine with sendkey - order. But I want the result of the Order in a Variable back in VFP. How can I do this?

    Please Log in or Create an account to join the conversation.

    cmd with FoxPro 13 Jun 2021 15:34 #18825

    • ic2
    • ic2's Avatar


  • Posts: 1608
  • Hello,

    neewbee wrote: Hello there. I have a Problem and hope someone can help me. I want to open CMD from the Fox Pro programm and put in an command. This works fine with sendkey - order. But I want the result of the Order in a Variable back in VFP. How can I do this?


    I do not know Foxpro but in general it is possible to start a CMD line program and get output in the Windows Clipboard. See for example this link: stackoverflow.com/questions/30858148/cop...-output-to-clipboard

    Another simple solution would be to save the result of your DOS program in e.g. %TEMP% as a file with a name you use to read the saved content in the Windows program.

    Dick

    Please Log in or Create an account to join the conversation.

    cmd with FoxPro 15 Jun 2021 18:21 #18851

    • mainhatten
    • mainhatten's Avatar


  • Posts: 199
  • neewbee wrote: Hello there. I have a Problem and hope someone can help me. I want to open CMD from the Fox Pro programm and put in an command. This works fine with sendkey - order. But I want the result of the Order in a Variable back in VFP. How can I do this?


    There were a few code snippets to open a "command window" on a program even in runtime. You must search old toolboxes from nineties - vfp3 to 6 probably. Or ask on one of vfp targeting sites. You still have to anchor those in code. Might be better to restrict such use cases to those already coding in vfp and having access to developer IDE including debugger (which probably would be even better for said use case!) and not depend on runtime add-on.

    my 0.02€
    thomas

    Please Log in or Create an account to join the conversation.

    cmd with FoxPro 17 Jun 2021 14:38 #18858

    • Bourke
    • Bourke's Avatar


  • Posts: 6
  • What is an 'Order' in this scenario? A number, string, object ?

    There are many ways to do this from Visual Foxpro depending on the requirement and how much control you have over the external process you want to run.

    You could use Windows Scripting Host, Windows kernel CreateProcessEX ... it depends.

    Please Log in or Create an account to join the conversation.

    cmd with FoxPro 17 Jun 2021 17:55 #18863

    • neewbee
    • neewbee's Avatar
    • Topic Author


  • Posts: 2
  • I want the answer in a String like "File mit found"
    I Open cmd over FoxPro and send command with sendkey Funktion.
    And dir that I Neef the answer AS a String ti Work with ir in my programa.

    Please Log in or Create an account to join the conversation.

    Last edit: by neewbee.

    cmd with FoxPro 17 Jun 2021 19:18 #18866

    • mainhatten
    • mainhatten's Avatar


  • Posts: 199
  • neewbee wrote: I want the answer in a String like "File mit found"
    I Open cmd over FoxPro and send command with sendkey Funktion.
    And dir that I Neef the answer AS a String ti Work with ir in my programa.


    Google "foxpro command window runtime leafe", probably Github link to Ed's code for a foxpro command window, not a Dos/Cmd/Command window. Or just a form with a texbox to read a form.Or loop in Wait Window, build String, until CR is read....

    Please Log in or Create an account to join the conversation.

    cmd with FoxPro 20 Jun 2021 14:06 #18876

    • RGreim4XS
    • RGreim4XS's Avatar


  • Posts: 41
  • Hi long time ago there was pocketfox, which includes also a scripting engine. To run it, it needs a VFP runtime.
    Maybe it’s still there on the web.
    Another good source is vfpx at github.



    HTH
    Rainer

    Please Log in or Create an account to join the conversation.

    Last edit: by RGreim4XS.
    • Page:
    • 1