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

TOPIC:

SET LIBRARY TO '\\xxx\\xxx\program.prg' ADDITIVE & DO '\\xxx\\xxx\program.prg' 28 Jul 2022 11:11 #23126

  • Paul.Newman
  • Paul.Newman's Avatar
  • Topic Author


  • Posts: 1
  • Hello Forum,

    Could anyone help with the following.

    SET LIBRARY TO '\\xxx\\xxx\program.prg' ADDITIVE

    DO '\\xxx\\xxx\program.prg' WITH (variable)

    How would I integrate this VFP code in XSHARP VFP console app?

    Many thanks

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

    SET LIBRARY TO '\\xxx\\xxx\program.prg' ADDITIVE & DO '\\xxx\\xxx\program.prg' 28 Jul 2022 13:38 #23127

    • robert
    • robert's Avatar


  • Posts: 2974
  • Paul,

    FoxPro works with PRG files at runtime.
    X# (and most other languages) work a bit different:
    the sources are included in a project at compile time and are bundled into an output assembly (DLL or EXE) as binary code.
    This binary code is run at runtime.
    That is why the "SET LIBRARY " command does not really make sense in X#.
    If you have common code that you want to use from multiple locations then you would create a library in VS as well. Use the "Class Library" template for that.
    Then in your main app (the console app) you add a reference to the Class Library project.
    This will create 2 assemblies.
    - One for the class library (DLL)
    - One for the main app (EXE)

    You distribute these 2 assemblies and the X# runtime DLLs.

    Of course you can also include the code from the library program in the main app. In that case you only get one assembly (the EXE).
    Please note: if you "Add" an existing item to a VS project then VS creates a copy of that file in the project.
    If you want to share a file between projects you should add what is called a "Linked Item".
    On the "Add Existing Item" dialog there is a down arrow next to the [Add] button. Choose [Add As Link] to add the existing file as link. This will NOT copy the file to your project. That way you can share the same file between projects.
    We do that all the time for common files, like the files that contain our version information. This is shared between all projects in the same solution, so they all have the same version number.

    Robert
    XSharp Development Team
    The Netherlands

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

    • Page:
    • 1