I am writing my own scripting language and need to handle value types somehow.

I need to define a variable values in my script like in the snippet below

```
#Var #Name="Alpha" #Class="Float" #Value=1.0
#Var #Name="Beta" #Class="Int" #Value=1
#Var #Name="Delta" #Class="Vector2" #Value=(1.0,2.0)
#Var #Name="Echo" #Class="String" #Value="abcdefgh"

```

As you can see, each #Var has a #Class defining what **type** of value to expect.

The problem is i don't know how to approach it 'easily' so that i can manage the values later on in a simple manner:

```
float fAlpha = GetVar("Alpha")->GetValue();
fAlpha = 150.0f;
GetVar("Alpha")->SetValue(fAlpha);

```

...

```
CVector2 vDelta = GetVar("Delta")->GetValue();
vDelta=CVector2(10.0,20.0);
GetVar("Delta")->SetValue(vDelta)

```

I can check for #Var #Class all over the time, but i am looking for something more clear/OO.

```
if(GetVar("Alpha")->GetClass() == "Float")
{
float fAlpha = GetVar("Alpha")->GetValue();
}

```

Can somebody shed a bit of light on how do you approach this ?

Thanks.