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

TOPIC:

Searching for a Solution with "DO &VarName" 29 Sep 2022 09:26 #24065

  • Florentin Lüdeking
  • Florentin Lüdeking's Avatar
  • Topic Author


  • Posts: 11
  • Hey guys is there a solution for my little problem to start a prg with a variable?

    cExecCode = "programm1"
    DO &cExecCode

    I also tried evaluate() but it didnt work either.

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

    Searching for a Solution with "DO &VarName" 29 Sep 2022 13:23 #24067

    • robert
    • robert's Avatar


  • Posts: 3213
  • Florentin,

    The compiler rule for DO expects an identifier and not a macro (yet). I will change that for a next build.

    You should be able to call it like a function:
    &(cExecCode+"()")

    or slightly more advanced, bypassing the macro compiler
    _CallClipFunc(cExecCode)

    The last method also allows you to pass parameters like this
    _CallClipFunc(cExecCode,1,"42",Date())

    Robert
    XSharp Development Team
    The Netherlands

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

    Searching for a Solution with "DO &VarName" 29 Sep 2022 13:28 #24068

    • robert
    • robert's Avatar


  • Posts: 3213
  • Florentin,
    Added as "todo"
    github.com/X-Sharp/XSharpPublic/issues/1147
    Robert
    XSharp Development Team
    The Netherlands

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

    Searching for a Solution with "DO &VarName" 29 Sep 2022 14:11 #24069

    • Florentin Lüdeking
    • Florentin Lüdeking's Avatar
    • Topic Author


  • Posts: 11
  • I tried the solution and it works :)

    Thank your Robert!

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

    • Page:
    • 1