I too need to convert an int to a string. I will also need to convert the other way, i.e. a string to an int. After looking in the forum I have tried this:
void RecipeNumber_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
Globals.Tags.RecipeName.Value = Convert.ToString(Globals.Tags.RecipeNumber.Value);
}
I get a compilation error saying it is an ambguity between Convert.ToString(uint) and Convert.ToString(System.DateTime)
If I try this:
Globals.Tags.RecipeName.Value = System.Convert.ToString(5);
a "5" is displayed neatly on the Ix.
What am I doing wrong?
Covert int to string
Re: Covert int to string
Try
To String:
Globals.Tags.RecipeName.Value = Globals.Tags.RecipeNumber.Value.ToString();
To Int
Globals.Tags.MyIntTag.Value = Convert.ToInt32("123");
To String:
Globals.Tags.RecipeName.Value = Globals.Tags.RecipeNumber.Value.ToString();
To Int
Globals.Tags.MyIntTag.Value = Convert.ToInt32("123");
Re: Covert int to string
Hi Edmund,
Tanks for the quick reply.
I managed to get it to work by using private variables, see screen dump.
But I will try your proposal too.
Thanks
Goran
Tanks for the quick reply.
I managed to get it to work by using private variables, see screen dump.
But I will try your proposal too.
Thanks
Goran
- Attachments
-
- Namnlös.jpg (189.21 KiB) Viewed 7862 times
Re: Covert int to string
Great Göran
The iX tag class also includes convert/cast functions (if possible), see image below
The iX tag class also includes convert/cast functions (if possible), see image below