Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:42 25 Jan 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Copying code from other programs with inbuilt editor?

Author Message
DigitalDreams
Regular Member

Joined: 03/05/2025
Location: United Kingdom
Posts: 45
Posted: 12:59pm 24 Jan 2026
Copy link to clipboard 
Print this post

I often find myself wanting to copy or move sections of code from one program to another while using the built in editor. Is there a way of doing this as exiting clears the paste buffer ?. Maybe a way of inserting another .bas file at the cursor position ?

Would save me having to use a PC via the sd card saves, not feasible when travelling.

Thanks in advance...
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10893
Posted: 01:59pm 24 Jan 2026
Copy link to clipboard 
Print this post

Working from a PC, I use autosave append for this
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1718
Posted: 02:43pm 24 Jan 2026
Copy link to clipboard 
Print this post

I use the HDMI version of the FileManager for this (old F8=Cut, old F9=Merge).
Regards
Michael
causality ≠ correlation ≠ coincidence
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1339
Posted: 04:35pm 24 Jan 2026
Copy link to clipboard 
Print this post

This is how I do it.
Transfer the source files to the PC via xmodem, then edit them in Notepad++ and copy them back to the Pico via xmodem. You can then store frequently used routines (subs/fonts/functions) on the PC and simply add them to the source code.
For minor changes, testing and error corrections, I use the built-in editor.
Cheers
Martin
Edited 2026-01-25 02:39 by Martin H.
'no comment
 
DigitalDreams
Regular Member

Joined: 03/05/2025
Location: United Kingdom
Posts: 45
Posted: 04:58pm 24 Jan 2026
Copy link to clipboard 
Print this post

Think I'll have to say again NO PC, only using the inbuilt file manager and editor... there must be a way. LCD Picomite 6.01 on a Pico2 btw...

A command such as 'INSERT' would be great for this, or preserving the copy  buffer on exiting the editor so the section could be pasted into another .bas
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1718
Posted: 05:36pm 24 Jan 2026
Copy link to clipboard 
Print this post

  DigitalDreams said  Think I'll have to say again NO PC, only using the inbuilt file manager and editor...

Where did you say it for the first time?
causality ≠ correlation ≠ coincidence
 
DigitalDreams
Regular Member

Joined: 03/05/2025
Location: United Kingdom
Posts: 45
Posted: 05:49pm 24 Jan 2026
Copy link to clipboard 
Print this post

  twofingers said  Where did you say it for the first time?


"while using the built in editor", "would save me having to use a PC"
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2718
Posted: 05:52pm 24 Jan 2026
Copy link to clipboard 
Print this post

I'm not an inbuilt editor user but can't the lcd sdcard reader be used?
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2952
Posted: 08:46pm 24 Jan 2026
Copy link to clipboard 
Print this post

Until someone comes up with a better way, here is a convoluted method that may (eventually) do what you want.

1) Save your current program (the one you want to add a block of code to) to A: or B:

2) Load and edit the program that has the routine you want from A: or B:

3) Delete everything except the routine you want and save it with a new name to A: or B:

4) Write a short program to open that file and append each of its lines to the target program.

4) Edit that program (the one in step 1, if I have confused you) and move that new block of code from the end to where it is needed.

That should keep you out of mischief for a while. ;)

Option 2 (the one you don't want)
Always take a laptop/notebook computer when travelling.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8464
Posted: 09:27pm 24 Jan 2026
Copy link to clipboard 
Print this post

The Picomite has no OS or windows-type clipboard. You can list a second program to the console  while editing one, but you can't copy from it as it's merely being listed from flash or SD card - it's not in the editor. You can only have one program there.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1084
Posted: 10:56pm 24 Jan 2026
Copy link to clipboard 
Print this post

An extension of Phils idea.
Use the REM command to create some directives that a third program understands.
e.g.
--- In the target file
REM SOURCE A:/file1.bas
REM INSERT FILE          'insert whole file here
REM INSERT AA            'insert section bounded by REM AA ... REM AA
REM INSERT BB etc

--- In the source file
REM AA
code to insert
.....
REM AA
REM BB
other code
REM BB

1. Added the required directives and save the file.
2. Load the source file and mark the sections and save if not already done.
3. Run your third program , a utility that understands the above syntax that will modify your file as specified and reload it.
F4 H7FotSF4xGT
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026