凡是脚本中使用的类,控件,方法,函数都要先行注册以后,脚本才能识别这些对象。

本人使用的是scripter studio pro 1.2,发现官方只提供了DELPHI本身所提供的控件的脚本支持文件。那么脚本中需要使用第三方的控件怎么办?幸好TMS提供了方便的专用工具:import tool for Scripter Studio,在TMS的官方网站提供下载。

The import tool for Scripter Studio parses Delphi source code files (.Pas) and generate a new .pas import file that register all (with some restrictions) classes, procedures, functions, variables and constants present in the parsed file.

根据DELPHI原文件生成一个新的目标文件,目标文件里面注册了原文件的类,方法。

import tool for Scripter Studio的使用方法:

-          Open import tool

-          Select menu option “File | New project” (Ctrl + N). Import tool will open project options dialog

-          In project options dialog, select the Delphi version you are using (marked as “Import files must be compatible with”), and click the button “reset directories to match Delphi version selected above”. Close project dialog.

-          Select tab “Delphi files to parse”, and choose the files to be parsed. Use “Pick file” button to add a single file or “Pick dir” button to add a full directory. Always use “Add” button to add the selected file/directory to the list. You can add to the list as many files/directories you want.

-          Select menu option “Project | Parse Delphi files “ (Ctrl+F9) to parse files. This might take some minutes.

-          After files are parsed, the tab “Import files to generated” is automatically displayed with a list of parsed files. Select menu option “Project | Generate import files” (F9) to generate import files.

扩展名为SPU文件的说明:

After parsing a .PAS file, import tool creates a SPU file with all information found in the parsed file. The SPU file is created in order to avoid a reparse of the file, which might be slow. Once a file is parsed and the SPU file is generated, import tool only needs the SPU file to generate the import file. Thus, SPU files are generated from a .pas file parse, but import files are generated directly from SPU files.

spu文件是经过解析而生成的文件,避免重复解析原代码文件。

To generate a import file, import tool parses a file, then parses the units used by that file, and so on, until the top-most files, like Windows, System and SysUtils. Thus, in order to have the import file generated correctly, import tool needs to find all .PAS files used by the parsed unit, and the files used by those files, and so on. If import tool does not find the PAS file, it can use the SPU file that corresponds to the PAS file.

已经解析过的,可以直接使用SPU文件来生成目标文件。

常见问题:

Q: Does import tool import *everything* declared in a unit?

A: No. Import tool does not support some types, like pointers, interfaces, class of, and so on. In the restrictions tab, after choosing a unit, you can see items marked as “not supported”.

不支持一些类型,像指针,接口,类的类。

Q: After parsing files I receive the message “Some files were not parsed”. What to do?

A: Import tool cannot parse 100% of Delphi source code files. If there are some files not parsed, you should check at what line and column the error occurred (in the “Import files to generate” tab), and try to change source code to be correctly parsed. Otherwise the file will not be imported.

不能百分百地解析DELPHI原代码文件。

Q: When compiling generated import file I receive the error “Incompatible types: Variant and XXXXX”. What do do?

A: Some generated files may raise compile errors. First, check if you informed search path correctly in project options, so that import tool can find ALL Pas files and/or SPU files needed. If it does not work, then restrict the item that raises the error in the Restrictions tab, so that the next time you generate the import file the item will be not included in the pas files and not raise the compile error.

Q: I added DBTables library, but cannot use TDatabase.Open method, TTable.FieldByName, or even TQuery.Create. What happened?

A: Import tool imports only the methods and properties declared in the unit. It cannot import something that is declared in ancestor. For example, in this case, Open and FieldByName methods are declared in DB unit (TCustomConnection.Open and TDatase.FieldByName), and Create method is declared in Classes (TComponent.Create). Thus, to use those methods you also need to add libraries DB and Classes.

Q: Where import-all file is generated?

A: It is generated in output directory defined in project options. Its name is ap_ImportPROJECTNAME, where PROJECTNAME is the name of your project file (without .sip extension)

