TR0125 VB Script Reference
- 格式:pdf
- 大小:153.79 KB
- 文档页数:17
VB 可用指令、函数索引表1、Abs求绝对值●适用于VB、VBA、VBScript。
●用法:传回值= Abs(数值)○VB与VBA:Private Sub Command1_Click()Dim HerVal As IntegerHerVal = 345MyVal = Abs(HerVal)End Sub●MyVal的值为345。
Private Sub Command1_Click()Text1.Text = "5679"MyVal = Abs(Val(Text1.Text))End Sub●MyVal的值为5679Private Sub Command1_Click()MyVal = Abs(12345)Debug.Print Abs(-12345)End Sub●于Debug对话框内打出12345○vbScript:<script language="vbscript">Dim MyValMyVal = InputBox("请输入数值")document.write Abs(MyVal)</script>2、ActiveControl得到焦点的对象●适用于VB。
●用法:变量= 对象.ActiveControl.属性●用法:对象.ActiveControl.属性= 资料○VB:Private Sub Command1_Click()MsgBox End SubPrivate Sub Command1_Click()MsgBox Screen.ActiveControl.Left & ":" &Screen.ActiveControl.TopEnd SubPrivate Sub Command1_Click()Me.ActiveControl.Caption = "我得到焦点" End SubPrivate Sub Timer1_TimerMe.Caption = "Focus:" &End Sub3、ActiveForm得到焦点的表单●如果你的程序是以MDI的方式为诉求,AvtiveForm 这个方法将提功你更多的便利。
VB默认选项代码简介在Visual Basic(VB)编程语言中,可通过设置默认选项代码来控制编译器的行为。
默认选项代码可以影响编译产生的代码的行为和性能。
本文将探讨如何使用VB默认选项代码,并介绍一些常用的选项及其影响。
使用方法在VB代码文件的开头,可以使用Option语句来设置默认选项代码。
默认选项代码的语法如下:Option [语言版本] [选项代码]其中,语言版本是可选的,用于指定所使用的VB语言版本。
若省略该参数,则使用当前编译器的默认版本。
选项代码用于指定要设置的选项。
常用选项Explicit该选项用于强制声明变量和参数的数据类型。
当使用Explicit选项时,必须使用Dim语句显式声明所有变量和参数的数据类型,否则编译器将报错。
使用示例:Option ExplicitDim age As Integerage = 10此选项有助于提高代码的可读性和维护性,并减少隐式类型转换可能带来的错误。
Strict该选项用于禁止隐式类型转换,要求所有类型转换都必须明确指定。
当使用Strict 选项时,编译器会在可能导致数据丢失的类型转换上给出编译错误。
使用示例:Option StrictDim num1 As IntegerDim num2 As Doublenum1 = 10num2 = num1 ' 编译错误,需要明确指定类型转换num2 = CDbl(num1) ' 正确的类型转换此选项有助于提高代码的类型安全性,并减少类型转换带来的错误。
Compare该选项用于指定字符串比较的规则。
默认情况下,VB使用二进制比较来判断字符串是否相等。
但在某些情况下,可能需要根据语言设置或忽略大小写来比较字符串。
使用示例:Option Compare TextDim str1 As StringDim str2 As Stringstr1 = "apple"str2 = "APPLE"If str1 = str2 ThenConsole.WriteLine("字符串相等")ElseConsole.WriteLine("字符串不相等")End If使用Option Compare Text可以忽略字符串的大小写进行比较,得到的结果为“字符串相等”。
VBScript错误代码及对应解释大全VBScript 运行时错误如果 VBScript 脚本执行系统无法实施的操作,则会产生 VBScript 运行时错误。
只有在运行脚本、为变量表达式赋值或分配内存时,才会产生 VBScript 运行时错误。
错误编号描述429 ActiveX 部件无法创建对象507 发生异常449 参数不可选17 无法执行请求的操作430 类不支持自动化506 类未被定义11 被零除48 加载 DLL 错误5020 在正则表达式中需要’)’5019 在正则表达式中需要’]’432 在自动化操作中未找到文件名或类名92 For 循环未初始化5008 非法赋值51 内部错误505 无效的或不合格的引用481 无效图片5 无效过程调用或参数5021 字符集越界94 非法使用 Null448 未找到命名参数447 对象不支持当前的区域设置445 对象不支持此操作438 对象不支持该属性或方法451 对象不是一个集合504 对象不能安全创建503 对象不能安全初始化502 脚本对象不安全424 需要对象91 未设置对象变量7 内存不足28 堆栈溢出14 字符串空间溢出6 溢出35 未定义 Sub 或 Function9 下标越界5017 正则表达式中的语法错误462 远程服务器不存在或不能访问10 该数组为定长的或临时被锁定13 类型不匹配5018 错误的数量词500 变量未定义458 变量使用了一个 VBScript 中不支持的自动化类型450 错误的参数个数或无效的参数属性值VBScript 语法错误如果 VBScript 语句结构违反了一个或多个 VBScript 脚本语言语法规则,就会产生 VBScript 语法错误。
VBScript 语法错误通常在执行程序前,编译程序时产生。
错误编号描述1052 在类中不能有多个缺省的属性/方法1044 调用 Sub 时不能使用圆括号1053 类初始化或终止不能带参数1058 只能在 Property Get 中指定’Default’1057 说明’Default’必须同时说明’Public’ "1005 需要’(’1006 需要’)’1011 需要’=’1021 需要’Case’1047 需要’Class’1025 需要语句的结束1014 需要’End’1023 需要表达式1015 需要’Function’1010 需要标识符1012 需要’If’1046 需要’In’1026 需要整数常数1049 在属性声明中需要 Let , Set 或 Get1045 需要文字常数1019 需要’Loop’1020 需要’Next’1050 需要’Property’1022 需要’Select’1024 需要语句1016 需要’Sub’1017 需要’Then’1013 需要’To’1018 需要’Wend’1027 需要’While’或’Until’1028 需要’While,’、’Until,’或语句未结束1029 需要’With’1030 标识符太长1014 无效字符1039 无效’exit’语句1040 无效’for’循环控制变量1013 无效数字1037 无效使用关键字’Me’1038 ’loop’没有’do’1048 必须在一个类的内部定义1042 必须为行的第一个语句1041 名称重定义1051 参数数目必须与属性说明一致1001 内存不足1054 Property Let 或 Set 至少应该有一个参数1002 语法错误1055 不需要的’Next’1015 未终止字符串常数。
普通自动翻书装置三维设计与仿真ee(e)指导老师:e[摘要]本文设计内容是普通自动翻书装置的设计与仿真。
设计主要是针对不能用手翻书的残疾人、伤员、乐队指挥等特殊人群。
翻页装置采用曲柄摇杆机构。
利用AutoCAD图解法对人机适应角度进行求解。
最后用Pro/E三维软件建立了包括书架、支撑、翻页装置在内的模型,并对其进行仿真运动,得到了自动翻页杆的翻页轨迹,长度以及高度上的位移;从而验证了所涉及的机构满足运动连续性。
在设计中对仿真轨迹进行不同位置的对比,寻求轨迹最优点。
此次设计的着重突出人机适应,可以实现从多个角度看书的效果。
除此之外,为了减少对书本的损伤,在搓页机构的选用上,选用静电吸附的原理进行页面的提升。
此机构还可以实现对厚度在5-35mm之间的不同厚度的书本的夹紧、固定。
[关键词]自动翻书;曲柄摇杆;Pro/E仿真;轨迹最优;角度调整Ordinary automatic book turner three-dimensional designand simulationee(ee)Tutor:eeAbstract:This paper relates to the design and simulation of ordinary automatic page turning device which aimed at the disabled, conductor and other special populations who can not use hand to turn the page. The page turning device adopts a crank and rocker mechanism. I have used graphical method to find the solution of height through AutoCAD in this design which considered to man-machine angle. Using Pro/E 3D software establish the model of the whole device including the bookshelf, support frame, the page turning device and carries on the simulation movement which can made out the track of the book turner, length and height of displacement. To find out the most advantages of trajectory comprised the different positions on the simulation trajectory in the design. It emphasizes on the human adaptation, so people can read book from several angle. In addition, in order to reduce the damage of books, I choose the electrostatic adsorption to promote the page in rubbing page mechanism. The agency can also realize the clamping and fixed to book whose thickness between 5 to 35 mm.Key Word:Automatic book turner; Crank rocker; Pro / E simulation; Trajectory optimization; Angle adjustment目录1前言 (I)1.1课题研究意义 (1)1.1.1 选题目的 (1)1.1.2、研究意义 (1)1.2国内外技术研究状况 (1)1.2.1研究现状 (1)1.2.2发展趋势 (2)1.2.3应用领域 (2)1.3本课题研究的内容 (2)2 设计方案................................ 错误!未定义书签。
DelphiScript ReferenceSummaryTechnical ReferenceTR0120 (v1.7) July 14, 2008 This reference manual describes the DelphiScript language used by the Scripting Engine in Altium Designer.This reference includes the following topics:•Exploring the DelphiScript Language•DelphiScript Source files•Writing DelphiScript Scripts•Differences between DelphiScript and Object Pascal•Using Altium Designer Run Time Library•DelphiScript Keywords•Expressions and Operators•DelphiScript Functions•Working with Script Forms and Components•DelphiScript Error CodesExploring the DelphiScript LanguageThis DelphiScript reference details each of the statements, functions and extensions that are supported. These are special procedures that are used to control and communicate directly with Altium Designer. It is assumed that you are familiar with basic programming concepts as well as the basic operation of Altium Designer.The scripting system supports the DelphiScript language which is very similar to Borland Delphi (TM). The key difference is that DelphiScript is a typeless or untyped scripting language which means you cannot define records or classes and pass pointers as parameters to functions. You can still declare variables within scripts for readability.This document and the DelphiScript Keyword Reference document contain reference material on interfaces, components, global routines, types, and variables that make up the DelphiScript scripting language.ObjectsAn object consists of methods, and in many cases, properties, and events. Properties represent the data contained in the object. Methods are the actions the object can perform. Events are conditions the object can react to. All objects descend from the top level object of TObject type.Object InterfacesAn object interface consists of methods, and in many cases, properties but cannot have data fields. An interface represents an existing object and each interface has a GUID which marks it unique. Properties represent the data contained in the object that the interface is associated with. Methods are the actions the object (in which the interface is associated with) can perform.ComponentsComponents are visual objects that you can manipulate at design time from the Tool Palette panel. All components descend from the TComponent class in the Borland Delphi Visual Component Library.RoutinesGlobal routines are the procedures and functions from the scripting system. These routines are not part of a class, but can be called either directly or from within class methods on your scripts.Delphi Script ReferenceTypesThe variable types are used as return types and parameter types for interface methods and properties, object's methods, properties and events and for global routines. In many cases, types are documented in the Enumerated Types sections in all API documents.For example, the Client Enumerated Types for the DXP Object Model is detailed in the System Reference documentAltium Designer and Borland Delphi Run Time LibrariesThe Scripting system also supports a subset of Borland Delphi Run Time Library (RTL) and a subset of Altium Designer RTL which is covered in the Altium Designer RTL Guide.You can navigate to the various Altium Designer API documents via Configuring the System » Scripting in AltiumDesigner » Altium Designer RTL Reference from the Knowledge Center panel.DelphiScript Source filesA script project is organized to store script documents (script units and script forms). You can execute the script from a menu item, toolbar button or from the Run Script dialog from the Altium Designer’s system menu.PRJSCR, PAS and DFM filesScripts are organized into projects with a *.PRJSCR extension. Each project consists of files with a *.pas extension. Files can be either script units or script forms (each form has a script file with *.pas extension and a corresponding form with a *.dfm extension). A script form is a graphical window that hosts different controls that run on top of Altium Designer.It is possible to attach scripts to different projects and it is highly recommended to organize scripts into different projects to manage the number of scripts and their procedures / functions.About Example ScriptsThe following examples illustrate the basic features of DelphiScript programming using simple scripts for use in Altium Designer. Example scripts can be found in the Examples folder under your Altium Designer installation. The location and purpose of some of the example scripts are mentioned below:•Examples\Scripts\DelphiScript Scripts\DXP sub folder - Demonstrate Client and system API•Examples\Scripts\DelphiScript Scripts\PCB subfolder - Demonstrate PCB API•Examples\Scripts\DelphiScript Scripts\Processes sub folder - Demonstrate server processes•Examples\Scripts\DelphiScript Scripts\General sub folder- Demonstrate DelphiScript keywords•Examples\Scripts\DelphiScript Scripts\Sch subfolder - Demonstrate Schematic API•Examples\Scripts\DelphiScript Scripts\WSM subfolder - Demonstrate Workspace Manager APIDelphiScript ReferenceWriting DelphiScript ScriptsDelphiScript Naming ConventionsIn general, there are no restrictions to the names you can give to procedures, functions, variables and constants as long as they adhere to the following rules:•The name can contain the letters A to Z, a to z, the underscore character "_" and the digits 0 to 9•The name must begin with a letter•The name cannot be a DelphiScript keyword, directives or reserved word•Names are case insensitive when interpreted. You may use both upper and lower case when naming a function, subroutine, variable or constant, however the interpreter will not distinguish between upper and lower case characters. Names which are identical except for case will be treated as the same name in DelphiScript.In a DelphiScript file, the functions and procedures are declared using the Procedure Begin End or Function Begin End blocks. Both of these statement blocks require a name to be given to the procedure or function. DelphiScript allows you to create named variables and constants to hold values used in the current script.Including Comments in scriptsIn a script, comments are non-executable lines of code which are included for the benefit of the programmer. Comments can be included virtually anywhere in a script. Any text following // or enclosed with (* *) or {} are ignored by DelphiScript.// Comment type example//This whole line is a comment{} Comment type example{This whole line is a comment}(* *) comment type example(*This whole line is a commentThis whole line is a commentThis whole line is a comment*)Comments can also be included on the same line as executed code. For example, everything after the semi colon in the following code line is treated as a comment.ShowMessage (‘Hello World’); //Display MessageLocal and Global VariablesSince all scripts have local and global variables, it is very important to have unique variable names in your scripts within a script project. If the variables are defined outside any procedures and functions, they are global and can be accessed by any script unit in the same project.If variables are defined inside a procedure or function, then these local variables are not accessible outside theseprocedures/functions.Delphi Script ReferenceExample of Local and Global Variables in a Script// The Uses keyword is not needed.// Variables from UnitA script are available to this Script Unit,// as long UnitA is in the same project as this Unit Script Unit.ConstGlobalVariableFromThisUnit='Global Variable from this unit';Procedure TestLocal;varLocal;Begin// we can access a variable from UnitA without the Uses keywordLocal := 'Local Variable';ShowMessage(Local);End;Procedure TestGlobal;Begin//ShowMessage(Local); // produces an error.ShowMessage(GlobalVariableFromThisUnit);ShowMessage(GlobalVariableFromUnitA);End;UnitA scriptConstGlobalVariableFromUnitA = 'Global Variable from Unit A';Using Named Variables in a ScriptIn a script, you use named variables or constants to store values to be used during program execution. All variables in a script are always of Variant type. Typecasting is ignored. Types in variables declaration are ignored and can be skipped, so these declarations are correct:Var a : integer;Var b : integer;Var c, d;Splitting a Line of ScriptEach code statement is terminated with the semi-colon ";" character to indicate the end of the statement. DelphiScript allows you to write a statement on several lines of code, splitting a long instruction on two or more lines. The only restriction in splitting programming statements on different lines is that a string literal may not span several lines.For example:X.AddPoint( 25, 100);X.AddPoint( 0, 75);// is equivalent to:X.AddPoint( 25, 100); X.AddPoint( 0, 75);But‘Hello World!’is not equivalent to‘HelloWorld!’DelphiScript ReferenceDelphiScript does not put any practical limit on the length of a single line of code in a script, however, for the sake of readability and ease of debugging it is good practice to limit the length of code lines so that they can easily be read on screen or in printed form.If a line of code is very long, you can break this line into multiple lines and this code will be treated by the DelphiScript interpreter as if it were written on a single line.Unformatted Code ExampleIf Not (PcbApi_ChooseRectangleByCorners(BoardHandle,'Choose first corner','Choose finalcorner',x1,y1,x2,y2)) Then Exit;Formatted Code ExampleIf Not (PcbApi_ChooseRectangleByCorners(BoardHandle,'Choose first corner','Choose final corner',x1,y1,x2,y2)) Then Exit;Case SensitivityThe DelphiScript language used in writing scripts is not case sensitive, i.e. all keywords, statements, variable names, function and procedure names can be written without regard to using capital or lower case letters. Both upper and lower case characters are considered equivalent. For example, the variable name myVar is equivalent to myvar and MYVAR. DelphiScript treats all of these names as the same variable.The only exception to this is in literal strings, such as the title string of a dialog definition or the value of a string variable, these strings retain case differences.The Space CharacterA space is used to separate keywords in a script statement. However, DelphiScript ignores any additional white spaces in a statement.For example:X = 5is equivalent toX = 5You may use white spaces to make your script more readable.Functions and Procedures in a ScriptThe DelphiScript interpreter allows two kinds of procedures: Procedures and Functions. The only difference between a function and a procedure is that a function returns a value.A script can have at least one procedure which defines the main program code. You can, however, define other procedures and functions that can be called by your code. As with Borland Delphi, procedures and functions are defined within a Begin End statement block. To invoke or call a function or procedure, include the name of the function or procedure in a statement in the same way that you would use the built-in DelphiScript functions and procedures. If the function or procedure requires parameters, then you must include these in the calling statement. Both functions and procedures can be defined to accept parameters, but only functions can be defined to return a value to the calling statement.You may assign any name to functions and procedures that you define, as long as it conforms to the standard DelphiScript naming conventions.Delphi Script ReferenceTypical DelphiScript ProcedureProcedure CreateSchObjects;BeginIf SchServer = Nil Then Exit;SchDoc := SchServer.GetCurrentSchDocument;If SchDoc = Nil Then Exit;PlaceSchematicObjects;SchDoc.GraphicallyInvalidate;End;Typical DelphiScript FunctionFunction BooleanToString(AValue : Boolean) : String;BeginIf (AValue) Then Result := 'True'Else Result := 'False';End;The name of a function can not be used to set its return value. The Result keyword must be used instead.Var Begin End Global BlockVarA, B, C;BeginB := 10;C := 20;A :=B + C;ShowMessage(IntToStr(A));End;DelphiScript ReferenceTips on Writing ScriptsReferencing Scripts in a Script ProjectYou can have code in one script to call a procedure in another script in the same script project.You can also access any global variable in any script within the same project.Local and Global VariablesSince all scripts have local and global variables, it is important to have unique variable names in your scripts within a script project. If the variables are defined outside any procedures and functions, they are global and can be accessed by any unit in the same project.If variables are defined inside a procedure or function, then these local variables are not accessible outside theseprocedures/functions.It is recommended to put scripts of similar nature in a project and to keep the number of scripts in a project at a manageable size. Keeping track of global variables in many scripts becomes an issue. It is not mandatory to store scripts in a script project, you can put scripts in other project types.Unique Identifiers and VariablesWith script forms, ensure that all script forms have unique form names. It is possible to have all script forms named form1 in the same script project. The scripting system gets confused when trying to display which form when a script form is executed. Change the script form name by using the Object Inspector, the name will be changed in the script unit and in the script form files automatically.Parameter-less Procedures and FunctionsDesign your scripts so that the procedures required to be invoked to run the script will only appear in the Select Items to Run dialog. To prevent other procedures/functions from appearing in the Select Items to Run dialog, you can insert a (Dummy : Integer) parameter next to the method name. See the example below.ExampleFunction TSineWaveform.CreateShape(Dummy : Integer) : TShape;Begin// do somethingEnd;{..................................................} {..................................................}Procedure TSineWaveform.bCloseClick(Sender: TObject);varI : integer;Begin// doing somethingClose;End;{..................................................} {..................................................}procedure DrawSine;BeginSineWaveform.showmodal;End;Delphi Script ReferenceDifferences between DelphiScript and Object PascalIn this section, the differences between DelphiScript and Object Pascal of Borland Delphi 32 bit versions will be covered in detail. The scripting system uses untyped DelphiScript language therefore there are no data types in scripts.Although you can declare variables and their types and specify the types for functions/procedures or methods' parameters for readability, DelphiScript converts undeclared variables when a script is being executed.For example, you cannot define records or classes.DelphiScript VariablesAll variables in a script are always of Variant type, Types in variables declaration are ignored and can be skipped, so these declarations are correct:Vara : Integer;Varb : Integer;Varc, d;Types of parameters in procedure/function declaration are ignored and can be skipped. For example, this code is correct:Function Sum(a, b) : Integer;BeginResult := a + b;End;In general, you can use variants to store any data type and perform numerous operations and type conversions. A variant is type-checked and computed at run time. The compiler won't warn you of possible errors in the code, which can be caught only with extensive testing. On the whole, you can consider the code portions that use variants to be interpreted code, because many operations cannot be resolved until run time. This can affect the speed of the code.Now that you are aware of the use of the Variant type, it is time to look at what it can do. Once you have declared a variant variable such as the following and you have the variant value, you can copy it to any compatible-or incompatible-data type:VarV;Begin// you can assign to it values of several different types:V := 10;V := 'Hello, World';V := 45.55;End;If you assign a value to an incompatible data type, DelphiScript interpreter performs a conversion where possible. Otherwise, a run-time error is issued. In fact, a variant stores type information along with the data so DelphiScript is slower than a Borland Delphi compiled code.Sets in DelphiScript ScriptsDelphiScript does not have Set types and does not support Set operators unlike the Object Pascal language which does have Set types and supports Set operators.To use sets in DelphiScript scripts, use the built-in functions which enable you to manipulate sets in a DelphiScript script.Navigate to the Using Sets in DelphiScript section for more information on using sets in DelphiScript scripts.DelphiScript ReferenceFunctions / Procedures inside a Function or ProcedureIt is recommended that you write standalone functions or procedures, (recursive procedures/functions are permitted although). This function snippet is not recommended.Function AFunction BBegin// blahEnd;BeginB;End;Recommended Function StructureFunction BBegin// blahEnd;Function ABeginB;End;Result KeywordUse the Result keyword to set the return value within a function block.ExampleFunction Foo : String;BeginResult := ‘Foo Foo’;End;Nested RoutinesNested routines are supported but you can't use variables of top level function from the nested one.Array ElementsType of array elements is ignored and can be skipped so these declarations are equal:Varx : array [1..2] of double;Varx : array [1..2];You cannot declare array types but you can declare arrays to variablesIllegal exampleTypeTVertices = Array [1..50] Of TLocation;VarNewVertices : TVertices;Legal exampleVarDelphi Script ReferenceNewVertices : Array [1..50] of TLocation;Open Array DeclarationThe Open Array Declaration is not supported.Case KeywordThe case keyword can be used for any type. So you can write:Case UserName of'Alex', 'John' : IsAdministrator := true;'Peter' : IsAdministrator := false;ElseRaise('Unknown user');End;Class DeclarationsYou cannot define new classes, but you can use existing DelphiScript classes and instantiate them. For example TList and TStringList classes can be created and used in your scripts.See alsoTListTStringListCreateObject FunctionThe CreateObject function can be used to create objects that will be implicitly freed when no longer used. So instead of: Procedure Proc;Varl;Beginl := TList.Create;Try// do something with lFinallyL.Free;End;End;you can write:Procedure Proc;Varl;Beginl := CreateObject(TList);// Do something with lEnd;See alsoCreateObject keywordRaise ExceptionsThe Raise keyword can be used without parameters to re-raise the last exception. You can also use Raise with string parameter to raise the exception with the specified message string. The Exception objects are not supported, because the On keyword is not supported.ExampleRaise(Format('Invalid value : %d', [Height]));See alsoTry keywordFinally keywordRaise keywordThreadVarThe Threadvar keyword is treated as Var. Note that in Object Pascal, the variables declared using Threadvar keyword have distinct values in each thread.Set OperatorsThe Set operator In is not supported. You can use InSet to check whether a value is a member of set.For example,If InSet(fsBold, Font.Style) thenShowMessage('Bold');Note, that set operators '+', '-', '*', '<=', '>=' don't work correctly. You have to use the built in functions; MkSet, MkSetRange, SetUnion, SetDifference, SetIntersection, SubSet and InSet.ExampleASet := BSet + CSet; should be changed toASet := SetUnion(BSet, CSet);The [...] set constructors are not supported. You can use the MkSet function to create a set.ExampleFont.Style := MkSet(fsBold, fsItalic);See alsoMkSet keywordMkSetRange keywordInSet keywordSetDifference keywordSetIntersection keywordSetUnion keywordSubSet keywordInSet keywordOperators^ and @ operators are not supported.DirectivesThe following directives are not supported (note that some of them are obsolete and aren't supported by Borland Delphi too): absolute, abstract, assembler, automated, cdecl, contains, default, dispid, dynamic, export, external, far, implements, index, message, name, near, nodefault, overload, override, package, pascal, private protected, public, published, read, readonly, register, reintroduce, requires, resident, safecall, stdcall, stored, virtual, write, writeonly.Note, the "in" directive in the Uses clause is ignored.Ignored KeywordsThe interface, implementation, program and unit keywords are ignored in DelphiScript. The scripts can contain them but they have no effect, these keywords can enhance the readability of scripts.Unsupported KeywordsThe following keywords are not supported in DelphiScript:•as, asm, class, dispinterface, exports, finalization, inherited, initialization, inline, interface, is, library, object, out, property, record, resourcestring, set, supports, type.The following Delphi RTL functions aren't supported in DelphiScript:•Abort, Addr, Assert, Dec, FillChar, Finalize, Hi, High, Inc, Initialize, Lo, Low, New, Ptr, SetString, SizeOf, Str, UniqueString, VarArrayRedim, VarArrayRef, VarCast, VarClear,VarCopy.The functions from the Borland Delphi's Windows unit (windows.pas file) are not supported (for example the RGB function is not supported).Using Altium Designer RTL in DelphiScript scriptsYou cannot create your own records or classes types and instantiate them in a script, however you can use certain classes from the Altium Designer Run Time Library (RTL). For example, TStringList and TList classes can be instantiated and used as containers of data storage (usually of the same type) for your scripting needs.The Object Interfaces representing Altium Designer objects are available to use in scripts. For example, you have the ability to update design objects on Schematic and PCB documents through the use of Schematic object interfaces and PCB objects interfaces.Interface names as a convention have an I added in front of the name for example IPCB_Board represents an interface for an existing PCB document. An example of PCB interfaces in use is shown next.PCB Interfaces in a script exampleProcedure ViaCreation;VarBoard : IPCB_Board;Via : IPCB_Via;BeginBoard := PCBServer.GetCurrentPCBBoard;If Board = Nil Then Exit;(* Create a Via object *)Via := PCBServer.PCBObjectFactory(eViaObject, eNoDimension, eCreate_Default);Via.X := MilsToCoord(7500);Via.Y := MilsToCoord(7500);Via.Size := MilsToCoord(50);Via.HoleSize := MilsToCoord(20);Via.LowLayer := eTopLayer;Via.HighLayer := eBottomLayer;(* Put this via in the Board object*)Board.AddPCBObject(Via);End;The following APIs can be used in your Scripts:•Certain Borland Delphi TM functions and classes and DelphiScript extensions• Client API•PCB Server API•Schematic Server API•Work Space Manager Server API• Nexus API•Altium Designer RTL functions• Parametric processesExamine the scripts in the \Examples\Scripts\ folder of your installation to see Altium Designer Object Interfaces and functions, Borland Delphi objects and functions being used in scripts.Refer to Getting Started with Scripting and Building Script Projects tutorials.Refer to the Using the Altium Designer RTL guide for details on how to use design objects and their interfaces in yourscripts.You can navigate to the various Altium Designer API documents via Configuring the System » Scripting in AltiumDesigner » Altium Designer RTL Reference from the Knowledge Center panel.The scripting system supports the DelphiScript language. The DelphiScript keywords reference is covered in a different document.Consult the DelphiScript Keyword Reference document for more information on keywords.Expressions and OperatorsAn expression is a valid combination of constants, variables, literal values, operators and function results. Expressions are used to determine the value to assign to a variable, to compute the parameter of a function or to test for a condition. Expressions can include function calls.DelphiScript has a number of logical, arithmetic, Boolean and relational operators. These operators are grouped by the order of precedence, which is different to the precedence orders used by Basic, C etc. For example, the AND and OR operators have precedence compared to the relational one.If you write a<b and c<d, the DelphiScript will do the AND operation first, resulting in an error. To fix this problem, you have to enclose each of the < expression in parentheses: (a<b) and (c<d);These operators listed below are the operators supported by DelphiScript.Operators Grouped by PrecedenceUnary operators have the highest precedenceNot Boolean or bitwise NOT.Multiplicative and Bitwise Operatorsmultiplication.* Arithmetic/ Floating point division.division.div Integermod modulus (reminder of integer division).and Boolean or bitwise AND.shl Bitwise left shift.shr Bitwise right shift.Additive Operators+ Arithmeticaddition, string concatenation.subtraction.- Arithmeticor Boolean or bitwise ORxor Boolean or bitwise EXCLUSIVE OR.Relational and Comparison Operators (lowest precedence)= Test whether equal or not.<> Test whether not equal or not.< Test whether less than or not.> Test whether greater than or not.<= Test whether less than or equal to or not.>= Test whether greater than or equal to or not.NoteThe ^ and @ operators are not supported by DelphiScript.Some of the statements used by the DelphiScript language are covered here. A range of functions are covered in the FileIO routines, Math Routines, String Routines and Extension routines. In this DelphiScript Functions Section:•Calculating Expressions with the Evaluate Function•Passing Parameters to Functions and Procedures•Exiting from a Procedure•File IO Routines•Math Routines•String Routines•Extension Routines•Using Sets in DelphiScript•Using Exception HandlersCalculating Expressions with the Evaluate FunctionThe built in function, Evaluate interprets a string containing a valid mathematical expression during runtime and a result is returned. For example, you can write a script such as Evaluate(ProcNames[ProcIndex]); and the procedure specified in ProcNames[ProcIndex] will be called.To calculate such an expression you can use Evaluate method where expression is specified by Expr parameter. For example, you can calculate expressions like the following:Evaluate(‘2+5’);Evaluate(‘((10+15)-5)/2*5’);Evaluate(‘sin(3.1415926/2)*10’);Evaluate(‘2.5*log(3)’);Passing Parameters to Functions and ProceduresBoth functions and procedures defined in a script can be declared to accept parameters. Additionally, functions are defined to return a value. Types of parameters in procedure/function declaration are ignored and can be skipped. For example, this code is correct:Function sum(a, b) : integer;BeginResult := a + b;End;Exiting from a ProcedureDelphiScript provides Exit and Break statements should you want to exit from a procedure before the procedure would terminate naturally. For example; if the value of a parameter is not suitable, you might want to issue a warning to the user and exit, as example below shows.Procedure DisplayName (s);BeginIf s = ‘’ ThenBeginShowMessage(‘Please enter a name’);Exit;End;ShowMessage(S + ‘ is shown’);End;File IO RoutinesDelphiScript has the following IO routines:。
VB Script转换函数返回与字符串的第一个字母对应的ANSI字符代码。
Asc(string)string参数是任意有效的字符串表达式。
如果string参数未包含字符,则将发生运行时错误。
说明下面例子中,Asc返回每一个字符串首字母的ANSI字符代码:Dim MyNumber MyNumber=Asc("A")'返回65。
MyNumber=Asc("a")'返回97。
MyNumber=Asc("Apple")'返回65。
注意AscB函数和包含字节数据的字符串一起使用。
AscB不是返回第一个字符的字符代码,而是返回首字节。
AscW是为使用Unicode字符的32位平台提供的。
它返回Unicode(宽型)字符代码,因此可以避免从ANSI到Unicode的代码转换。
CBool函数返回表达式,此表达式已转换为Boolean子类型的Variant。
CBool(expression)expression是任意有效的表达式。
说明如果expression是零,则返回False;否则返回True。
如果expression不能解释为数值,则将发生运行时错误。
下面的示例使用CBool函数将一个表达式转变成Boolean类型。
如果表达式所计算的值非零,则CBool函数返回True;否则返回False。
Dim A,B,Check A=5:B=5'初始化变量。
Check=CBool(A=B)'复选框设为True。
A=0'定义变量。
Check=CBool(A)'复选框设为False。
CByte函数返回表达式,此表达式已被转换为Byte子类型的Variant。
CByte(expression)expression参数是任意有效的表达式。
说明通常,可以使用子类型转换函数书写代码,以显示某些操作的结果应被表示为特定的数据类型,而不是默认类型。
reference参数用法摘要:一、引言二、reference参数的定义与作用1.概述2.用法详解3.参数值的选择与调整三、reference参数在实际编程中的应用1.案例一:简单示例2.案例二:复杂场景四、reference参数的优缺点1.优点2.缺点五、总结与展望正文:一、引言在编程领域,尤其是动态编程和面向对象编程中,reference参数的身影无处不在。
本文将详细介绍reference参数的定义、作用、用法以及实际编程中的应用,并对其优缺点进行总结,以期帮助读者更好地理解和运用reference参数。
二、reference parameter的定义与作用1.概述在编程语言中,reference指的是引用,即一个变量对另一个变量的引用。
reference参数是一种将现有变量作为参数传递的方法,它在函数或方法内部起到间接访问原始变量的作用。
2.用法详解(1)声明reference参数在声明reference参数时,需要在变量类型后添加一个冒号,如下所示:```c++void swap(int x, int &y) {// ...}```(2)传递reference参数在调用含有reference参数的函数或方法时,可以直接将变量名作为参数传递,如:```c++swap(a, b);```3.参数值的选择与调整reference参数的值在函数内部不可修改,但可以进行读取。
在选择reference参数时,应注意以下几点:- 尽量选择不经常修改的变量作为reference参数,以降低程序的风险。
- 避免在函数内部对reference参数进行不必要的操作,以免引入不必要的复杂性。
三、reference parameter在实际编程中的应用1.案例一:简单示例```c++void print_array(const int arr[], int size) {for (int i = 0; i < size; i++) {std::cout << arr[i] << " ";}std::cout << std::endl;}int main() {int arr[] = {1, 2, 3, 4, 5};print_array(arr, 5);return 0;}```2.案例二:复杂场景```c++#include <vector>void merge(std::vector<int> &vec1, std::vector<int> &vec2) { vec1.insert(vec1.end(), vec2.begin(), vec2.end());}int main() {std::vector<int> vec1 = {1, 2, 3};std::vector<int> vec2 = {4, 5, 6};merge(vec1, vec2);for (int i = 0; i < vec1.size(); i++) {std::cout << vec1[i] << " ";}std::cout << std::endl;return 0;}```四、reference parameter的优缺点1.优点- 节省内存,无需复制传递的变量。
reference is invalid for this partrst"Reference is invalid for this part rst" 这句话的意思是 "对于这部分 rst,参考无效"。
这可能是在某个特定的上下文中,涉及到对 "rst"(可能是某种文档格式或特定部分的引用)的引用出现了问题。
以下是一个可能超过 400 字的解释:当遇到 "reference is invalid" 的情况时,可能意味着引用的内容不存在、已被删除、链接错误或其他原因导致无法正确访问或使用。
这可能会对相关的文档、项目或工作产生影响。
例如,在学术写作中,如果引用的文献无效,可能会影响论文的可信度和准确性。
在编程中,如果引用了一个无效的函数或变量,可能会导致程序出错或无法正常运行。
要解决这个问题,可以采取以下步骤:1. 检查引用的准确性:确保引用的内容是正确的,包括文件路径、链接、文档名称等。
2. 确认引用的来源:验证引用的来源是否可靠,是否存在更新或变动。
3. 寻找替代引用:如果原始引用无效,可以尝试寻找其他可靠的来源或替代的引用。
4. 更新或修复引用:如果可能,修复或更新无效的引用,以确保其准确性和有效性。
5. 检查文档或项目的其他部分:有时候,问题可能不仅仅局限于一个部分,可能需要检查整个文档或项目中其他相关部分的引用。
6. 与相关人员沟通:如果遇到困难或不确定如何解决,可以与同事、导师或技术支持人员交流,寻求他们的帮助和建议。
总之,"reference is invalid for this part rst" 提示我们要关注引用的正确性和有效性,及时解决问题,以确保相关工作的顺利进行。
在处理引用时,要仔细检查和验证,保持准确性和一致性。
Microsoft_VBScript_运行时错误代码大全注释Microsoft VBScript 运行时错误代码大全注释1.Microsoft VBScript语法错误(0x800A03E9)-->内存不足2.Microsoft VBScript语法错误(0x800A03EA)-->语法错误3.Microsoft VBScript语法错误(0x800A03EB)-->缺少 ':'4.Microsoft VBScript语法错误(0x800A03ED)-->缺少 '('5.Microsoft VBScript语法错误(0x800A03EE)-->缺少 ')'6.Microsoft VBScript语法错误(0x800A03EF)-->缺少 ']'7.Microsoft VBScript语法错误(0x800A03F2)-->缺少标识符8.Microsoft VBScript语法错误(0x800A03F3)-->缺少 '='9.Microsoft VBScript语法错误(0x800A03F4)-->缺少 'If'10.Microsoft VBScript语法错误(0x800A03F5)-->缺少 'To'11.Microsoft VBScript语法错误(0x800A03F6)-->缺少 'End'12.Microsoft VBScript语法错误(0x800A03F7)-->缺少 'Functi on'13.Microsoft VBScript语法错误(0x800A03F8)-->缺少 'Sub'14.Microsoft VBScript语法错误(0x800A03F9)-->缺少 'Then'15.Microsoft VBScript语法错误(0x800A03FA)-->缺少 'Wend'16.Microsoft VBScript语法错误(0x800A03FB)-->缺少 'Loop'17.Microsoft VBScript语法错误(0x800A03FC)-->缺少 'Next'18.Microsoft VBScript语法错误(0x800A03FD)-->缺少 'Case' '20.Microsoft VBScript语法错误(0x800A03FF)-->缺少表达式21.Microsoft VBScript语法错误(0x800A0400)-->缺少语句22.Microsoft VBScript语法错误(0x800A0401)-->语句未结束23.Microsoft VBScript语法错误(0x800A0402)-->缺少整型常数24.Microsoft VBScript语法错误(0x800A0403)-->缺少 'While' 或 'Until'25.Microsoft VBScript语法错误(0x800A0404)-->缺少 'While','Until' 或语句未结束26.Microsoft VBScript语法错误(0x800A0405)-->缺少 'With'27.Microsoft VBScript语法错误(0x800A0406)-->标识符过长28.Microsoft VBScript语法错误(0x800A0407)-->无效数字29.Microsoft VBScript语法错误(0x800A0408)-->无效字符30.Microsoft VBScript语法错误(0x800A0409)-->未结束的字符串常量31.Microsoft VBScript语法错误(0x800A040A)-->注释未结束32.Microsoft VBScript语法错误(0x800A040D)-->无效使用 'Me' 关键字33.Microsoft VBScript语法错误(0x800A040E)-->'loop' 语句缺少 'do'' 语句35.Microsoft VBScript语法错误(0x800A0410)-->循环控制变量'for' 无效36.Microsoft VBScript语法错误(0x800A0411)-->名称重定义37.Microsoft VBScript语法错误(0x800A0412)-->必须是行中的第一个语句38.Microsoft VBScript语法错误(0x800A0413)-->不能为non-ByVal 参数赋值39.Microsoft VBScript语法错误(0x800A0414)-->调用子程序时不能使用括号40.Microsoft VBScript语法错误(0x800A0415)-->缺少文字常数41.Microsoft VBScript语法错误(0x800A0416)-->缺少 'In'42.Microsoft VBScript语法错误(0x800A0417)-->缺少 'Class'43.Microsoft VBScript语法错误(0x800A0418)-->必须在一个类的内部定义44.Microsoft VBScript语法错误(0x800A0419)-->在属性声明中缺少 Let , Set 或 Get45.Microsoft VBScript语法错误(0x800A041A)-->缺少 'Proper ty'46.Microsoft VBScript语法错误(0x800A041B)-->在所有属性的规范中,变量的数目必须一致47.Microsoft VBScript语法错误(0x800A041C)-->在一个类中不允许有多个缺省的属性/方法48.Microsoft VBScript语法错误(0x800A041D)-->类的初始化或终止程序没有参数49.Microsoft VBScript语法错误(0x800A041E)-->属性的 set 或 let 必须至少有一个参数50.Microsoft VBScript语法错误(0x800A041F)-->错误的 'Next '51.Microsoft VBScript语法错误(0x800A0420)-->'Default' 只能在 'Property' , 'Function' 或 'Sub' 中指定52.Microsoft VBScript语法错误(0x800A0421)-->指定 'Defaul t' 时必须同时指定 'Public' ")53.Microsoft VBScript语法错误(0x800A0422)-->只能在 Prope rty Get 中指定 'Default'54.Microsoft VBScript 运行时错误(0x800A0005)-->无效的过程调用或参数55.Microsoft VBScript 运行时错误(0x800A0006)-->溢出56.Microsoft VBScript 运行时错误(0x800A0007)-->内存不足57.Microsoft VBScript 运行时错误(0x800A0009)-->下标越界定长的或临时被锁定59.Microsoft VBScript 运行时错误(0x800A000B)-->被零除60.Microsoft VBScript 运行时错误(0x800A000D)-->类型不匹配61.Microsoft VBScript 运行时错误(0x800A000E)-->字符串空间不够62.Microsoft VBScript 运行时错误(0x800A0011)-->不能执行所需的操作63.Microsoft VBScript 运行时错误(0x800A001C)-->堆栈溢出64.Microsoft VBScript 运行时错误(0x800A0023)-->未定义过程或函数65.Microsoft VBScript 运行时错误(0x800A0030)-->加载 DLL 时出错66.Microsoft VBScript 运行时错误(0x800A0033)-->内部错误67.Microsoft VBScript 运行时错误(0x800A0034)-->错误的文件名或号码68.Microsoft VBScript 运行时错误(0x800A0035)-->文件未找到69.Microsoft VBScript 运行时错误(0x800A0036)-->错误的文件模式打开71.Microsoft VBScript 运行时错误(0x800A0039)-->设备 I/O 错误72.Microsoft VBScript 运行时错误(0x800A003A)-->文件已存在73.Microsoft VBScript 运行时错误(0x800A003D)-->磁盘已满74.Microsoft VBScript 运行时错误(0x800A003E)-->输入超出了文件尾75.Microsoft VBScript 运行时错误(0x800A0043)-->文件过多76.Microsoft VBScript 运行时错误(0x800A0044)-->设备不可用77.Microsoft VBScript 运行时错误(0x800A0046)-->没有权限78.Microsoft VBScript 运行时错误(0x800A0047)-->磁盘没有准备好79.Microsoft VBScript 运行时错误(0x800A004A)-->重命名时不能带有其他驱动器符号80.Microsoft VBScript 运行时错误(0x800A004B)-->路径/文件访问错误81.Microsoft VBScript 运行时错误(0x800A004C)-->路径未找到未设置83.Microsoft VBScript 运行时错误(0x800A005C)-->For 循环未初始化84.Microsoft VBScript 运行时错误(0x800A005E)-->无效使用Null85.Microsoft VBScript 运行时错误(0x800A0142)-->不能创建所需的临时文件86.Microsoft VBScript 运行时错误(0x800A01A8)-->缺少对象87.Microsoft VBScript 运行时错误(0x800A01AD)-->ActiveX部件不能创建对象88.Microsoft VBScript 运行时错误(0x800A01AE)-->类不能支持 Automation 操作89.Microsoft VBScript 运行时错误(0x800A01B0)-->Automation 操作中文件名或类名未找到90.Microsoft VBScript 运行时错误(0x800A01B6)-->对象不支持此属性或方法91.Microsoft VBScript 运行时错误(0x800A01B8)-->Automation 操作错误92.Microsoft VBScript 运行时错误(0x800A01BD)-->对象不支持此操作持已命名参数94.Microsoft VBScript 运行时错误(0x800A01BF)-->对象不支持当前区域设置95.Microsoft VBScript 运行时错误(0x800A01C0)-->未找到已命名参数96.Microsoft VBScript 运行时错误(0x800A01C1)-->参数是必选项97.Microsoft VBScript 运行时错误(0x800A01C2)-->错误的参数个数或无效的参数属性值98.Microsoft VBScript 运行时错误(0x800A01C3)-->对象不是一个集合99.Microsoft VBScript 运行时错误(0x800A01C5)-->未找到指定的 DLL 函数100.Microsoft VBScript 运行时错误(0x800A01C7)-->代码资源锁定错误101.Microsoft VBScript 运行时错误(0x800A01CA)-->变量使用了一个 VBScript 中不支持的 Automation 类型102.Microsoft VBScript 运行时错误(0x800A01CE)-->远程服务器不存在或不可用103.Microsoft VBScript 运行时错误(0x800A01E1)-->无效图片104.Microsoft VBScript 运行时错误(0x800A01F4)-->变量未定义105.Microsoft VBScript 运行时错误(0x800A01F5)-->非法赋值106.Microsoft VBScript 运行时错误(0x800A01F6)-->对象不能安全地使用 Script 编程107.Microsoft VBScript 运行时错误(0x800A01F7)-->对象不能安全初始化108.Microsoft VBScript 运行时错误(0x800A01F8)-->对象不能安全创建109.Microsoft VBScript 运行时错误(0x800A01F9)-->无效的或无资格的引用110.Microsoft VBScript 运行时错误(0x800A01FA)-->类没有被定义111.Microsoft VBScript 运行时错误(0x800A01FB)-->出现一个意外错误112.Microsoft VBScript 运行时错误(0x800A1398)-->缺少常规表达式对象113.Microsoft VBScript 运行时错误(0x800A1399)-->常规表达式语法错误114.Microsoft VBScript 运行时错误(0x800A139A)-->错误的数量词115.Microsoft VBScript 运行时错误(0x800A139B)-->常规表达式中缺少 ']'116.Microsoft VBScript 运行时错误(0x800A139C)-->常规表达式中缺少 ')'117.Microsoft VBScript 运行时错误(0x800A139D)-->字符集越界118.Microsoft VBScript 运行时错误(0x800A802B)-->未找到元素119.ActiveServerPages,ASP0126(0x80004005)-->找不到包含文件120.Microsoft OLEDBProviderforODBCDrivers(0x80040E14)-->sql语句出错(字段名错误,或数据类型不匹配)121.Microsoft OLEDBProviderforODBCDrivers(0x80040E07)-->sql语句出错(要插入或更新的字段的类型与变量数据类型不匹配) 122.Microsoft OLEDBProviderforODBCDrivers(0x80040E57)-->sql语句出错(要插入或更新的数据溢出)123.Microsoft OLEDBProviderforODBCDrivers(0x80040E10)-->sql语句出错(update字段名或要更新的数据类型错误) 124.Microsoft OLEDBProviderforODBCDrivers(0x80004005)-->sql语句出错(要插入或更新的字段的数值不能为空值)125.Microsoft OLEDBProviderforODBCDrivers(0x80004005)-->打开数据库出错,没有在指定目录发现数据库126.Microsoft OLEDBProviderforODBCDrivers(0x80040E37)-->没有发现表127.ODBCDrivers(0x80040E21)-->sql语句出错(数据类型不匹配或表/字段错误或处于编辑状态,或不存在于conn打开的数据库中) 128.ADODB.Recordset(0x800A0BB9)-->sql语句出错(sql语句或conn语句未定义或对一个rs属性进行赋值时发生错误) 129.ADODB.Recordset(0x800A0CC1)-->rs对像出错(rs对像本身不存在或错误地引用了一个不存在的字段名)130.ADODB.Recordset(0x800A0BCD)-->rs对像出错(记录集中没有记录却对记录集进行操作)131.ADODB.Recordset(0x800A0E78)-->rs对像出错(记录集不存在,缺少rs.open语句)132.ADODB.Recordset(0x800A0CC1)-->rs对像出错(引用了一个不存在的字段名)133.ADODB.Recordset(0x800A0E7D)-->conn定义错误134.ADODB.Recordset(0x800A0CB3)-->数据库以只读方式打开,无法更新数据135.ADODB.Recordset(0x800A000D)-->错误引用rs变量(rs对像已关闭或未定义)136.---------------------------------------137.大部分的ADO的错误码对应的含义138.除了在 Error 对象和 Errors 集合中说明的提供者错误之外,ADO 本身也将错误返回到139.运行时环境的异常处理机制之中。
postscript language reference -回复PostScript Language Reference: A Step-by-Step GuideIntroduction to PostScript Language:PostScript is a programming language primarily used for document printing and typesetting. It is a page description language that can describe both text and graphics for output devices, such as printers and displays. In this article, we will explore the various aspects of the PostScript language, including its syntax, data types, operators, and control structures.1. Syntax:The syntax of PostScript is based on the Reverse Polish Notation (RPN), where operators appear after their operands. For example, to add two numbers, the syntax is: "2 3 add". Multiple operands can be written in a space-separated manner.2. Data Types:PostScript supports various data types, including numbers, strings, booleans, arrays, dictionaries, and procedures. Numbers can be either integers or real numbers. Strings are enclosed within parentheses, and characters within are represented by their ASCIIvalues. Booleans can be either true or false.3. Operators:PostScript provides a wide range of operators to manipulate data. Arithmetic operators (addition, subtraction, multiplication, division) work with numbers. Logical operators (and, or, not) work with booleans. String operators (concatenation, length, substring) work with strings. Stack manipulation operators (dup, exch, pop) manipulate the operand stack.4. Control Structures:PostScript allows the use of control structures to control program flow. The if-else construct allows condition-based execution of code blocks. The for loop provides a way to iterate over a range of values. The while loop repeatedly executes a block of code as long as a specified condition is true. The repeat loop executes a block of code a specified number of times.5. Graphics Operations:PostScript excels in describing graphics for output devices. It provides a wide range of drawing operators to create lines, shapes, and curves. The moveto operator sets the current point, and thelineto operator draws a line from the current point to a specified coordinate. Fill and stroke operators control the filling and stroke style of graphics objects.6. Procedures:Procedures are blocks of code that can be defined and executed later. They are created using the { } syntax. Procedures can take arguments and return values. Using procedures helps organize and modularize code, making it easier to read and maintain.7. Built-in Functions:PostScript provides a set of built-in functions that perform specific tasks. These functions help with mathematical calculations, string manipulation, file operations, and more. Examples include sin, cos, sqrt, readline, and file.8. PostScript and Printers:One of the primary uses of PostScript is in printers, especially laser printers. PostScript files can be sent directly to printers, which interpret and render the page description commands to produce high-quality printed output. PostScript's scalability anddevice-independence make it a standard in the printing industry.Conclusion:PostScript is a powerful and versatile programming language used for printing, typesetting, and graphics. Its unique syntax and data types, along with a wide range of operators and control structures, make it an ideal language for describing complex documents and graphics. Whether you are a printer manufacturer, a graphic designer, or a programmer working with printers, a good understanding of PostScript can be valuable for optimizing print output and troubleshooting issues.。
script error的解决方法嘿,朋友们!咱今儿就来唠唠“script error”这个让人头疼的玩意儿到底咋解决!你说这“script error”就像个调皮捣蛋的小鬼,时不时就蹦出来捣乱。
就好比你正开开心心地在网上冲浪呢,突然页面就卡住了,弹出个“script error”,那心情,一下子就从云端跌到谷底了。
遇到这种情况,咱先别慌。
就跟咱走路遇到个小坑一样,得稳稳地跨过去。
首先呢,咱可以试试刷新页面。
这就好比给电脑来个小小的“重启”,说不定那捣蛋的小鬼就被吓跑了呢。
有时候啊,一些小毛病就是这么轻松解决的。
要是刷新了还不行,那咱就得动点真格的了。
检查一下浏览器是不是该更新啦!你想想啊,浏览器就像咱的鞋子,走久了也会磨破,得换换才能更好走路不是?把浏览器更新到最新版本,说不定就能把那些小毛病都给解决咯。
还有啊,看看是不是有些插件在捣乱呢。
插件这东西,就像你口袋里的小零碎,有时候多了也会互相磕碰。
把那些不常用的、可能有问题的插件给卸了,给电脑减减负,让它跑得更轻松。
要是这都还不行,那可就得好好检查检查你的网络啦。
网络就好比是路,路要是不通畅,那车子咋能跑得快呢?看看是不是网络信号不好呀,或者路由器该重启啦。
再不行的话,咱就得想想是不是电脑本身出问题啦。
就像人会生病一样,电脑也会有不舒服的时候呀。
这时候,可能就得找专业人士来帮忙看看啦。
哎呀,解决“script error”虽然有时候挺麻烦,但咱可不能被它难住呀!咱得像个勇敢的战士,一步步去攻克它。
你想想,要是每次遇到“script error”都束手无策,那多影响咱上网的心情和效率呀!咱得把它给治得服服帖帖的,让咱的网络世界畅通无阻!反正啊,遇到“script error”别着急上火,按照我说的这些方法一步步来,总能找到解决的办法。
咱可不能让这么个小毛病影响了咱享受网络的乐趣呀!加油吧,朋友们!让我们一起和“script error”说拜拜!。
VB Script ReferenceSummaryTechnical ReferenceTR0125 (v1.6) February 27, 2008This reference manual describes the VB Script language used in Altium Designer.This reference covers the following topics:•Exploring the VB Script Language•VB Script source files•About VB Script examples•Using Altium Designer RTL in VBScript Scripts•Writing VB Script scripts•VB Script keywords, statements and functions•Using Components in Script FormsExploring the VB Script LanguageThis Reference details each of the VisualBasic Scripting statements, functions and extensions that are supported in the scripting system. The Visual Basic Scripting or VB Script for short can deal with Altium Designer Object Models and Visual Components. It is assumed that you are familiar with basic programming concepts and the basic operation of your Altium Designer-based software.The scripting system supports the VB Script language (along with other scripting languages) which is derived from the Microsoft ActiveX Scripting system, for instance you should be able to use CScripts or WScripts which are based on the same ActiveX scripting engine that Altium Designer uses.All scripting languages supported in Altium Designer are typeless or untyped, meaning you cannot define records or classes and pass pointers as parameters to functions.VB Script script exampleSub DisplayName (sName)MsgBox "My Name is " & sNameEnd SubFor detailed information on VB Script and its keywords, operators and statements, please refer to Microsoft Developers Network website, /en-us/library/d1wf56tt(VS.71).aspx.Altium Designer and Borland Delphi Run Time LibrariesThe Scripting system supports a subset of Borland Delphi Run Time Library (RTL) and a subset of Altium Designer RTL.There are several Object Models in Altium Designer; such as the PCB Object Model which you can use to deal with PCB objects on a PCB document, and the WorkSpaceManager Object Model, which allows you to work with Projects and their documents and extract netlist data for example.Navigate to the Scripting resources via Configuring the System » Scripting in Altium Designer from the Knowledge Center panel.The Scripting Online Reference Help contains information on interfaces with respect to Altium Designer Object Models, components, global routines, types, and variables that make up this scripting language. You can consult the Visual Basic documentation by Microsoft for more information on VB Script functions.VB Script ReferenceServer ProcessesA script can execute server processes (which represent commands in Altium Designer). The server processes and parameters are covered in the Server Process Reference document.VB Script Source Files. A script project is organized to store script documents (script units and script forms). You can execute the script from a menu item, toolbar button or from the Run Script dialog from the DXP menu.PRJSCR, VBS and DFM filesScripts are organized into projects with a *.PRJSCR file extension. Each VB Script project consists of files with a *.vbs extension. Files can be either script units or script forms. Note that a script form has a VB Script file with *.vbs extension and a corresponding script form with a *.dfm extension). A script form is a graphical window that hosts different controls that run on top of Altium Designer.Scripts including script units and script forms, consist of functions/procedures that you can call within Altium Designer.It is possible to attach scripts to different projects and it is highly recommended to organize scripts into different projects to manage the number of scripts and their procedures / functions.About VB Script ExamplesThe examples that follow illustrate the basic features of VB Script programming in Altium Designer. The VB Scripts can use script forms, script units, functions and objects from the Altium Designer Run Time Library and a subset of functions and objects from the Borland Delphi that is exposed in the scripting system.The example scripts are organized into the \Examples\Scripts\VB Scripts\ folder.VB Script ReferenceWriting VB Script ScriptsIn this section:•VB Script Naming Conventions•Local and Global Variables•Subroutines and Functions•Splitting a Line of Script.VB Script naming ConventionsVB Script variables are case insensitive, that is, variables in upper and lower case have the same meaning:ExampleThe variables b and B are the same.b = 60B = 60Local and Global VariablesSince all scripts have local and global variables, it is important to have unique variable names in your scripts within a script project. If the variables are defined outside any subroutines and functions, they are global and can be accessed by any unit in the same project.If variables are defined inside a routine, then these local variables are not accessible outside these routines. Since scripts are typeless, you do not initialize variables with their types.Variable InitializationThe local variables inside a procedure are automatically initialized.Sub ExampleDim XDim s' x set to 0x = 0' s set to emptys = “”End SubSubroutines and FunctionsVB Script allows two kinds of procedures; subroutines and functions. A function returns a value only. The syntax of calling a subroutine or a function in a script is as follows:Call SubRoutineA(parameters)orSubRoutine parametersSubroutine ExampleSub SetTheHeight AHeightSet Component.Height = AHeightEnd SubFunction ExampleFunction Addone(value)AddOne = Value + 1End FunctionVB Script ReferenceAnother Function ExampleFunction Test(s)Test = S + " rules.."End FunctionSub DisplayName (sName)MsgBox sNameEnd SubSub MainDim SS = "Altium Designer"DisplayName Test(s)End SubParameters and ArgumentsThe procedure declaration normally has a list of parameters (remember variables are considered typeless and the scripting system works out automatically what the variable types are). The value used in place of the parameter when you make a procedure call is called an argument.Example of a subroutine with a parameterSub DisplayName (sName)MsgBox "My Name is " & sNameEnd SubExample of calling a subroutineSub MainDisplayName "Altium Designer Rules"End SubNotesThe use of the Call keyword to invoke a subroutine or a function is optional (maintained for backward compatibility). Including Comments in ScriptsIn a script, comments are non-executed lines of code which are included for the benefit of the programmer. Comments can be included virtually anywhere in a script.Any text following ' are ignored by VB Script.Any text following Rem are ignored by VB Script.Example' This whole line is a commentRem this whole line is also a commentDocName = ' Get name of active documentSplitting a Line of ScriptEach code statement is terminated on each line to indicate the end of this statement. VB Script allows you to write a statement on several lines of code, splitting a long instruction on two or more lines using the underscore character (_).VB Script does not put any practical limit on the length of a single line of code in a script, however, for the sake of readability and ease of debugging it is good practice to limit the length of code lines so that they can easily be read on screen or in printed form.If a line of code is very long, you can break this line into multiple lines and this code will be treated by the VB interpreter as if it were written on a single line.VB Script ReferenceUnformatted code exampleIf Not (PcbApi_ChooseRectangleByCorners(BoardHandle,”Choose first corner”,”Choose final corner”,x1,y1,x2,y2)) Then EndIfFormatted code exampleIf Not (PcbApi_ChooseRectangleByCorners(BoardHandle,_“Choose first corner”,_“Choose final corner”,_x1,y1,x2,y2)) Then EndIfVB Script ReferenceUsing Altium Designer Run Time Library and Object Models in VB ScriptsThe biggest feature of the scripting system is that the Object Interfaces of Altium Designer objects are available to use in VB scripts. For example, you can update design objects on Schematic and PCB documents through the use of Schematic Interfaces and PCB interfaces respectively.The Altium Designer Object Interfaces are available for use in any script. Normally in scripts, there is no need to instantiate an interface, you extract the interface representing an existing object and from this interface, extract embedded or aggregate interface objects and from them, you can get or set property values.To access a schematic document and its data objects, you invoke the SchServer function.Example' Checks if the current document is a Schematic documentIf SchServer Is Nothing Then Exit SubSet CurrentSheet = SchServer.GetCurrentSchDocumentIf CurrentSheet Is Nothing Then Exit SubTo have access to a PCB document, you invoke the PCBServer.Creation of a PCB Object Using the PCB Object ModelSub ViaCreationDim BoardDim ViaSet Board = PCBServer.GetCurrentPCBBoardIf Board is Nothing Then Exit Sub' Create a Via objectVia = PCBServer.PCBObjectFactory(eViaObject, eNoDimension, eCreate_Default)Via.X = MilsToCoord(7500)Via.Y = MilsToCoord(7500)Via.Size = MilsToCoord(50)Via.HoleSize = MilsToCoord(20)Via.LowLayer = eTopLayerVia.HighLayer = eBottomLayer' Put this via in the Board objectBoard.AddPCBObject(Via)End SubDifferent Objects, Interfaces Functions in your scriptsObjects, Interfaces Functions in your scripts can be used from the following:• Client API•PCB Server API•Schematic Server API•Work Space Manager Server API• Nexus API•Altium Designer RTL functions• Parametric processes.Refer to Getting Started With Scripting and Building Script Projects tutorials.Refer to the Using the Altium Designer RTL guide for details on how to use design objects and their interfaces in yourscripts.Navigate to the Scripting resources via Configuring the System » Scripting in Altium Designer from the KnowledgeCenter panel.VB Script ReferenceVB Script KeywordsThe scripting system supports the VB Script language which is derived from the Microsoft Active Scripting language technology. This section covers the VB Script keywords.Reserved Words and Functions in VB ScriptA, BAbs, Array, Asc, AtnCCall, Case, CBool, CByte, CCur, CDate, CDbl, Chr, CInt, Class, CLng, Const, Conversions, Cos, CreateObject, CSng, CStrD,EDateAdd, DateDiff, DatePart, DateSerial, DateValue, Day, Derived Math, Dim, Do, Each, Erase, Escape, Empty, Eval, Execute, Exit, ExpF,G, HFalse, Filter, For, FormatCurrency, FormatDateTime, FormatNumber, FormatPercent, Function GetLocale, GetObject, GetRef, Hex, HourI, L, MIf, Is, InputBox, Instr, InStrRev, Int, IsArray, IsDate, IsEmpty, IsNull, IsNumeric, IsObject, Join, LBound, LCase, Left, Len, LoadPicture, Log, LTrim, Maths, Mid, MInute, Month, MonthName, MsgBoxN, ONext, Nothing, Now, Null, Oct, On ErrorP,RPrivate, Property, Public, Randomize, ReDim, Rem, RTrim, Replace, RGB, Right, Rnd, RoundS, TScriptEngine, ScriptEngineBuildVersion, ScriptEngineMajorVersion, ScriptEngineMinorVersion, Second, Select, Set, SetLocale, Sgn, Sin, Space, Split, Sqr, Stop, StrComp, String, StrReverse, Sub, Tan, Then, Time, Timer, Timeserial, TimeValue, Trim, True, TypeNameU, V, W, X, YUCase, Unescape, While, Wend, With, VarType, Weekday, WeekdayName, YearVB Script ReferenceVB Script StatementsIn this section:•Conditional Statements•Expressions and OperatorsConditional StatementsThe main conditional statements supported by the VB Script:•If Then•For Next Loop•Exit For•For Each Next•Do Loop•While WEnd•Select CaseYou have to be careful to code your scripts to avoid infinite loops, ie the conditions will eventually be met.The If.. Then StatementThe syntax is:If Condition ThenElse If AnotherCondition ThenElseEnd IfThe For LoopThe For Next statement repeatedly loops through a block of code. The basic syntax is:For counter = start to end' block of code hereNextThe Exit ForThe Exit For statement exits a For loop prematurely.For counter = start to endif condition then Exit ForNextThe For Each LoopThe For Each loop is a variation on the For loop which is designed to iterate through a collection of objects as well as elements in an array. The basic syntax is:For Each ObjectVar in Collection' block of code hereNextThe Do LoopThe Do Loop has several loop variations.1.Do while until condition' code blockLoop2.VB Script ReferenceDo' code blockLoop while until condition3.Do' code blockLoopThe While WEnd LoopThe While WEnd statement repeatedly loops through a block of code. The basic syntax is;While until condition' code blockWEndThe Select Case StatementYou can use the SELECT statement if you want to select one of many blocks of code to execute:Select case paymentcase "Cash"msgbox "pay cash"case "MasterCard"msgbox "pay by Mastercard"case Elsemsgbox "Unknown payment method"end selectExpressions and OperatorsAn expression is a valid combination of constants, variables, literal values, operators and function results. Expressions are used to determine the value to assign to a variable, to compute the parameter of a function, or to test for a condition. Expressions can include function calls.VB Script has a number of logical, arithmetic, Boolean and relational operators. Since these operators are grouped by the order of precedence which is different to the precedence orders used by Basic, C etc. For example, the AND and OR operators have precedence compared to the relational one.Arithmetic Operators+ Addition- Subtraction* Multiplication/ Division\ Division with integer result^ ExponentiationMod ModuloComparison Operators (lowest precedence)= Test whether equal or not.<> Test whether not equal or not.< Test whether less than or not.VB Script Reference> Test whether greater than or not.<= Test whether less than or equal to or not.>= Test whether greater than or equal to or not.Is Compares two object reference variables.String Operators& ConcatenationLogical OperatorsNOTNot LogicalANDAnd LogicalOr LogicalORXOREqvImp&VB Script Sub Routines and FunctionsIn this section:•Passing parameters to procedures•Dates Times•File IO Routines•Math Routines•String Routines•Server Process Routines.Passing Parameters to Sub Routines and FunctionsWhen you define a function or sub routine in a script that can accept parameters, you can pass variables to the function or sub routine in two ways: by reference or by value.To declare the method that parameters are passed, use the ByRef or ByVal keywords in the parameter list when defining the function or sub routine in a Sub or Function statement. For example, the following code fragment defines a sub routine that accepts two parameters. The first is passed by value and the second by reference:Sub Test (ByVal Param1 As Integer , ByRef B As String)The difference between the two methods is that ByRef passes a reference to the variable passed and allows the sub routine or function to make changes to the actual variables that are passed in as parameters (this is the default method of passing parameters and is used if the method is not explicitly declared).The ByVal passes the value of the variable only. The sub routine or function can use this value, but the original variable passed is not altered.The following examples illustrate the differences between methods. The main procedure is as follows:Sub MainDim X, YX = 45 : Y = "Number"Test X, Y ' Call to a subprocedure called Test.MsgBox XMsgBox YEnd SubThe above procedure includes a call to a subprocedure, Test.If the subroutine is defined as follows:Sub Test (ByRef A, ByRef B)B = B & " = " & A : A = 10*AEnd SubThen the variables X and Y in the main procedure are referenced directly by the sub routine. The result is that the values of X and Y are altered by the sub routine so that after the Test is executed X = 450 and Y = "Number = 45".If, however, the sub routine is defined as follows:Sub Test (ByVal A, ByVal B)B = B & " = " & A : A = 10*AEnd SubThen after Test is executed X = 45 and Y = "Number", i.e. they remain unchanged.If the sub routine is defined as follows:Sub Test (ByRef A, ByVal B)B = B & " = " & A : A = 10*AEnd SubThen after Test is executed, X = 450 and Y = "Number" since Y was passed by value, it remains unchanged.You can override the ByRef setting of a function or sub routine by putting parentheses around a variable name in the calling statement.Calling Test with the following statement:Test (X), Ywould pass the variable X by value, regardless of the method defined for that parameter in the procedure definition.Dates and Times routinesThe VB Script language set supports a set of Date/Time routines and a few routines outlined below:Date Day HourIsDate Minute MonthTimeNow SecondYearFile IO RoutinesThe VB Script language set supports a set of File IO routines:FileTimeDate Dir FileLenFileCopy Kill NameRmDir MkDirMath RoutinesThe VB Script language set supports a set of Math routines:Abs Atn CosExp Log NotOct Rnd SinSqn TanString RoutinesThe VB Script language set supports a set of String routines and a few string routines outlined below:Asc Chr FormatLCaseInStr InStrRevLen Left MidRight Str TrimLTrim RTrim UCaseServer Process RoutinesThe server process routines are used when you are dealing with processes in your scripts especially if you need to extract or set strings for the parameters of processes.To execute processes and parameters in scripts, use the following functionsAddColorParameter AddIntegerParameter AddLongIntParameter AddSingleParameter AddWordParameter GetIntegerParameter GetStringParameter ResetParameters RunProcessUseful functionsSetCursorBusy ResetCursor CheckActiveServer GetActiveServerName GetCurrentDocumentFileName RunApplicationSaveCurrentDocumentUseful DialogsConfirmNoYes ConfirmNoYesCancelShowErrorShowInfo ShowWarningUsing Components in Script FormsAlthough Forms and Components are based on Borland Delphi's Visual Component Library, you still use the Tool Palette to drop controls on a form and generate VB Script based event handlers and write code in VB Script language.In this section:•Components•Designing Script Forms•Writing Event Handlers.ComponentsThe scripting system handles two types of components: Visual and Non-visual components. The visual components are the ones you use to build the user interface and the non-visual components are used for different tasks such as Timer, OpenDialog and MainMenu components. The Timer non-visual component can be used to activate specific code at scheduled intervals which is never seen by the user. The Button, Edit and Memo components are examples of visual componentsBoth types of components appear at design time but non visual components are not visible at runtime. Components from the Tool Palette panel are object oriented and have the three following items:• Properties• Events• MethodsA property is a characteristic of an object that influences either the visible behavior or the operations of this object. For example, the Visible property determines whether this object can be seen or not on a script form.An event is an action or occurrence detected by the script. In a script, the programmer writes code for each event handler which is designed to capture a specific event such as a mouse click.A method is a procedure that is always associated with an object and defines the behavior of an object.All script forms have one or more components. Components usually display information or allow the user to perform an action. For example, a Label is used to display static text, an Edit box is used to allow user to input some data and a Button can be used to initiate actions.Any combination of components can be placed on a form and while your script is running, a user can interact with any component on a form. It is your task, as a programmer, to decide what happens when a user clicks a button or changes a text in an Edit box.The Scripting system supplies a number of components for you to create complex user interfaces for your scripts. You can find all the components you can place on a form from the Tool Palette panel.To place a component on a form, locate its icon on the Tool Palette panel and double-click it. This action places a component on the active form. Visual representation of most components is set with their set of properties. When you first place a component on a form, it is placed in a default position, with default width and height, however you can resize or re-position this component. You can also change the size and position using the Object Inspector.When you drop a component onto a form, the Scripting system automatically generates code necessary to use the component and updates the script form. You only need to set properties, put code in event handlers and use methods as necessary to get the component on the form working.Designing Script FormsA script form is designed to interact with the user within the Altium Designer environment. Designing script forms is the core of visual development in the Altium Designer. Every component you place on a script form and every property you set is stored in a file describing the form (a *.DFM file) and has a relationship with the associated script code (the *.VBS file). For every script form, there is the *.VBS file and the corresponding *.DFM file.When you are working with a script form and its components, you can customize its properties using the Object Inspector panel. You can select more than one component by shift clicking on the components or by dragging a selection rectangle around the components. A script form has a title which corresponds to the Caption property on the Object Inspector panel.Creating a New Script FormWith a project open in Altium Designer, right click on a project in the Projects panel, and a pop up menu appears, click on the Add New to Project item, and choose Script Form item. A new script form appears with the Form1 name as the default name.Displaying a Script FormIn a script, you will need to have a routine that displays the form when the script form is executed in Altium Designer. Within this routine, you invoke the ShowModal method for the form. The Visible property of the form needs to be false if the ShowModal method of the script form is to work properly.ShowModal ExampleSub RunDialogDialogForm.ShowModalEnd SubThe ShowModal example is a very simple example of displaying the script form when the RunDialog from the script is invoked. Note, you can assign values to the components of the DialogForm object before the DialogForm.ShowModal is invoked.ModalResult Examplesub bOKButtonClick(Sender)ModalResult := mrOKend subsub bCancelButtonClick(Sender)ModalResult := mrCancelend subsub RunShowModalExample'Form Visible property must be false for ShowModal to work properly.If Form.ShowModal = mrOk Then ShowMessage("mrOk")If Form.ShowModal = mrCancel Then ShowMessage("mrCancel")end subThe following methods are used for buttons in a script form. The methods cause the dialog to terminate when the user clicks either the OK or Cancel button, returning mrOk or mrCancel from the ShowModal method respectively.You could also set the ModalResult value to mrOk for the OK button and mrCancel for the Cancel button in their event handlers to accomplish the same thing. When the user clicks either button, the dialog box closes. There is no need to call the Close method, because when you set the ModalResult method, the script engine closes the script form for you automatically.Note, if you wish to set the form's ModalResult to cancel, when user presses the Escape key, simply enable the Cancel property to True for the Cancel button in the Object Inspector panel or insert Sender.Cancel := True in the form's button cancel click event handler.Accepting Input from the UserOne of the common components that can accept input form the user is the EditBox component. This EditBox component has a field where the user can type in a string of characters. There are other components such as masked edit component which is an edit component with an input mask stored in a string. This controls or filters the input.The example below illustrates what is happening when user clicks on the button after typing in the edit box. That is, if the user did not type anything in the edit component, the event handler responds with a warning message.sub TScriptForm.ButtonClick(Sender)If Edit1.Text = “” ThenShowMessage(“Warning - empty input!”)ExitEnd' do something else for the inputEnd subNote a user can move the input focus by using the Tab key or by clicking with the house on another control on the form.Responding to EventsWhen you press the mouse button on a form or a component, Altium Designer sends a message and the Scripting System responds by receiving an event notification and calling the appropriate event handler method.Writing Event HandlersEach component, beside its properties, has a set of event names. You as the programmer decide how a script will react on user actions in Altium Designer. For instance, when a user clicks a button on a form, Altium Designer sends a message to the script and the script reacts to this new event. If the OnClick event for a button is specified, it gets executed.The code that respond to events is contained in event handlers. All components have a set of events that they can react on. For example, all clickable components have an OnClick event that gets fired if a user clicks on a component.. All such components have an event for getting and losing the focus. However, if you do not specify the code for OnEnter and OnExit (OnEnter - the control has focus; OnExit - the control loses focus) the event will be ignored by your script.Your script may need to respond to events that occur to a component at run time. An event is a link between an occurrence in Altium Designer such as clicking a button, and a piece of code that responds to that occurrence. This code modifies property values and calls methods.List of Properties for a ComponentTo see a list of properties for a component, select a component and in the Object Inspector, activate the Properties tab.List of Events for a ComponentTo see a list of events a component can react to, select a component and in the Object Inspector activate the Events tab. To create an event handling procedure, decide which event you want your component to react to and double click the event name.For example, select the Button1 component from the Tool Palette panel and drop it on the script form, and double click next to the OnClick event name. The scripting system will bring the Code Editor to the top of the Altium Designer and the skeleton code for the OnClick event will be created.A button has a Close method in the CloseClick event handler. When the button is clicked, the button event handler captures the on click event, and the code inside the event handler gets executed. That is, the Close method closes the script form.In a nutshell, select a button component, either on the form or by using the Object Inspector panel, select the Events tab and double click on the right side of the OnClick event. A new event handler will appear on the script. Alternatively, double click on the button and the scripting system will add a handler for this OnClick event. Other types of components will have completely different default actions.List of Methods for a ComponentTo see a list of methods for a component, refer to the Component Reference document.Dropping Components on a Script FormTo use components from the Tool Palette panel in your scripts, first, open a script form. Normally, when you drop components on a script form you do not need to create or destroy these objects as the script form does it for you automatically.The scripting system automatically generates code necessary to use the component and updates the script form. You need to set properties, put code in event handlers and use methods as necessary to get the script form working in Altium Designer.Creating Components from a ScriptYou can directly create and destroy components in a script – normally you don’t need to pass in the handle of the form because the script form takes care of it automatically for you. You normally pass a Nil parameter to the Constructor of a component.For example, you can create and destroy Open and Save Dialogs (TOpenDialog and TSaveDialog classes as part of Borland Delphi Run Time Library).。