Copying Code and Globals

Questions & Answers about Helium Scraper 3
Post Reply
durlecs
Posts: 11
Joined: Sat Sep 28, 2019 2:11 am

Copying Code and Globals

Post by durlecs » Wed Oct 16, 2019 2:31 am

Is there a way to copy a global from one project to another? Also, is there a way to copy sections of code to move them up and down or into another global within a project. Often times even copying a single line will result in an error saying that it can't be copied.

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Copying Code and Globals

Post by webmaster » Wed Oct 16, 2019 1:15 pm

You can copy a full global by right clicking it and selecting Copy, and then either paste it into a placeholder by right clicking it and selecting Edit -> Paste, or paste it as a new global by right clicking the Globals and selecting Paste.

You can also copy a piece of code by highlighting it (make sure the full piece of code you need is highlighted), and then right clicking it and selecting Edit -> Copy, or by left clicking it and pressing Ctrl + C.

To move code up and down, you can right click it while it's highlighted and select More -> Move Up/Down, or left click it and press Alt + Up/Down.
Juan Soldi
The Helium Scraper Team

durlecs
Posts: 11
Joined: Sat Sep 28, 2019 2:11 am

Re: Copying Code and Globals

Post by durlecs » Wed Oct 16, 2019 1:50 pm

When I try to copy a global from one project to another, it gives me an "undeclared variable" error and does not copy. How to I deal with that?

Also, I am unable to select more than one piece of code at a time. Is there a way to select a section of code with more than one piece and copy it? It's very time consuming to move a chunk of code one line at a time using the arrow buttons and it's easy to get the lines out of order.

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Copying Code and Globals

Post by webmaster » Wed Oct 16, 2019 2:17 pm

You probably have a variable that doesn't exist in the other project. All globals, selectors, gatherers, etc. must exist in the other project. Otherwise the code is considered invalid since it uses variables that don't exist. The error message should include the name of the missing variables.

It's probably faster to copy the whole global and then delete the lines you don't need. Note that you can also paste into any text editor (not MS Word) and then copy from here and paste back into Helium.

Also, if there is a piece of code you keep reusing, perhaps it's best to put it into a separate global and call it by name. This will also make it easier to copy/paste this code into other projects.
Juan Soldi
The Helium Scraper Team

Post Reply