import tool for Scripter Studio相关推荐

  1. android studio 快速删除无用的import包

    今天,简单讲讲如何使用  android studio 快速删除无用的import包. 在开发过程中,随着项目的迭代,文件内部分import 可能早已经不用了,对于这种无用的 import,我们不 ...

  2. 8.8 Sencha Studio 监视工具( Inspect Tool)

    文章目录 Inspect Tool(监视工具) Inspect Tool使用实例 Inspect Tool(监视工具) Inspect Tool是Sencha Studio中的一个功能,这个工具可以帮 ...

  3. [转]Getting Start With Node.JS Tools For Visual Studio

    本文转自:http://www.c-sharpcorner.com/UploadFile/g_arora/getting-started-with-node-js-tools-for-visual-s ...

  4. android studio visual studio 2015,Visual Studio Emulator for Android

    Visual Studio Emulator for Android 11/15/2016 4 分钟可看完 本文内容 Note This article applies to Visual Studi ...

  5. 增强我们的Visual Studio(更新中)

    芭蕉的一篇文章<玩转Visual Studio ---Editor篇>让我想起了跟一个同事的争论. 这位同事是用Java的,最近的一个.NET项目中,他来帮我们做.所以他也开始使用VS20 ...

  6. core部署iis的 调试net_远程调试远程 IIS 计算机上的 ASP.NET Core - Visual Studio | Microsoft Docs...

    在 Visual Studio 中远程调试远程 IIS 计算机上的 ASP.NET CoreRemote Debug ASP.NET Core on a Remote IIS Computer in ...

  7. android项目模块导入eclipse编译报错,android中studio导入eclipse项目报错怎么办

    android中studio导入eclipse项目报错怎么办 发布时间:2020-07-15 17:34:45 来源:亿速云 阅读:96 作者:清晨 这篇文章将为大家详细讲解有关android中stu ...

  8. eclipse项目迁移到android studio(图文最新版)

    最近Android studio(下文简称AS)官方发布了正式版,目前火得不行.个人认为主要是因为android是google自家的产品,AS也是他自己搞的IDE,以后的趋势android开发肯定会用 ...

  9. 在Azure Data Studio中探索SandDance可视化扩展

    Azure Data Studio is an open-source, cross-platform and lightweight data management tool. We can use ...

  10. Android Studio和Kotlin入门

    Welcome to the series of tutorials on Android Development with Kotlin. This series is designed with ...

最新文章

  1. java sqlhelper_java版sqlhelper(转)
  2. python之路 mysql 博客园_教为学:Python学习之路(二):MySQLdb的几种安装方式,以及用Python测试连接MySql...
  3. oracle创建数据库 表空间 用户
  4. 【Linux系统编程】 文件描述符的复制:dup()和dup2()
  5. JAVA复习5(集合——集合的遍历 Iteratorforeach、Enumeration——HashMap、HashTable、LinkedHashMap——map的遍历)
  6. VMware开启NAT模式/仅主机模式后主机ping不通虚拟机的问题
  7. [蓝桥杯2016初赛]平方怪圈-数论,模拟
  8. firefox是什么浏览器_Selenium Firefox驱动程序:使用Firefox浏览器自动进行测试
  9. java6虚拟机_Java 虚拟机之六:javap工具
  10. 21 CO配置-控制-产品成本控制-成本对象控制-检查制造订单 (PP) 的成本核算变式
  11. S5PV210 Uboot开发与移植03:Uboot启动流程详解
  12. Unity 接入安卓 支付宝支付SDK遇到ALI38173问题
  13. 力拼5G,台湾拟释放出更多频谱
  14. 智能交通助力城市道路行车提速15%
  15. Caffe ImageNet例程翻译
  16. Anylogic学习--------选项列表
  17. 对比阿里云服务器和腾讯云服务器两者的不同之处
  18. JavaWeb整合萤石云(一),VUE和小程序也适用
  19. Oracle 轻量级实时监控工具 oratop
  20. 路何去何从-第三方Oracle服务商

热门文章

  1. python3-基础8
  2. 电梯控制项目设计报告-第十周
  3. Android事件模型之interceptTouchEvnet ,onTouchEvent关系正解
  4. JAVA笔记整理(五),JAVA中的继承
  5. std::string与output-operator的兼容问题
  6. ZOJ 3430 Detect the Virus(AC自动机 + 模拟)题解
  7. 内容超过7行显示查看全文
  8. Android属性动画
  9. java的迭代器详解
  10. R语言ETL工程系列:检索(select)