VBScriptBar Add-In 
Version 2.0

Overview
----------------------------
The VBScriptBar add-in ties Microsoft's ScriptControl to Visual Basic IDE. It can handle a lot of VB programming tasks: inserting line numbers, error handlers, indentation, extracting data for automatic documentation, forcing naming conventions for variables and controls are just few examples. There are really no limits what you can do with scripts!

For making scripting even easier, more detailed source code model is presented as in VB IDE. Custom classes - VBMember, VBCodeLine and VBToken - support procedure -, line - and token level source processing. 
Example scripts, included in download package, will give a good start for common tasks. Scripts are stored as VBScript code (text) in *.vbs files. 

VBScriptBar 2.0 utilizes VBIDE as script editor. When entering edit mode ("Edit" button pressed), a temporary module is inserted into active VB project and scripts are pasted in.  One can edit, add or delete scripts in this temporary module as usual VB code. Pressing the "Compile" button, visible only in edit mode, checks active script for syntax errors. When editing is finished ("Edit Done" button pressed), scripts are loaded into script engine and the temporary module deleted. For each valid script a button on VBSB toolbar will appear.

There are simple rules for run-time arguments passed to scripts:
- If a script has exactly one argument, VBScriptBar passes a VBMember object in it. Depending on selected target option, the script is executed for selected member, for each member in active module or for each member in each module in active project. All VBMember methods can be used for source code modifications
- If a script has two arguments, VBScriptBar passes active VBIDE.CodeModule in first and cursor line number in second argument. In this case, for example, CodeModule methods can be used for deleting or inserting lines under cursor position
- In case of any other number of arguments, nothing is passed in arguments. Usable objects are VBIDE itself, as object "IDE" and VBScriptBar as VBIDE.AddIn class object "Addin". 

Custom classes
--------------
- VBMember is a wrapper for IDE Member class with some fundamental differences. First, for property procedures, a VBMember contains only one kind or procedure at time i.e. Let,Get or Set, exposed in VBMember.ProcKind property (in IDE there is one Member per property). For second, VBMember collects its source into array of VBCodeLine objects, while in IDE code lines can be accesses only as strings  in CodeModule level. Comment lines in procedures header are put in separate collection, accessible as VBMember.CommentLines collection object. So the procedure will always start with VBMember.Line(1).
- VBCodeLine represents a logical code line,  i.e. statements continued with underscores (_) on multiple lines in IDE CodeModule are packed into single VBCodeLine. VBCodeLine divides source line into line number, indentation, actual statement text and comments, so that scripts do not have do this parsing again when modifying a part of interest in line.
- VBToken represents a keyword, identifier, number, string or special character ( "+","-","/"... "(",")",",",":") in VBCodeLine object statement text. The collection of tokens is retrieved by VBCodeLine.GetTokens method. Tokens are useful for example for writing scripts that replace embedded strings with module constants or stringtable resources, or numerical values  with module level constants, output  source code to html format etc.


Shareware registration
--------------------------
The "About registration..." dialog will pop up in unregistered copies of the add-in every time before a script is started. Please follow registration details on the dialog. The registration key is generated per PC basis i.e. by user supplied MSWindows serial number or numbers and stored in registry under current user settings. Each interested user should enter the same key on a PC. 
The registration is provided by www.shareit.com, product number 136504, registration fee $19.00. After registration in ShareIt site, please request a key by sending an e-mail (can be started from "About..." dialog) with your Windows serial number.


Installation instructions
--------------------------
1.Unzip the VBSB.zip to a (new) directory
2.Run AddInIns.exe from the unzipping directory


End User License Agreement
--------------------------

THE VBSCRIPTBAR ADD-IN ("SOFTWARE") MAKES MODIFICATIONS TO SOURCE CODE DIRECTLY. 
ORIGINAL SOURCE MAY BE LOST IN CASE OF UNEXPECTED BEHAVIOR OF SCRIPTS 
OR THE SOFTWARE. IT IS RECOMMENDED TO BACK UP THE SOURCE CODE BEFORE 
EXECUTING SCRIPTS ON IT.
SCRIPTS MAY REPLACE LINE NUMBERS IN PROCEDURES. "GOTO" STATEMENTS TO 
LINE NUMBERS WILL BE INVALID AFTER REPLACING LINE NUMBERS. 

THIS SOFTWARE AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" 
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, 
WITHOUT LIMITATION, THE IMPLIED WARRANTIES OR MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT.THE ENTIRE 
RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE 
REMAINS WITH YOU.

LIMITATION OF LIABILITY. IN NO EVENT SHALL THE AUTHOR BE LIABLE TO YOU 
FOR ANY CONSEQUENTIAL, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OF ANY 
KIND ARISING OUT OF THE DELIVERY, PERFORMANCE, OR USE OF THE SOFTWARE. 
IN ANY EVENT, AUTHOR'S LIABILITY FOR ANY CLAIM WILL NOT EXCEED THE LICENSE 
FEE PAID BY YOU. 


All comments and suggestions are welcome by e-mail to karel.rimm@solo.ee

Best Regards,
Karel Rimm
