News:

  • September 23, 2026, 02:43:25 AM

Login with username, password and session length

Author Topic: Can't Paste Code Block  (Read 8902 times)

Bolt

  • Hero Member
  • *****
  • Posts: 598
Can't Paste Code Block
« on: June 05, 2019, 10:47:31 AM »
I can't seem to paste a code block from a txt file.  What am I doing wrong?
Here's my source https://forum.hosteng.com/index.php/topic,2048.msg17334.html#msg17334
I copy it from notepad and try to paste it, the paste selection is grayed out.  I can copy an existing program, and paste it into a new project just fine.  If I paste it into notepad, and then copy the text, I can't paste it over either.  Can someone help?  Or convert the link into a new project?  Thanks!

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: Can't Paste Code Block
« Reply #1 on: June 05, 2019, 11:14:18 AM »
I might add I've tried this in DmD 2.5 and 2.1 both

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: Can't Paste Code Block
« Reply #2 on: June 05, 2019, 11:17:07 AM »
"Tools -> Insert Instructions From File" is what you are looking for.

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: Can't Paste Code Block
« Reply #3 on: June 05, 2019, 12:42:56 PM »
Thanks for the pointer.  I got it to work.  Had to edit the file and remove SYS_CONFIG info.  That also required renaming the devices to a device that exists in a new project.  I alsol had to revert back to 2.1 though.  2.5 kept saying

Quote
[Error]      Instruction "$PRGRM" cannot be inserted as a user instruction
[Error]      Instruction "$PGMEND" cannot be inserted as a user instruction

FYI

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Can't Paste Code Block
« Reply #4 on: June 05, 2019, 12:55:26 PM »
You probably tried to import it as a set of instructions vs. a code-block.  The Import processes the import differently based on whether there are code-block (e.g. $PRGRM/$PGMEND).  For example, if you are just inserting instructions, you MUST provide an address to "insert them" at.  This is not needed if the text file contains a bunch of code blocks, not a list of single instructions.

In the Insert Instructions dialog, just change the Instruction Import Method from As Rungs of Logic to As Code Blocks.  That should make it work!

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: Can't Paste Code Block
« Reply #5 on: June 05, 2019, 01:26:02 PM »
In the Insert Instructions dialog, just change the Instruction Import Method from As Rungs of Logic to As Code Blocks.  That should make it work!

Ha, the default selection changed from As Code Blocks to As Rungs of Logic somewhere between 2.1 and 2.5.  No big deal, thanks!