Paste text in Code Viewer ?

Help and questions on programming the codebug
Post Reply
testing
Posts: 2
Joined: Thu Sep 03, 2015 1:36 pm

Paste text in Code Viewer ?

Post by testing » Thu Sep 03, 2015 1:45 pm

Hi All

Does anybody know of a way to paste text into Code Viewer?
I know it is called a viewer for a reason, any way around that?

Understand you can load a program and save it with a sifferent name but
if there is no way to paste text, is there a way to copy a lot of blocks and then paste them ?

Is there a FAQ? maybe we could add things like scratch-codebug
http://simplesi.net/scratchcodebug-beta-testing/

Thanks in advance for any answers

admin
Site Admin
Posts: 2
Joined: Fri Jul 31, 2015 10:16 am

Re: Paste text in Code Viewer ?

Post by admin » Fri Sep 04, 2015 8:58 am

There is already a scratch sub forum on here:
http://codebugforum.co.uk/viewforum.php?f=14

BMS Doug
Posts: 61
Joined: Wed Aug 26, 2015 8:54 am
Contact:

Re: Paste text in Code Viewer ?

Post by BMS Doug » Fri Sep 04, 2015 11:57 am

testing wrote:Hi All
Is there a way to copy a lot of blocks and then paste them ?
Yes, you can copy and paste:
If you right click on a block you can duplicate it (and any sub-blocks) and drop the duplicates into your program further down.
if you have a section of blocks that you want to duplicate you could first drag them into a loop (1) block, then duplicate the loop (1) block and all your blocks will be duplicated.

Drop duplicates into the program immediately, if you put them aside from the program they will split into their components.

pigraham
Posts: 65
Joined: Sat Aug 15, 2015 1:41 pm

Re: Paste text in Code Viewer ?

Post by pigraham » Fri Sep 04, 2015 2:20 pm

BMS Doug wrote:
testing wrote:Hi All
Is there a way to copy a lot of blocks and then paste them ?
Yes, you can copy and paste:
If you right click on a block you can duplicate it (and any sub-blocks) and drop the duplicates into your program further down.
if you have a section of blocks that you want to duplicate you could first drag them into a loop (1) block, then duplicate the loop (1) block and all your blocks will be duplicated.

Drop duplicates into the program immediately, if you put them aside from the program they will split into their components.
Of course what we want to do is copy from script A and paste into script B which would allow some limited code reuse. Much better would be the ability to include one script in another as a module.

BMS Doug
Posts: 61
Joined: Wed Aug 26, 2015 8:54 am
Contact:

Re: Paste text in Code Viewer ?

Post by BMS Doug » Fri Sep 04, 2015 4:02 pm

pigraham wrote: Of course what we want to do is copy from script A and paste into script B which would allow some limited code reuse. Much better would be the ability to include one script in another as a module.
Re-mix from project A to start Project B?
Not ideal perhaps, maybe the codebug developers will read this and take heed.

pigraham
Posts: 65
Joined: Sat Aug 15, 2015 1:41 pm

Re: Paste text in Code Viewer ?

Post by pigraham » Fri Sep 04, 2015 4:28 pm

BMS Doug wrote:
pigraham wrote: Of course what we want to do is copy from script A and paste into script B which would allow some limited code reuse. Much better would be the ability to include one script in another as a module.
Re-mix from project A to start Project B?
Not ideal perhaps, maybe the codebug developers will read this and take heed.
Yes, that's the basic idea, but there is no way to combine A & B to make to make project C, short of a remix of A plus rebuilding the parts of B, block by block. Tedious.

BMS Doug
Posts: 61
Joined: Wed Aug 26, 2015 8:54 am
Contact:

Re: Paste text in Code Viewer ?

Post by BMS Doug » Sat Sep 05, 2015 7:14 am

pigraham wrote:
Yes, that's the basic idea, but there is no way to combine A & B to make to make project C, short of a remix of A plus rebuilding the parts of B, block by block. Tedious.

Perhaps we should develop a wishlist of features we'd like to see.

testing
Posts: 2
Joined: Thu Sep 03, 2015 1:36 pm

Re: Paste text in Code Viewer ?

Post by testing » Sun Sep 06, 2015 1:18 am

A wish list is a very good idea.

Is there any other person who is a programmer and besides using codebug for his/her child
could do some programming in text format ?

Any more suggestions/wishes for improvement?

mikerr
Posts: 83
Joined: Fri Jul 31, 2015 10:37 am
Contact:

Re: Paste text in Code Viewer ?

Post by mikerr » Sun Sep 06, 2015 8:18 am

The problem with an editable codeviewer is that as soon as you make even a minor edit in code,
the graphical blockly sketch is then no longer fully representative of the program as a whole.
You lose the 1:1 relationship that we have now flipping between blockly and code viewer.

Ways around that get complex quickly ...

e.g. a "custom" block - that just has two inputs and one output, letting us write the javascript

An alternative is to have a separate part of the site for uploading javascript to convert to .cdg
or an offline compiler...
Twitter @mikered codebug profile mikerr

pigraham
Posts: 65
Joined: Sat Aug 15, 2015 1:41 pm

Re: Paste text in Code Viewer ?

Post by pigraham » Sun Sep 06, 2015 10:49 am

As I understand it Blockly prduces the javascript that produces the Bug code. It would be useful to be able to edit the code even if you can no longer flip between block and code.

The code view doesn't seem very useful.

Post Reply