Xml and such like

H

HardySpicer

I have an application which uses limited vocab speech recognition
(SAPI5). It gets the phrases from an XML file which I can easily add
to manually. The program then has a case statement which then
effectively goes through each command seeing if it was the one
selected by the recognition engine. That bit is fine.

However, at present to add a new command I must manually edit the Xml
file and add another case statement to my main form - then re-compile.
I wish to do this as an end-user would do bye a pop-up settings window
and enter the new command from the program whilst running. This would
also mean the program changing its case statement. What is the best
approach to this? I could use one If then statement and read the Xml
file I suppose element by element I suppose.
Any ideas?

Thanks

H.
 
P

Phill W.

HardySpicer said:
However, at present to add a new command I must manually edit the Xml
file and add another case statement to my main form - then re-compile.

Which is fine for you. You can recompile the code; your users certainly
won't be able to.
I wish to do this as an end-user would do bye a pop-up settings window
and enter the new command from the program whilst running. This would
also mean the program changing its case statement.

What do each of these "commands" actually do?
Is it something that can be parametrised with values in the Xml
[settings] file?
Does it require you to write a whole new block of code for each "command"?
What is the best approach to this?

It sounds to me like you're looking at a "plug-in" model, where the Xml
file defines the "commands" that can be used and, possibly, the settings
that they require. Then, depending on the complexity of what you're
doing, you either have a means for your program to read those settings
from the file and do whatever it needs to or, in the more complicated
case, call out to an external, "plug-in" dll to do the work.

HTH,
Phill W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top