# Validate unset variables?

**URL:** https://www.finalbuilder.com/forums/t/validate-unset-variables/334
**Category:** Discussion
**Created:** [January 29, 2007, 11:44am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334 "2007-01-29T11:44:28Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![matth](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@matth](https://www.finalbuilder.com/forums/u/matth)
#### Post date: [January 29, 2007, 11:44am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334/1 "2007-01-29T11:44:28Z")

</div>

Hello,  
  
I’ve recently done some refactoring on my FinalBuilder project to make it easier to turn on/off certain tasks I need when debugging/testing.  
  
I am curious if it is possible to have some sort of validation that a variable is not being used before it has been set. So, I’ve reordered some tasks and a dependency of “variable1” has been more prior to the variable being set. Is there a way to set up validation warning or error?  
  
Thanks,  
Matt

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [January 29, 2007, 11:56am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334/2 "2007-01-29T11:56:27Z")

</div>

Hi Matt,  
  
Sorry, but no - there’s no way to do what you want as the validation is just for the actions in your project. And… as far as FinalBuilder is concerned, variables are always valid as they get reset to their default values before the project runs.  
  
cheers,  
.t8

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [January 30, 2007, 5:31am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334/3 "2007-01-30T05:31:21Z")

</div>

It’d be nice if the validation could at least check that variables are defined. Currently, if you rename a variable, none of its references are updated - and if you forget to update one manually, your project will fail at runtime, rather than at validation time.  
  
Steve

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [January 30, 2007, 7:16am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334/4 "2007-01-30T07:16:03Z")

</div>

ah, yes, that is possible. That is a good idea - we could automatically scan all actions before the build starts looking for variables that aren’t yet defined and fail validation based on that.

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [February 1, 2007, 3:55am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334/5 "2007-02-01T03:55:47Z")

</div>

Would it also be possible to have a way of checking for unused variables? I'm just cleaning out a project and it's fairly tedious to individually search for each variable and find out if it's used anywhere. Maybe a column in the variables window that says how many references it has?

Steve

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [February 1, 2007, 5:10am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334/6 "2007-02-01T05:10:47Z")

</div>

don’t see why not…

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [August 29, 2008, 4:42am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334/7 "2008-08-29T04:42:00Z")

</div>

Was there ever any movement on a feature to assist with variable cleanup?&nbsp; We have a very large project we've been maintaining for 2+ years now, and there's a number of unused variables that I would like to clean up, but like the previous poster said, you have to search the entire project for each variable to know if it's unused.

&nbsp;

Thanks,

Keith

&nbsp;

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [September 1, 2008, 1:44am UTC](https://www.finalbuilder.com/forums/t/validate-unset-variables/334/8 "2008-09-01T01:44:48Z")

</div>

Hi Keith,   
  
 Sorry, we haven’t investigated this issue yet.
