Page 1 of 1

Load recipe

Posted: Tue Jan 29, 2013 2:35 am
by smolenak
Hello,

I'm trying to get recipes loaded with

Globals.Tags.Recipes.LoadRecipe(stringTag);

I have list box where all recipenames are, and by choosing recipe it is assigned to stringTag. But how can I use stringTag to load recipe? It does not accept to use the string type tag..?

I hope fast reply - Thanks!

Re: Load recipe

Posted: Tue Jan 29, 2013 3:35 am
by Edmund
Hi smolenak,

It´s easy, just call the "recipe-handler" you want to load the recipe in and call the function LoadRecipe.

In iX there is a demo project called Sample_Recipe, add a button to the Recipe screen (Button1) and add this into the click event.

Code: Select all

void Button1_Click(System.Object sender, System.EventArgs e)
{
	Globals.Recipe1.LoadRecipe("Full Speed");
}
And you will see that it will load the recipe with the name "Full Speed".

If you are usring a iX-tag instead of the hardcoded example above, make sure it´s being cast as a String (if it´s set to default in the taglist), Globals.Tags.Tag_Recipe.Value.ToString()

Best Regards

Edmund