A demonstration of the Microsoft Script Control used in Visual Basic 6.0.
This demo allows you to create, edit, save, and load a script written in VBScript that defines a record's layout and field validation for data entry. In Data Entry ("Run") mode the defined fields are used to create a scrolling data entry user interface that applies the validation during entry.
Purpose of the Demo
Why another example? The intent here is to show how the Script Control can be useful in allowing users to apply scripting to extend a hard-coded application. One aspect of these scripts is fairly simplistic: defining some data entry fields and associated validation criteria.
However I wanted to show more exciting things you can do too, like: define Classes and instances of them in your script that can be used by the vb6 host application!
Building the Project
There are no special requirements or build instructions for ScriptData.
You can just open the .VBP file in VB6 and Make to compile or just try it by running it within the IDE.
There is a readme.txt that covers details like the object model used in ScriptData scripts.
Sample Scripts
In addition to the rough template there is a simple sample.vbs file included that you can Load and try.
There is also a fancier version (sample-fancy.vbs) that makes a REST Web Service call to validate the Zip Code and fill in the City and State when they're returned.


Reply With Quote
