Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application that I have been writing in VB.net for a while now - it creates animation. I want to allow users to create there own effects, filters, and other processes by writing scripts that will access and change the variables in the running program. I do not want to create my own script intepreter and would rather use VBScript.

Is this possible and if so what is the best method. I have been looking at COM iterop, but so far everything I have read has been over my head.
Posted
Updated 25-Mar-10 6:11am
v2

1 solution

There are a couple of ways to approach this.

One way would be to use a visual interface. Present the user with a set of radio buttons, checkboxes and/or drop-downs. When the "Do it" button is pressed, you can then parse the selections to apply filters etc. You can code an option to serialize the selections into an XML file, which allows the user to save settings. When the user reloads the file, it would set the values of the interface; the user can then make further tweaks or simply run it.

The advantage to this method is that you can change the interface in latter versions of your app while remaining backwards compatable to older XML files. Because you would need to build error-checking and validation anyway, you can allow advanced users to modify the files directly.

Another way to do this would be to create a custom scripting language. It doesn't need to be terribly complex, just stick to a simple verb-predicate syntax like APPLY FILTER BLUR(20) or FADE RGB(0,0,0). Maybe I'm just old, but back in the day we used to write text-based computer games that used that kind of structure, it's pretty easy.

I don't think VBScript would be well suited to what you want: you want to give your users an easy, small and reasonably intuitive set of tools.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900