Results 1 to 2 of 2

Thread: VB6 - ScriptData, Another Script Control Example

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    VB6 - ScriptData, Another Script Control Example

    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.
    Attached Images Attached Images   
    Attached Files Attached Files
    Last edited by dilettante; May 17th, 2012 at 03:45 PM. Reason: Reposted corrected Zip archive. Title was wrong in Data Entry mode (see the screenshot)

  2. #2

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 - ScriptData, Another Script Control Example

    Another example of how the custom validation might be used is changing name fields to "proper case" as part of the validation process.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width