|
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 KingdomPosts: 45 |
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 KingdomPosts: 10893 |
Working from a PC, I use autosave append for this |
||||
| twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1718 |
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: GermanyPosts: 1339 |
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 KingdomPosts: 45 |
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: GermanyPosts: 1718 |
Where did you say it for the first time? causality ≠ correlation ≠ coincidence |
||||
| DigitalDreams Regular Member Joined: 03/05/2025 Location: United KingdomPosts: 45 |
"while using the built in editor", "would save me having to use a PC" |
||||
| stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2718 |
I'm not an inbuilt editor user but can't the lcd sdcard reader be used? |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2952 |
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 KingdomPosts: 8464 |
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: AustraliaPosts: 1084 |
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 |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |