TMS Scripter
Documentation
August 2020
Copyright (c) 2020 by tmssoftware.com bvba
http://www.tmssoftware.com
E-mail: info@tmssoftware.com
TMS Scripter Documentation
(c) 2020 TMS Software I
Table of Contents
Chapter I Introduction 1
................................................................................................................. 21 Overview
................................................................................................................. 32 Copyright Notice
................................................................................................................. 33 What's New
................................................................................................................. 134 Former Scripter Studio History
................................................................................................................. 225 Former Scripter Studio Pro History
................................................................................................................. 276 Rebuilding Packages
................................................................................................................. 287 Getting Support
................................................................................................................. 288 Breaking Changes
.......................................................................................................................................................... 29Version 6.5 - Package Restructuration
.......................................................................................................................................................... 34Version 6.5 - TScrMemo replaces TAdvMemo
.......................................................................................................................................................... 35Version 6.0 - Breaking Changes
................................................................................................................. 359 Use in Firemonkey applications
Chapter II Integrated Development
Environment
37
................................................................................................................. 381 Specific IDE components
.......................................................................................................................................................... 38Basic concepts
.......................................................................................................................................................... 38Component overview
.......................................................................................................................................................... 39The TIDEScripter component
................................................................................................................. 392 Running the IDE: TIDEDialog component
................................................................................................................. 403 Overview of the IDE
.......................................................................................................................................................... 40Managing projects and files
.......................................................................................................................................................... 41Editing the script in code editor
.......................................................................................................................................................... 42Designing forms
.......................................................................................................................................................... 43Running and debugging scripts
.......................................................................................................................................................... 44Library Brow ser
................................................................................................................. 454 Code Insight features
.......................................................................................................................................................... 45Code Completion
.......................................................................................................................................................... 47Parameter Hints
................................................................................................................. 495 Building your own IDE
.......................................................................................................................................................... 49IDE Components available
.......................................................................................................................................................... 50The TIDEEngine component
.......................................................................................................................................................... 51Basic steps to build a custom IDE
.......................................................................................................................................................... 52Using ready-to-use inspector and palette forms
.......................................................................................................................................................... 52Using ready-to-use actions
................................................................................................................. 536 Using TIDEEngine component programatically
.......................................................................................................................................................... 53Creating a new project
.......................................................................................................................................................... 53Adding/removing units (scripts and forms) to the project
.......................................................................................................................................................... 54Executing a project programatically
.......................................................................................................................................................... 55Managing units and changing its properties
.......................................................................................................................................................... 55Setting the active unit in the IDE
.......................................................................................................................................................... 55Running and debugging a project
TMS Scripter Documentation
(c) 2020 TMS Software II
.......................................................................................................................................................... 56Methods for end-user interaction - open, save dialogs, etc.
................................................................................................................. 587 Registering components in the IDE
.......................................................................................................................................................... 59Retrieving existing registered components
.......................................................................................................................................................... 59Registering/Unregistering standard tabs
.......................................................................................................................................................... 60Register new components
................................................................................................................. 618 Storing units in a database (alternative to files)
.......................................................................................................................................................... 61Replacing save/load operations
.......................................................................................................................................................... 64Replacing open/save dialogs
.......................................................................................................................................................... 66Checking if a file name is valid
Chapter III Language Features 68
................................................................................................................. 691 Pascal syntax
.......................................................................................................................................................... 69Overview
.......................................................................................................................................................... 69Script structure
.......................................................................................................................................................... 70Identifiers
.......................................................................................................................................................... 70Assign statements
.......................................................................................................................................................... 70Character strings
.......................................................................................................................................................... 71Comments
.......................................................................................................................................................... 71Variables
.......................................................................................................................................................... 72Indexes
.......................................................................................................................................................... 72Arrays
.......................................................................................................................................................... 73If statements
.......................................................................................................................................................... 73while statements
.......................................................................................................................................................... 74repeat statements
.......................................................................................................................................................... 74for statements
.......................................................................................................................................................... 74case statements
.......................................................................................................................................................... 75function and procedure declaration
................................................................................................................. 762 Basic syntax
.......................................................................................................................................................... 76Overview
.......................................................................................................................................................... 76Script structure
.......................................................................................................................................................... 77Identifiers
.......................................................................................................................................................... 77Assign statements
.......................................................................................................................................................... 77New statement
.......................................................................................................................................................... 77Character strings
.......................................................................................................................................................... 78Comments
.......................................................................................................................................................... 78Variables
.......................................................................................................................................................... 79Indexes
.......................................................................................................................................................... 79Arrays
.......................................................................................................................................................... 79If statements
.......................................................................................................................................................... 80while statements
.......................................................................................................................................................... 80loop statements
.......................................................................................................................................................... 81for statements
.......................................................................................................................................................... 81select case statements
.......................................................................................................................................................... 82function and sub declaration
................................................................................................................. 833 Calling dll functions
.......................................................................................................................................................... 83Overview
.......................................................................................................................................................... 83Pascal syntax
.......................................................................................................................................................... 84Basic syntax
.......................................................................................................................................................... 84Supported types
Chapter IV Working with scripter 86
TMS Scripter Documentation
(c) 2020 TMS Software III
................................................................................................................. 871 Getting started
................................................................................................................. 872 Cross-language feature: TatScripter and TIDEScripter
................................................................................................................. 883 Common tasks
.......................................................................................................................................................... 88Calling a subroutine in script
.......................................................................................................................................................... 89Returning a value from script
.......................................................................................................................................................... 90Passing parameters to script
................................................................................................................. 914 Accessing Delphi objects
.......................................................................................................................................................... 91Registering Delphi components
.......................................................................................................................................................... 91Access to published properties
.......................................................................................................................................................... 92Class registering structure
.......................................................................................................................................................... 92Calling methods
.......................................................................................................................................................... 93More method calling examples
.......................................................................................................................................................... 94Acessing non-published properties
.......................................................................................................................................................... 95Registering indexed properties
.......................................................................................................................................................... 97Retrieving name of called method or property
.......................................................................................................................................................... 97Registering methods with default parameters
.......................................................................................................................................................... 98Delphi 2010 and up - Registering using new RTTI
......................................................................................................................................................... 98Registering a class in scripter
......................................................................................................................................................... 99Registering a record in scripter
......................................................................................................................................................... 100What is not supported
................................................................................................................. 1005 Acessing Delphi functions, variables and constants
.......................................................................................................................................................... 100Overview
.......................................................................................................................................................... 101Registering global constants
.......................................................................................................................................................... 101Acessing global variables
.......................................................................................................................................................... 103Calling regular functions and procedures
................................................................................................................. 1046 Script-based libraries
................................................................................................................. 1067 Declaring forms in script
................................................................................................................. 1088 Declaring classes in script
................................................................................................................. 1109 Using the Refactor
................................................................................................................. 11210 Using libraries
.......................................................................................................................................................... 112Overview
.......................................................................................................................................................... 112Delphi-based libraries
.......................................................................................................................................................... 115The TatSystemLibrary library
.......................................................................................................................................................... 117Removing functions from the System library
.......................................................................................................................................................... 117The TatVBScriptLibrary library
................................................................................................................. 11911 Debugging scripts
.......................................................................................................................................................... 119Overview
.......................................................................................................................................................... 119Using methods and properties for debugging
.......................................................................................................................................................... 120Using debug components
................................................................................................................. 12112 Form-aware scripters - TatPascalFormScripter and TatBasicFormScripter
................................................................................................................. 12113 C++ Builder issues
.......................................................................................................................................................... 121Overview
.......................................................................................................................................................... 121Registering a class method for an object
Chapter V The syntax highlighting memo 123
................................................................................................................. 1241 Using the memo
TMS Scripter Documentation
(c) 2020 TMS Software IV
Chapter VI C++Builder Examples 126
................................................................................................................. 1271 Integrated Development Environment
.......................................................................................................................................................... 127Using TIDEEngine component programatically
......................................................................................................................................................... 127Adding/removing units (scripts and forms) to the project
......................................................................................................................................................... 127Executing a project programatically
......................................................................................................................................................... 128Managing units and changing its properties
......................................................................................................................................................... 128Setting the active unit in the IDE
......................................................................................................................................................... 128Running and debugging a project
.......................................................................................................................................................... 129Registering components in the IDE
......................................................................................................................................................... 129Retrieving existing registered components
......................................................................................................................................................... 129Registering/Unregistering standard tabs
......................................................................................................................................................... 129Register new components
.......................................................................................................................................................... 130Storing units in a database (alternative to files)
......................................................................................................................................................... 130Replacing save/load operations
......................................................................................................................................................... 132Replacing open/save dialogs
......................................................................................................................................................... 134Checking if a file name is valid
................................................................................................................. 1352 Working with scripter
.......................................................................................................................................................... 135Getting started
.......................................................................................................................................................... 135Cross-language feature: TatScripter and TIDEScripter
.......................................................................................................................................................... 135Common tasks
......................................................................................................................................................... 135Calling a subroutine in script
......................................................................................................................................................... 135Returning a value from script
......................................................................................................................................................... 135Passing parameters to script
.......................................................................................................................................................... 136Accessing Delphi objects
......................................................................................................................................................... 136Registering Delphi components
......................................................................................................................................................... 136Calling methods
......................................................................................................................................................... 136More method calling examples
......................................................................................................................................................... 137Acessing non-published properties
......................................................................................................................................................... 137Registering indexed properties
......................................................................................................................................................... 138Retrieving name of called method or property
......................................................................................................................................................... 138Registering methods w ith default parameters
.......................................................................................................................................................... 139Acessing Delphi functions, variables and constants
......................................................................................................................................................... 139Registering global constants
......................................................................................................................................................... 139Acessing global variables
......................................................................................................................................................... 140Calling regular functions and procedures
.......................................................................................................................................................... 140Using libraries
......................................................................................................................................................... 140Delphi-based libraries
......................................................................................................................................................... 142Removing functions from the System library