Deleting variables .. then finding the undefined variables

This forum is for all Flare issues not related to any of the other categories.
Post Reply
skwpt
Propeller Head
Posts: 88
Joined: Thu Oct 01, 2015 2:39 pm

Deleting variables .. then finding the undefined variables

Post by skwpt »

The Madcap Flare 12 Deleting Variables topic makes the task dangerously simple. When I followed the instructions, I expected Flare to prompt me to convert all instances of the target variable to plain text.

It did not. Instead, the topic had a new (Undefined variable: VariableName) variable where the old variable used to be.

I assumed I could search for a variable used in topics, but that does not appear to be the case. I couldn't find an answer on this forum or in the v12 docs (e.g., Using the Find and Replace in Files Feature).

As an immediate fix, I published a local copy of the doc and searched for (Undefined variable: VariableName). That should catch any problems before users see my next build. However, what about using deleted variables in topics that aren't currently published? I worry that I'll end up with that "object not referenced by an object" error and won't know how to fix it.

I feel like I am missing a super obvious way to safely delete a variable. Anyone?

ETA: I forgot to mention that I also tried to find variables used in topics by expanding the Variables folder in the Project Organizer, right-clicking a variable I want to delete, and looking for a submenu option to Show Links. There is no right-click on variables. In fact, there doesn't see to be any action you can perform in the Variable Set Editor besides CRUD.
__________________________________________________________________
Running Flare 2017 r2 on a MacBook Pro.
Parallels Desktop 12 hypervisor with Windows 10 VM
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Deleting variables .. then finding the undefined variabl

Post by NorthEast »

You can generate a report for Undefined Varibles, but I think using find and replace should be ok for most instances.

First, back up the project - e.g. Project > Zip.

Search using the Find in source code option, and search all files for VariableSet.VariableName to get an idea how it's inserted in the code.
Then use a find and replace to fix each way it's used; e.g.
- In topics/snippets you'll see HTML code: <MadCap:variable name="VariableSet.VariableName" />
- In all file types you might see: [%=VariableSet.VariableName%]
skwpt wrote:ETA: I forgot to mention that I also tried to find variables used in topics by expanding the Variables folder in the Project Organizer, right-clicking a variable I want to delete, and looking for a submenu option to Show Links. There is no right-click on variables.
You can right-click a variable set (not individual variable) and View Links.
skwpt
Propeller Head
Posts: 88
Joined: Thu Oct 01, 2015 2:39 pm

Re: Deleting variables .. then finding the undefined variabl

Post by skwpt »

Thank you, Dave. The report was super fast, but I'll try the source code method next.
__________________________________________________________________
Running Flare 2017 r2 on a MacBook Pro.
Parallels Desktop 12 hypervisor with Windows 10 VM
dcisneros
Propeller Head
Posts: 11
Joined: Tue Aug 12, 2014 12:25 pm

Re: Deleting variables .. then finding the undefined variabl

Post by dcisneros »

I'm not sure my experience is completely similar, but for what it's worth, I'll share it too in the event that it helps!

I noticed that when I was building my project, I received errors because there were undefined variables and conditions in my project. However, when I went to edit my variable and condition sets, they were nowhere to be found. For whatever reason, I decided to open the Target file in a text editor and to my surprise, I found a slew of variables that have never existed in my project and lingered from the project I used as a template (the current project was made using the "Create New from Existing" project option).

To get rid of the errors at build time, I had to manually delete the variables and conditions from the Target's source code in a text editor, save it, and then rebuild. Then the errors went away.
skwpt
Propeller Head
Posts: 88
Joined: Thu Oct 01, 2015 2:39 pm

Re: Deleting variables .. then finding the undefined variabl

Post by skwpt »

Thanks dcisneros. Every user tip is appreciated, and your solution will be one more thing for me to examine to clear up my errors.

As for finding/replacing undefined (post deleted) variables, searching in source code crashes Flare every single time.
__________________________________________________________________
Running Flare 2017 r2 on a MacBook Pro.
Parallels Desktop 12 hypervisor with Windows 10 VM
J_Middleton
Propeller Head
Posts: 15
Joined: Thu Jun 23, 2016 9:04 am
Location: Champaign, Illinois

Re: Deleting variables .. then finding the undefined variabl

Post by J_Middleton »

I'm finding Analyzer 9.0.5917 to be super helpful for cleaning up undefined variables and similar issues.
aevansb
Propeller Head
Posts: 10
Joined: Tue Mar 11, 2014 12:50 pm

Re: Deleting variables .. then finding the undefined variabl

Post by aevansb »

Hi guys, I just deleted a lot of variables in my project and performed a tremendous project clean-up. But now my deleted variables still appear as options when I'm typing. If I add them, they appear as undefined variable (as they should be), but it's odd that they appear as options in the first place. Any suggestions?

Nevermind--I found the answer. You have to delete your Analyzer folder. Apparently references are stored there.
Adam Evans in Chicago
Sr Technical Documentation Manager at Strata Decision Technology
Post Reply