Is it possible to move a variable from one set to another?
I know I could delete it in the old set, create it in the new set, and then use Analyzer to find all the places where the old one was used, but I'd like to be able to do something like dragging the variable from one set to another.
Move a variable from one set to another
-
AndrewCampbell
- Propeller Head
- Posts: 24
- Joined: Thu Nov 10, 2016 4:19 am
-
Nita Beck
- Senior Propellus Maximus
- Posts: 3672
- Joined: Thu Feb 02, 2006 9:57 am
- Location: Pittsford, NY
Re: Move a variable from one set to another
I don't think Flare supports dragging a variable out of one variable set into another.
You can achieve this pretty easily by opening each variable set in the internal text editor. In the first variable set, find the line(s) that constitutes the variable you want to move; cut from there. Then in the second variable set, paste the line(s) there. Just be very careful that you are pasting the line(s) into the right spot, else you'll screw up the variable set altogether.
Later, you don't need immediately to turn to Analyzer. In Flare, to clean up all the topic files and snippet files that still reference the variable in the first variable set, do a search-and-replace operation -- something like search for "VariableSetA.Variable1" and replace it with "VariableSetB.Variable1".
If you've used the variable elsewhere, such as in TOC entries or index keywords, you'll need to hunt for those, and Analyzer can help you find them.
IMPORTANT (and should have gone first in my response): Always make a backup of the entire project before editing code in lots of files, just in case something goes amiss. Don't be afraid of editing code; but be mindful that one can do serious damage with the tiniest of typos.
You can achieve this pretty easily by opening each variable set in the internal text editor. In the first variable set, find the line(s) that constitutes the variable you want to move; cut from there. Then in the second variable set, paste the line(s) there. Just be very careful that you are pasting the line(s) into the right spot, else you'll screw up the variable set altogether.
Later, you don't need immediately to turn to Analyzer. In Flare, to clean up all the topic files and snippet files that still reference the variable in the first variable set, do a search-and-replace operation -- something like search for "VariableSetA.Variable1" and replace it with "VariableSetB.Variable1".
If you've used the variable elsewhere, such as in TOC entries or index keywords, you'll need to hunt for those, and Analyzer can help you find them.
IMPORTANT (and should have gone first in my response): Always make a backup of the entire project before editing code in lots of files, just in case something goes amiss. Don't be afraid of editing code; but be mindful that one can do serious damage with the tiniest of typos.
Nita

RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
-
AndrewCampbell
- Propeller Head
- Posts: 24
- Joined: Thu Nov 10, 2016 4:19 am
Re: Move a variable from one set to another
That's a shame; it would be a handy feature at times.Nita Beck wrote:I don't think Flare supports dragging a variable out of one variable set into another.
I was tidying some legacy documentation, and there was one variable set that had a variable called "Product" and another variable called "Release". Sadly the "Product" applied to one piece of software and "Release" applied to another.
I fixed this by creating a new variable group and creating "Product" in it. Then I deleted the old "Product" and used Analyzer to get a list of all the things I had broken, and then used Analyzer's search and replace to fix them.
I use git for source control, so I created a branch in git before doing any of this. That way if I broke anything the worst-case scenario would mean discarding the branch and reverting to the original.