Thread from string

Hello All,

Is there a way to instantiate a thread from a string value. I’m retrieving this value from an xml file, this value represents the code to run in order to generate a document. Each document code is a thread with all it’s methods and other stuff.

Thanks for your input.

What language is the document code?

Don’t understand your question Greg. The document is irrelevant, instantiating a thread from a string value is.

All code is Xojo version 2016 release 3.

Ok, if what you want to do is crate a thread and in that thread load the document and parse it, then yes, that is possible,

If what you are saying is that the files contain Xojo code and that you need to run that code to generate the documents, en the answer is maybe.

Greg,

My application will be running a service in a windows environment.
I have a timer and a couple of classes (Defined as thread). In the event handler of the timer, a value is read from an xml file, this value is the name of my thread class that I need to execute. Is there a way to do this?

Sure. You define what’s called a bridge method.

[code]dim th as thread
Select case Name
Case “myThread”
Th = new MyThread
Case “MyOtherThread”
Th = new MyOtherThread
End Select

Th.Run[/code]

Thanks Greg,

I’ll get on with this. Your help is appreciated.