![]() The syntax of calling a subroutine or function in a script is: VBScript allows two kinds of procedures subroutines and functions - a function returns a value only. Variable Initialization Sub Example Dim X Dim s ' x set to 0 x = 0 ' s set to empty s = "" End Sub The local variables inside a procedure are automatically initialized. Since scripts are typeless, variables are not initialized with their types. If variables are defined inside a routine, then these local variables are not accessible outside these routines. If the variables are defined outside any subroutines and functions, they are global and can be accessed by any unit in the same project. Since all scripts have local and global variables, it is important to have unique variable names in your scripts within a script project. VBScript variables are case insensitive - that is, variables in upper and lower case have the same meaning:Įxample The variables b and B are the same. This section covers the basic concepts of writing VBScripts in Altium Designer. The VBScripts can use script forms, script units, functions and objects from the Altium Designer scripting API, and a subset of functions and objects from the Embarcadero Delphi RTL that are exposed in the scripting system. \VBScripts folder in the downloadable example scripts collection for Altium Designer. The simple examples included in this reference illustrate the basic features of VBScript programming in Altium Designer.įor more VBScript examples see the. Scripts (script units and script forms) consist of functions/procedures that can be called within Altium Designer. It is possible to attach scripts to different projects, and it's highly recommended to organize scripts into different projects to manage the number of scripts and their procedures / functions. A script form is a graphical window (dialog) that hosts different controls that run on top of Altium Designer. Files can be either script units or script forms - each form has a VBScript script file with *.vbs extension and a corresponding form with a *.dfm extension). Each VBScript project consists of files with a *.vbs extension. Scripts are organized into projects with a *.PRJSCR extension. A script can be executed from a menu item, toolbar button or from the Run Script dialog from the system menu. Refer to the Server Process Reference for more information on server processes and parameters.Ī VBScript project is organized to store script documents (script units and script forms). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |