# Using a variable value

**URL:** https://forum.kirupa.com/t/using-a-variable-value/253245
**Category:** Uncategorized
**Created:** [February 28, 2008, 3:04pm UTC](https://forum.kirupa.com/t/using-a-variable-value/253245 "2008-02-28T15:04:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Germaris](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@Germaris](https://forum.kirupa.com/u/Germaris)
#### Post date: [February 28, 2008, 3:04pm UTC](https://forum.kirupa.com/t/using-a-variable-value/253245/1 "2008-02-28T15:04:08Z")

</div>

Hi there!

Please, first, promise not to laugh!

In the script, I wrote:  
text\_field.text = “yes”;  
var a:String = text\_field.text;

At the beginning of a conditional logic statement I want to use the value of this variable.  
How should I write the condition?

I tried:  
if (a == yes) {…  
if (a = yes) {…  
if (a == “yes”) {…  
if (a.length = 3) {…

Nothing works…  
Maybe I’m too tired and… confused!  
Please, put me back on the track.

I thank you in advance.

Best regards from Old Gerry
