News:

  • October 14, 2025, 07:23:39 AM

Login with username, password and session length

Author Topic: Import/Export subroutines, tasks, programs?  (Read 2274 times)

willpoll

  • Sr. Member
  • ****
  • Posts: 54
Import/Export subroutines, tasks, programs?
« on: September 29, 2017, 03:43:28 PM »
Is it possible to Import/Export subroutines, tasks, or programs?

Not whole programs, but what DMD refers to as programs.  I just want to import a routine from one project to another project for a different site.

Help file only appears to cover complete projects.

Thanks!!

-Will

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3761
    • Host Engineering
Re: Import/Export subroutines, tasks, programs?
« Reply #1 on: September 29, 2017, 04:10:56 PM »
Yes.

On File->Export->Project dialog, after select the text file, the Export Options lets you choose the Specific Code Block to export.  Choose the specific code-block.  You then need to NOT export the System Configuration and so you need to UNCHECK System Configuration in the Configuration group (see EXPORT1.png).

Since you are going to MERGE this code-block into an EXISTING project, you do NOT use IMPORT, which imports it as a whole new project.  Instead, open up the other project you want to import it into, and use
Tools->Insert Instructions from File... MAKE SURE YOU ARE IN EDIT MODE (Ctrl+E).

In the Insert Instructions dialog, after selecting the file you exported from the other project in the first step, in the Instruction Import Method, select As Code Blocks (see INSERT1.png).

There could be collisions with original project's nicknames with the destination project's nicknames.  The default behavior is to MERGE the import file's documentation with the .dmd project's documentation, giving priority to the .dmd project file.  Tweak that setting as you see fit, but the default (Merge w/DMD project priority) is OK (you won't lose anything in the .dmd project, but something might not come across).

Hit the OK and the original code-block should show up in your new project (see INSERT2.png).

If you have complex devices from the original that do not exist in the destination, you may need to manually add them to your destination project before doing the INSERT, making sure you use IDENTICAL NAMES from the original (device configurations cannot be easily inserted as text).
« Last Edit: September 29, 2017, 04:15:19 PM by franji1 »

willpoll

  • Sr. Member
  • ****
  • Posts: 54
Re: Import/Export subroutines, tasks, programs?
« Reply #2 on: September 29, 2017, 04:30:46 PM »
Thanks Franji,

Doh!! insert not import...that's what was screwing me up!

Funny, before I asked, I read it, understood it, then instantly forgot it.   :P

-Will