Speed Mark Advanced Scripting Reference en 3 4
Speed Mark Advanced Scripting Reference en 3 4
4 (Beta)
TROTEC accepts no liability for any direct or indirect damage arising from the application or use of
the products, circuits or software described herein. The operating instructions must be read
carefully and observed before the equipment is commissioned.
TROTEC reserves the right to amend any product described herein without prior notice.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
2 / 135
Contents
1 Contents .......................................................................................................................................................... 3
2 Introduction..................................................................................................................................................... 7
2.1 Intended users of advanced scripting....................................................................................................... 7
2.2 Licensing ...................................................................................................................................................... 7
2.3 Disclaimer..................................................................................................................................................... 7
3 General architecture....................................................................................................................................... 8
3.1 Scripting element integration and execution flow ................................................................................. 10
3.2 Scripted RunScreen integration and execution flow ............................................................................. 11
4 First script tutorials ...................................................................................................................................... 12
4.1 Hello world tutorial .................................................................................................................................... 13
4.2 Script form tutorial .................................................................................................................................... 14
4.3 Script creator ............................................................................................................................................. 16
4.4 Script wizard .............................................................................................................................................. 17
4.5 Scripted RunScreen .................................................................................................................................. 19
5 Integrated Development Environment ....................................................................................................... 22
5.1 Explanations of terms or abbreviations.................................................................................................. 23
5.2 Menu and toolbar functions ..................................................................................................................... 23
5.2.1 Scripting menu...................................................................................................................................... 23
5.2.2 Edit menu.............................................................................................................................................. 23
5.2.3 View menu ............................................................................................................................................ 24
5.2.4 Start menu ............................................................................................................................................ 24
5.2.5 Tools menu ........................................................................................................................................... 24
5.3 Units to organize scripts........................................................................................................................... 25
5.4 Code view ................................................................................................................................................... 26
5.4.1 Script code tool ..................................................................................................................................... 27
5.5 Design view ................................................................................................................................................ 28
5.5.1 Design controls bars ............................................................................................................................. 29
5.5.2 Properties and events window.............................................................................................................. 29
5.5.3 Designer tools....................................................................................................................................... 30
5.5.4 Designer options................................................................................................................................... 31
5.6 Special IDE features for Scripting elements........................................................................................... 32
5.6.1 General element options ...................................................................................................................... 32
5.7 Special IDE features for Scripted RunScreen......................................................................................... 32
6 VBScript Language features ....................................................................................................................... 33
6.1 VBScript Syntax......................................................................................................................................... 33
6.1.1 Basic syntax.......................................................................................................................................... 33
6.1.2 Unit script structure............................................................................................................................... 33
6.1.3 Comments ............................................................................................................................................ 33
6.1.4 Naming of identifiers ............................................................................................................................. 34
6.1.5 Assign statements ................................................................................................................................ 34
6.1.6 Variables............................................................................................................................................... 34
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
3 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
4 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
5 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
6 / 135
Introduction
Advanced scripting is the extension of existing SpeedMark scripting with the possibility to fully customize and
automate laser work routine based on the successful SpeedMark software package.
The main advantages are:
Advanced scripting supports scripting inside of a SpeedMark project as well as building Scripted RunScreen
to fully automate and customize SpeedMark appearance.
2.2 Licensing
Trotec SpeedMark Advanced Scripting will be delivered with a license key for usage. If you have not received
the appropriate key please contact the dealer of your laser system. The license code can be registered after
starting SpeedMark via menu point Help Software registration.
2.3 Disclaimer
Unless this part of the software is beta, some changes may arise in the next version which requires
the adoption of existing scripts.
Trotec is not responsible for any possible damage done due to the use of advanced scripting.
The marking process may only be conducted using fault-free machines (please also refer to the user
manual for the TROTEC laser system you have purchased).
Any other application of the equipment is considered contrary to intended use. The manufacturer
accepts no liability for any personal injury and/or material damage arising as a result of this.
The equipment may only be operated, serviced and commissioned by individuals familiar with the
intended use and potential risks of the machine!
Failing to observe the operating, service and maintenance regulations provided by the manufacturer
in this user manual exempts the manufacture from any liability in the event of a fault.
For further information see documents SpeedMark User Guide and SpeedMark Scripting Reference shipped
with SpeedMark setup.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
7 / 135
General architecture
Advanced scripting supports two general concepts of customizing and automating SpeedMark:
Scripting elements
these are scripts which are directly placed in the flow chart of SpeedMark marking programs.
Scripted RunScreen
these are scripts which run upon SpeedMark with the ability to control certain functions of SpeedMark
like executing projects.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
8 / 135
Scripting Element
13/02/2013
Scripted RunScreen
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
9 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
10 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
Axis-Controller
Laser-Controller
11 / 135
This tutorial chapter states some easy to create scripts to show the basic scripting concepts in practice . The
shown scripting elements are placed on the advanced scripting toolbar. Within default SpeedMark
installations this toolbar is on the left side, the last toolbar.
To run these tutorials, a valid installation of SpeedMark 3.4 (or above) and a valid advanced scripting
license key is necessary.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
12 / 135
Description
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
13 / 135
Description
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
14 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
15 / 135
Description
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
16 / 135
Description
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
17 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
18 / 135
Description
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
19 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
20 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
21 / 135
SpeedMark contains a ready to use IDE for writing scripts and designing forms as well as for scripting
elements and scripted run screen scripts.
The chapter general will explain how to use the IDE. The chapters scripting elements and scripted run screen
will point out some small differences between these two scripting types.
The IDE basically consists of the following areas:
Main menu
Toolbars
3
Page control with all the different units in the script
Window for editing the drawing and programming elements (Code, Design)
Window for editing control properties
Units are a tool to split a script into several areas. See also 5.3 Units to organize scripts on page 25.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
22 / 135
Description
Integrated development environment
4
A unit is the smallest entity of scripting . A unit can be a code unit which
contains only code lines in text format. A unit can also be a form unit which
contains of a code view with code line in text format and a design view which
contains all drawing information of the form.
A script is a package of different units
Are controls like buttons, edit fields, which are used to draw forms in
design view.
Script
Design control
The most often used functions can be accessed via the toolbars using the mouse .
Symbol
Description
Adds a new scripting unit to the script
Adds a new form unit to the script
Apply changes
Saves this script together with the SpeedMark project
Changes the unit name to a new name
Removes the unit from this script
Prints the unit code
Symbol
Shortcut
Ctrl+Z
Ctrl+Y
Ctrl+X
Ctrl+C
Ctrl+V
Ctrl+A
Del
Ctrl+F
Ctrl+R
Description
Undoes the last operation
Redoes the last undoed operation
Cuts text or designcontrols to clipboard
Copies text or design controls to clipboard
Pastes text or controls from clipboard
Selects all (text or design controls
Deletes text or design control
Finds a text within the selected unit
Replaces text within the selected unit
Increases the indent of a selected text
Decreases the indent of a selected text
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
23 / 135
Align to grid
Bring to front
Send to back
Align elements
Adjust size
Tab order
Symbol
Scripting toolbar
Edit toolbar
Debug toolbar
Script code toolbar
Description
7
Shows or hides the watch window
8
Editing SpeedMark variables
Toggles scripting toolbar
Toggles edit toolbar
Toggles debug toolbar
Toggles script code toolbar
Symbol
Execute
Reset
Pause
Show execution
point
Step over
Trace into
Execute until
return
Run to line
Toggle breakpoint
Add watch
Shortcut
Description
Compiles the current script
F9
Shift+F9
F8
F7
Shift+F11
F4
F5
Ctrl+F5
Description
Exports the current unit to text file(s)
Exports all script units to text files(s)
Exports all script units to a packed script file
Imports a script unit into this script
Imports all script units
Imports a packed script
9
Creates a script code template
10
Opens the designer options dialog
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
24 / 135
Script
You can select the different units from a script by clicking the tabs
in the unit bar.
Unit 2 (Form)
Unit1 (Code)
Units are used to organize the code within one script. This helps
to get a better overview or to reuse certain units in other units.
To create, rename and delete units, use the following menu points:
Create a code unit
Create a form unit
Rename a unit
Delete a unit
Export a unit
Import a unit
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
25 / 135
Within the code view of a unit you can write VBScript code .
Description
When pressing
Ctrl+Space a window
opens which shows
available functions,
procedures, constants,
When
pressing .
after a class
variable a
window opens
which shows
available
methods and
properties of this class.
11
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
26 / 135
Context menu
Find
Replace
Increase indent
Decrease indent
Print
13/02/2013
Number
01
02
03
04
05
06
07
08
09
10
11
Name
If then else (single line)
If then else
If elseif else
For
While
Do loop until
Do until loop
Select case
Sub
Sub param
Function
12
13
14
15
16
17
18
Function param
Sub public
Sub private
Try finally
Try catch
Try catch finally
Variable types
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
27 / 135
Designer tools
12
Designer options
12
13
13
Description
Places controls on the form
Creates a main event for this control and switches to the code view of
this unit
By default the design view doesnt
offer any context menu, but some
controls have special options
which are accessed via context
menu.
Supports features like bring to front, send to back, align elements, adjust
size and setting tab order.
Tools Designer options
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
28 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
29 / 135
Align to grid
This option aligns all selected design controls to the grid.
Bring to front
This option redefines the order of controls which are lying on each
other and brings the selected control to front.
Send to back
This option redefines the order of controls which are lying on each
other and brings the selected control to the back.
Align elements
The option align elements opens a window which offers several
methods to align multiple controls with each other.
Adjust size
With the adjust size dialog it is possible to
equal the size of multiple selected design
controls.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
30 / 135
Tab order
The tab order dialog allows controlling and changing the current
14
tab order of the various controls in a simple way .
14
It is also possible to set the tab order via the specific tab order property in the properties window.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
31 / 135
Symbol
Description
Apply changes, to the scripting element (nothing is saved to hard
disk, only in memory)
Saves this script together with the whole SpeedMark project (in
this case everything is saved to hard disk)
Exports the whole script as a packed file
SpeedMark variables
13/02/2013
Symbol
Description
Saves changes to hard disk
Asks the user for a new file name and saves this new file to hard
disk
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
32 / 135
Example Script 1
FUNCTION MyFunction1
MyFunction = "Ok!"
END FUNCTION
FUNCTION MyFunction2
return "Ok!"
END FUNCTION
Example Script 2
Like in normal basic, statements in a single line can be separated by ":" character.
6.1.3 Comments
Comments can be inserted inside script. You can use ' chars or REM. Comment will finish at the end of line.
' This is a comment before ShowMessage
ShowMessage("Ok")
REM This is another comment
ShowMessage("More ok!")
' And this is a comment
' with two lines
ShowMessage("End of okays")
Comment examples
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
33 / 135
VarName
_Some
V1A2
Valid identifiers
2Var
My Name
Some-more
This,is,not,valid
Assignment examples
6.1.6 Variables
There is no need to declare variable types in script. Thus, you declare variable just using DIM directive and its
name.
SUB Msg
DIM S
S = "Hello world!"
ShowMessage(S)
END SUB
Example 1
DIM A
A = 0
A = A+1
ShowMessage(A)
Example 2
You can also declare global variables as private or public using the following syntax:
PRIVATE A
PUBLIC B
B = 0
A = B + 1
ShowMessage(A)
Example 3
Variable declared with DIM statement are public by default. Private variables are not accessible from other
script units. Variables can be default initialized with the following syntax
DIM A = "Hello world"
DIM B As Integer = 5
Example 4
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
34 / 135
Boolean
Extended
Pointer
Object
WideChar
AnsiString
Variant
WideString
Cardinal
Single
Shortint
Smallint
Real
TObject (means all kind of classes)
String example
Index examples
VBScript supports array constructors and variant arrays. To construct an array, use
"[" and "]" chars. You can construct multi-index array nesting array constructors. You can then access arrays
using indexes.
If the array is a multi-index array, then separate the indexes by using ",".
If the variable is a variant array, VBScript automatically support indexing of that variable. A variable is a
variant array if it was assigned using an array constructor, or if it is a direct reference to a SpeedMark system
variable which is a variant array or if it was created by using the VarArrayCreate procedure.
Arrays in unit scripts are 0-based.
NewArray = [ 2,4,6,8 ]
Num = NewArray[1] //Num receives "4"
MultiArray = [ ["green","red","blue"] , ["apple","orange","lemon"] ]
Str = MultiArray[0,2] //Str receives 'blue'
MultiArray[1,1] = "new orange"
Array examples
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
35 / 135
New examples
If the constructor receives parameters, you can pass the parameters in parenthesis, like the TLabel example
above.
6.1.11 If statements
There are two forms of if statement:
if...then..end if
if...then...else..end if
Like normal basic, if the if expression is true, the statements are executed. If there is else part and expression
is false, statements after else are executed.
IF J <> 0 THEN Result = I/J END IF
IF J = 0 THEN Exit ELSE Result = I/J END IF
IF J <> 0 THEN
Result = I/J
Count = Count + 1
ELSE
Done = True
END IF
If examples
If the IF statement is in a single line, you don't need to finish it with END IF:
IF J <> 0 THEN Result = I/J
IF J = 0 THEN Exit ELSE Result = I/J
then
-1
= 0 then
0
1
Elseif example
Example 1
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
36 / 135
WHILE (I > 0)
IF Odd(I) THEN Z = Z * X END IF
X = Sqr(X)
END WHILE
Example 2
WHILE (not Eof(InputFile))
Readln(InputFile, Line)
Process(Line)
END WHILE
Example 3
Statements will be executed WHILE expr is true, or UNTIL expr is true. if expr is before statements, then the
control condition will be tested before iteration. Otherwise, control condition will be tested after iteration.
Examples:
DO
K = I mod J
I = J
J = K
LOOP UNTIL J = 0
Example 1
DO UNTIL I >= 0
Write("Enter a value (0..9): ")
Readln(I)
LOOP
Example 2
DO
K = I mod J
I = J
J = K
LOOP WHILE J <> 0
Example 3
DO WHILE I < 0
Write("Enter a value (0..9): ")
Readln(I)
LOOP
Example 4
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
37 / 135
For statement set counter to initialValue, repeats execution of statement until "next" and increment value of
counter by stepValue, until counter reaches finalValue.
Step part is optional, and if omitted stepValue is considered 1. Examples:
FOR c = 1 TO 10 STEP 2
a = a + c
NEXT
FOR I = a TO b
j = i ^ 2
sum = sum + j
NEXT
For examples
CASE caseexprn
Statement(n)
CASE ELSE
elsestatement
END SELECT
If selectorExpression matches the result of one of caseexpr(n) expressions, the respective statements will be
execute. Otherwise, elsestatement will be executed. Else part of case statement is optional.
SELECT CASE uppercase(Fruit)
CASE "lime" ShowMessage("green")
CASE "orange"
ShowMessage("orange")
CASE "apple" ShowMessage("red")
CASE ELSE
ShowMessage("black")
END SELECT
Select example
Sub example
SUB UpcaseMessage(Msg)
ShowMessage(Uppercase(Msg))
END SUB
Sub example
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
38 / 135
FUNCTION TodayAsString
TodayAsString = DateToStr(Date)
END FUNCTION
Function example
FUNCTION Max(A,B)
IF A>B THEN
MAX = A
ELSE
MAX = B
END IF
END FUNCTION
Function example
SUB SwapValues(BYREF A, B)
DIM TEMP
TEMP = A
A = B
B = TEMP
END SUB
Byref example
You can also declare subs and functions as private or public using the following syntax:
PRIVATE SUB Hello
END SUB
PUBLIC FUNCTION Hello
END FUNCTION
Private example
Subs and functions are public by default. Private subs and functions are not acessible from other script units.
You can use Return statement to exit subs and functions. For functions, you can also return a valid value.
SUB UpcaseMessage(Msg)
ShowMessage(Uppercase(Msg))
Return
'This line will be never reached
ShowMessage("never displayed")
END SUB
FUNCTION TodayAsString
Return DateToStr(Date)
END FUNCTION
Return example
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
39 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
40 / 135
6.2.2 Syntax
function lib 'libName.dll' [alias ExternalFunctionName] [callingConvention]
functionName(arguments) as resultType;
imports a function called MyFunction from CustomLib.dll. Default calling convention, if not specified, is stdcall.
Scripting also allows to declare a different calling convention (stdcall, register, pascal, cdecl or safecall) and to
use a different name for DLL function, like the following declaration:
function MessageBox lib "User32.dll" alias "MessageBoxA" stdcall (hwnd as pointer, text as string,
caption as string, msgtype as integer) as integer
That imports 'MessageBoxA' function from User32.dll (Windows API library), named 'MessageBox' to be used
in the script unit.
Declaration above can be used to functions and as well to subs (routines without result value).
13/02/2013
Boolean
Extended
Pointer
Object
WideChar
AnsiString
Variant
WideString
Cardinal
Single
Shortint
Smallint
Real
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
41 / 135
The following example shows how to access a database using ADO COM object:
' Open a database connection
Dim ObjConnection = CreateObject("ADODB.Connection")
Dim myDatabase = "countries.mdb"
Dim OdbcTextConnStr = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" + myDatabase
ObjConnection.Open(OdbcTextConnStr) ' Use either OLE or ODBC connection string
' Open a recordset
Dim ObjRecordSet = CreateObject("ADODB.RecordSet")
Dim mySQL = "SELECT * FROM countries"
ObjRecordSet.ActiveConnection = ObjConnection
ObjRecordSet.Open(mySQL)
try
' Query the recordset
Dim i = 0
do while (ObjRecordSet.Eof = False)
' get the field
Dim RowData = ""
Dim ObjField = nothing
ObjField = ObjRecordSet.Fields.Item("ID")
RowData = RowData & ObjField.Value & Chr(0x09)
ObjField = ObjRecordSet.Fields.Item("COUNTRY")
RowData = RowData & ObjField.Value & Chr(0x09)
ObjField = ObjRecordSet.Fields.Item("CODE")
RowData = RowData & ObjField.Value
ListBoxCountries.AddItem(RowData, nothing)
ObjRecordSet.MoveNext
i = i + 1
loop
finally
' close recordset and connection
ObjRecordSet.Close
ObjConnection.Close
end
15
From implementation point of view it can be helpful to test such implementations in other Visual Basic IDEs
like Visual Basic for Excel.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
42 / 135
The values of the #FORM declaration are internally handled by Scripting and should not be changed.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
43 / 135
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
44 / 135
CurrentProject
MainProgram
SubPrograms
TScProgram
CurrentProgram
Variables
Logging
Graphics
Errors
System
Execution
BorderMarking
Components
Class definition
Common objects
Scripting Element objects
RunScreen objects
MsgBox(SpeedMark.CurrentProject.MainProgram.Name)
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
45 / 135
Description
Are SpeedMark components like LaserController, Axis and so on
Are instances of classes which are already created by SpeedMark
TScCustomErrors
Classes
Application Object
TScExecutionErrors
TScSystemErrors
Execution
System
TScLogging
TScErrorHandler
TScConfiguration
TScDataStore
TScRunScreen
Logging
Errors
Configuration
DataStore
RunScreen
TScCustomApp
TScRunScreenApp
TScProjectApp
SpeedMark
TScLaserSystem
TScProject
System
CurrentProject
TScProgram
CurrentProgram
The application object SpeedMark is either of type TScRunScreenApp (when using scripted run screen) or of
17
type TScProjectApp (when using scripting elements). The difference is only one property .
You will find the class diagrams for TScLaserSystem, TScProgram TscProject and the components in the
subsequent chapters of this document.
17
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
46 / 135
All components defined in the laser configuration of SpeedMark (tab system configuration) can be directly
18
accessed via the application object SpeedMark. This includes the following components :
LaserController
MarkBusy
MarkStart
AutomaticMode
EmergencyStop
Exhaust
XAxis
Yaxis
Zaxis
Baxis
SpeedMark.Xaxis.MoveAbs(100)
Xaxis example
SpeedMark.MarkBusy.OutputIO = True
MarkBusy example
if (SpeedMark.LaserController.IsLaserReady) then
MsgBox(Laser is ready!)
else
MsgBox(Laser is not ready!)
end if
LaserController example
18
If a component is not configured within SpeedMark laser configuration the object is null.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
47 / 135
The object System (TScLaserSystem) within the application object SpeedMark allows accessing all
configured components and system relevant actions like border marking. From here it is possible to access
also components which are not defined in laser configuration tab system configuration, like serial ports and so
on.
All collection classes dispose the components in form of properties. That means when you define a serial port
with name Serial1 in SpeedMark, the collection SerialPortComponents gets a new property called Serial1.
The advantage of this system is that you will get compile errors when the laser system is not correctly
19
configured .
text = SpeedMark.System.SerialPortComponents.Serial1.Read
text = text + "Hello"
SpeedMark.System.SerialPortComponents.Serial1.Write(text)
19
All the other component collections work the same way as SerialPortComponents does.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
48 / 135
Every component collection class supports zero or more components which can be directly accessed via the
name of the component defined within SpeedMark laser configuration. The picture above shows which
component class type is associated with which collection class type.
The knowledge of this structure allows direct assignment of components to variables of the designated type.
Dim varSerial1 as TScSerialPortComponent
varSerial1 = SpeedMark.System.SerialPortComponents.Serial1
if Assigned(varSerial1) then
test = varSerial1.Read
text = text + "Hello"
varSerial1.Write(text)
end if
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
49 / 135
TScProject
SpeedMark
Classes
CurrentProject
Application Object
SubPrograms
MainProgram
TScProgram
CurrentProgram
TScElements
TScGraphicElements
TScProgramVariables
Graphics
Variables
TScGraphicElement
TScTextGraphicElement
TScElement
TScFileGraphicElement
The program classes allow direct access to a loaded SpeedMark project, main program and sub programs as
well as SpeedMark program variables.
It is only possible to access programs and graphic elements already created within SpeedMark.
Currently it is not supported to create programs and graphic elements by scripting.
But it is possible to manipulate existing graphic elements in various ways like positioning, resizing
updating of data.
20
and
Variables example
20
For further information on how to work with GraphicElements see 7.3.5 TScGraphicElement on page 55.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
50 / 135
TScCustomApp
TScRunScreenApp
TScProjectApp
SpeedMark
Property name
Returns
Description
ApplicationVersion
WideString
ApplicationHandle
HWND
Logging
TScLogging
Errors
TScErrorHandler
RunScreen
TScRunScreen
DataStore
TScDataStore
System
TScLaserSystem
LaserController
TScLaserControllerComponent
MarkStart
TScVirtualInputIOComponent
MarkBusy
TScVirtualOutputIOComponent
AutomaticMode
TScVirtualInputIOComponent
EmergencyStop
TScVirtualInputIOComponent
XAxis
TScAxisControllerComponent
YAxis
TScAxisControllerComponent
ZAxis
TScAxisControllerComponent
AAxis
TScAxisControllerComponent
BAxis
TScAxisControllerComponent
Exhaust
TScExhaustComponent
CurrentProject
TScProject
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
51 / 135
Property name
Returns
Description
CurrentProgram
(only scripting elements)
TScProgram
Configuration
(only scripted run screen)
TScConfiguration
MainForm
(only scripted run screen)
TForm
Method name
Returns
Parameters
Description
AbortExecution
LoadProject
(only scripted run screen)
FileName as String
ExecuteProject
(only scripted run screen)
ParentWindowHandle as
HWND, [WindowPos as TRect
= Center]
SimulateProject
(only scripted run screen)
ParentWindowHandle as
HWND, [WindowPos as TRect
= Center]
Event name
Parameters
Description
OnProgramStart
(only scripted run screen)
Program as TScProgram,
IsMainProgram as Boolean
OnProgramEnd
(only scripted run screen)
Program as TScProgram,
IsMainProgram as Boolean
To use the application object SpeedMark, just type SpeedMark. with a point and the code completion will
present all available properties, methods and events.
MsgBox(SpeedMark.ApplicationVersion)
7.3.2 TScProject
The TScProject class represents objects of SpeedMark projects. Instances of this class cannot be created via
scripting but must be read from application object SpeedMark property CurrentProject.
Property name
Returns
Description
FileName
String
MainProgram
TScProgram
SubProgramCount
Integer
SubPrograms
TScProgram [ ]
SubProgramByName
TScProgram [ ]
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
52 / 135
Method name
Returns
Parameters
Description
CreatePreviewBitmap
CreatePreviewStream
BitmapStream as TStream,
BitmapWidth as Integer, BitmapHeight
as Integer, [Zoom as Double = 1,
ShowFieldRect as Boolean=True,
ShowGrid as Boolean=False,
ShowAxis as Boolean=False,
ShowAxisLabels as Boolean=False,
ShowFieldShadow as Boolean=False,
ShowInvisibleElements as
Boolean=False, ShowGraphicInfo as
Boolean=False, Margin as
Integer=10]
The project object is mainly the container for all SpeedMark programs. The examples below show how to
create a preview of all available programs within this project.
SUB ButtonPreviewAllClick(Sender AS TObject)
Dim Bitmap as TBitmap
Bitmap = new TBitmap
try
SpeedMark.CurrentProject.CreatePreviewBitmap(Bitmap, 1200, 1200, 1)
Self.Canvas.Draw(0,0, Bitmap)
finally
Bitmap.Free
Bitmap = nothing
end
END SUB
7.3.3 TScProgram
The TScProgram class represents objects of SpeedMark programs. Instances of this class cannot be created
via scripting but must be read from a project object or SpeedMark property CurrentProgram.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
53 / 135
Property name
Returns
Description
Owner
TScProject
Name
String
Modified
Boolean
Variables
TScProgramVariables
Graphics
TScGraphicElements
Method name
Returns
Parameters
Description
CreatePreviewBitmap
CreatePreviewStream
BitmapStream as TStream,
BitmapWidth as Integer, BitmapHeight
as Integer, [Zoom as Double = 1,
ShowFieldRect as Boolean=True,
ShowGrid as Boolean=False,
ShowAxis as Boolean=False,
ShowAxisLabels as Boolean=False,
ShowFieldShadow as Boolean=False,
ShowInvisibleElements as
Boolean=False, ShowGraphicInfo as
Boolean=False, Margin as
Integer=10]
The program object is mainly the container for the graphic elements. The examples below show how to create
a preview of the graphics within this program.
SUB ButtonPreviewAllClick(Sender AS TObject)
Dim Bitmap as TBitmap
Bitmap = new TBitmap
try
SpeedMark.CurrentProject.MainProgram.CreatePreviewBitmap(Bitmap, 1200, 1200, 1)
Self.Canvas.Draw(0,0, Bitmap)
finally
Bitmap.Free
Bitmap = nothing
end
END SUB
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
54 / 135
7.3.4 TScGraphicElements
Property name
Returns
Description
Count
Integer
GraphicByIndex
TScGraphicElement [ ]
GraphicByGUID
TScGraphicElement [ ]
GraphicByName
TScGraphicElement [ ]
Method name
Returns
Parameters
Description
UpdateGraphics
7.3.5 TScGraphicElement
This is the base class for all graphic element classes.
Property name
Returns
Description
GUID
WideString
Name
WideString
Comment
WideString
Enabled
Boolean
Visible
Boolean
Bounds
TScRect2D
MarkingBounds
TScRect2D
For some calculation purposes constants of type TRectPointPosition is used. The following constants are
available: rppTopLeft, rppTopCenter, rppTopRight, rppCenterLeft, rppCenter, rppCenterRight, rppBottomLeft,
rppBottomCenter, rppBottomRight
Method name
Parameters
Description
GetBoundsPoint
BoundsPointPosition as
TRectPointPosition, byref x as
Double, byref y as Double
GetBoundsSize
GetMarkingBoundsPoint
BoundsPointPosition as
TRectPointPosition, byref x as
Double, byref y as Double
GetMarkingBoundsSize
13/02/2013
Returns
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
55 / 135
Method name
Returns
Parameters
Description
MoveBy
MoveTo
RectPointPosition:
TRectPointPosition; MoveToX:
Double; MoveToY: Double
Scale
RectPointPosition:
TRectPointPosition; ScaleX:
Double; ScaleY: Double
Rotate
RectPointPosition:
TRectPointPosition; Angle: Double
RotateXY
RotationPosX: Double;
RotationPosY: Double; Angle:
Double
Shear
RectPointPosition:
TRectPointPosition; ShearX:
Double; ShearY: Double
MirrorX
MirrorY
UpdateGraphic
7.3.6 TScRect2D
This class is the return value for bounds and marking bounds of the graphic element.
Property name
Returns
Description
Left
Double
Top
Double
Right
Double
Bottom
Double
7.3.7 TScTextGraphicElement
Derived from TScGraphicElement. This class type includes not only text and outline text, but also 1D and 2D
barcodes.
Property name
Returns
Description
Text
WideString
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
56 / 135
7.3.8 TScFileGraphicElement
Derived from TScGraphicElement. This class type includes raster and vector graphic elements.
Property name
Returns
Description
FileName
String
Method name
Returns
Parameters
Description
UpdateGraphicFromFile
Boolean
FileName as string,
ApplyExistingTransformations as
Boolean
7.3.9 TScProgramVariables
The TScProgramVariables class is a container for variables of SpeedMark programs. Instances of this class
cannot be created via scripting.
The special about this container is that the properties are generated dynamically depending on the variables
defined in the SpeedMark program.
Property name
Returns
Description
<VariableName>
Currently matrix variables defined in SpeedMark programs are not supported. In case of a bigger
21
amount of data exchange, use the DataStore .
The following example shows how to access an integer variable named test (defined in a SpeedMark
program):
SpeedMark.CurrentProgram.Variables.test = 1
21
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
57 / 135
7.3.10 TScLogging
Method name
Returns
AddProgramMessage
Parameters
Description
Message as WideString
ClearProgramMessages
AddProgramLogText
ShowInfoMessage
Message as WideString,
[TimeOut: Integer = 0]
CloseInfoMessage
InitStopWatch
(only scripting elements)
ReadStopWatch
(only scripting elements)
Double
StopWatchName as String
StopWatchName as String
Event name
Parameters
Description
OnAddProgramMessage
(only scripted run screen)
OnClearProgramMessages
(only scripted run screen)
OnAddProgramLogText
(only scripted run screen)
These events are mostly use from scripted run screen to present logging messages during program execution
on screen. An event example can be found at the end of this chapter.
All logging and program messages sent to SpeedMark are shown in the user windows program log and
program messages:
SpeedMark.Logging.AddProgramMessage("My first program message")
SpeedMark.Logging.AddProgramMessage("My second program message")
SpeedMark.Logging.ClearProgramMessages
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
58 / 135
OnAddProgramMessage
OnClearProgramMessages
OnClearProgramMessages
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
59 / 135
7.3.11 TScErrorHandler
Property name
Returns
Description
Execution
TScExecutionErrors
System
TScSystemErrors
Execution errors are only raised when a SpeedMark program is running. System errors raise when a
component reports a failure. So for example a serial port component reports an error (e.g. not connected),
this doesnt mean that an execution error is raised when the program never accesses this serial port.
7.3.12 TScExecutionErrors
Gives the possibility to check execution errors.
Property name
Returns
Description
ErrorString
String
Count
Integer
Error
String [ ]
Method name
Returns
Parameters
Description
ClearAll
ClearLast
7.3.13 TScSystemErrors
Gives the possibility to check system errors.
Property name
Returns
Description
ErrorString
String
7.3.14 TScConfiguration
This class and its object is only available in scripted run screens.
Method name
Parameters
Description
ShowComponentListDlg
ParentWindowHandle as HWND
ShowMaterialDatabaseDlg
ParentWindowHandle as HWND
ShowProjectMaterialDlg
ParentWindowHandle as HWND
13/02/2013
Returns
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
60 / 135
7.3.15 TScDataStore
22
The data store object is used to manage values and list values globally within SpeedMark . The data store
will keep the values also when loading or executing different projects. Through available functions in simple
scripting it is possible to pass data from advanced to simple scripting via the data store.
Property name
Returns
Description
NamedListsCount
Integer
NamedValuesCount
Integer
NamedValueExists
Boolean
NamedValue
Variant
NamedListExists
Boolean
NamedList
TDataStoreList
Method name
Returns
Parameters
ClearAll
Description
Clears all. Named values and names
lists
AddNamedValue
RemoveNamedValue
Name as String
ClearNamedValues
CreateNamedList
RemoveNamedList
Name as String
Name as String
ClearNamedLists
22
23
Currently it is not possible to load or save the data store to hard disk.
See the following chapter 7.3.16 TDataStoreList on page 62
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
61 / 135
7.3.16 TDataStoreList
Property name
Returns
Description
Name
String
Count
Integer
Empty
Boolean
Values
Variant [ ]
Method name
Returns
Parameters
Description
Add
Value: Variant
Insert
Remove
Index: Integer
Clear
Push
Value: Variant
PopFirst
Variant
PopLast
Variant
PeekFirst
Variant
PeekLast
Variant
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
62 / 135
7.3.17 TScRunScreen
With a TScRunScreen object it is possible to establish an event based communication between a SpeedMark
program and a scripted run screen.
Method name
Returns
SendMesssage
(only scripting element)
Parameters
Description
ID as Integer, Text as
WideString, Data as Variant
Event name
Parameters
Description
OnMessage
(only scripted run screen)
Sender as TObject, ID as
Integer, Text as string, Data as
Variant
OnMessage
SpeedMark Execution
Engine
The following examples shows how to catch events sent with the run screen object.
SUB DoOnRunScreenMessage(Sender, ID, Text, Data)
' Handles the message when Program Script Element sends a message (e.g. update the preview)
' see the following example (ID=1 changes the view image)
SELECT CASE ID
CASE 1 ' message one (defined by developer): Loads a new picture into image view
ImageView.Picture.LoadFromFile(Text)
CASE 2 ' currently not defined by developer
MsgBox("Message - ID: " & ID & ", Text: " & Text & ", Data: " & Data)
CASE 3 ' currently not defined by developer
MsgBox("Message - ID: " & ID & ", Text: " & Text & ", Data: " & Data)
CASE ELSE
MsgBox("Undefined RunScreen Message ID!")
END SELECT
END SUB
SUB FormMainShow(Sender AS TObject)
SpeedMark.RunScreen.OnMessage = "DoOnRunScreenMessage"
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
63 / 135
END SUB
SUB FormMainDestroy(Sender AS TObject)
SpeedMark.RunScreen.OnMessage = nothing
END SUB
7.3.18 TScLaserSystem
Within the application object SpeedMark the property system returns an object of class TScLaserSystem
which allows access to system relevant components and actions of SpeedMark and the underlying laser
hardware.
Property name
Returns
Description
BorderMarking
TScBorderMarking
Components
TScComponents
IOControllerComponents
TScIOControllerComponents
LaserControllerComponents
TScLaserControllerComponents
AxisControllerComponents
TScAxisControllerComponents
SerialPortComponents
TScSerialPortComponents
TCPComponents
TScTCPComponents
VirtualInputIOs
TScVirtualInputIOs
VirtualOutputIOs
TScVirtualOutputIOs
ExhaustComponents
TScExhaustComponents
7.3.19 TScBorderMarking
Property name
Returns
Description
IsRunning
Boolean
IsValidSelection
Boolean
Method name
Returns
UpdateSelection
Parameters
Description
Program as TScProgram,
Mode as
TBorderMarkingMode
Start
Stop
ShowBorderMarkingDlg
Parent as HWND
The following example shows how to init border marking, start it and stop it after the user has finished to
position his working piece.
SpeedMark.System.BorderMarking.UpdateSelection(SpeedMark.CurrentProject.MainProgram, bmmGraphics)
SpeedMark.System.BorderMarking.Start
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
64 / 135
TScComponents
TScIOControllerComponents
TScLaserControllerComponents
TScAxisControllerComponents
TScSerialPortComponents
TScTCPComponents
TScVirtualInputIOs
TScVirtualOutputIOs
TScExhaustComponents
These classes have a property count for the number of components within the collection. The special about
these containers is that the properties are generated dynamically depending on the compnents defined in the
SpeedMark laser system configuration.
Property name
Returns
Description
Count
Integer
<Component name>
<TScIOControllerComponent,
TScLaserControllerComponent,
TScAxisControllerComponent,
TScSerialPortComponent,
TScTCPComponent,
TScVirtualInputIOComponent,
TScVirtualOutputIOComponent,
TScExhaustComponent>
MsgBox(SpeedMark.System.LaserControllerComponents.TLC2.ComponentName)
7.3.21 TScCustomComponent
This is the base class for all controller component classes.
Property name
Returns
Description
ComponentName
String
ConfigFile
String
ComponentStatus
TModuleComponentStatus
LastErrorMsg
String
Errors
String
Event name
Parameters
Description
OnError
(only scripted run screen)
Sender as TObject
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
65 / 135
7.3.22 TScIOControllerComponent
Derived from TScCustomComponent. The io controller component class handles the various io controllers
attached to the system.
Property name
Returns
Description
InputPort
Integer
InputIO
Boolean [ ]
OutputPort
Integer
OutputIO
Boolean [ ]
Event name
Parameters
Description
OnInputPortChanged
(only scripted run screen)
OnOutputPortChanged
(only scripted run screen)
SpeedMark.System.IOControllerComponents.TLC2.OutputIO[5] = True
7.3.23 TScLaserControllerComponent
Derived from TScCustomComponent. The laser controller component class handles the various laser
controllers attached to the system.
Property name
Returns
Description
FocalizeLaser
Boolean
PilotLaser
Boolean
FieldHeight
Double
FieldWidth
Double
MinFrequency
Double
MaxFrequency
Double
Power
Double
Frequency
Double
PosSpeed
Double
MarkSpeed
Double
LaserOnDelay
Double
LaserOffDelay
Double
PosDelay
Double
MarkDelay
Double
PolygonDelay
Double
Event name
Parameters
Description
OnGeneralAlarmChanged
Sender as TObject,
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
66 / 135
GeneralAlarm as Boolean
OnMarkingChanged
Sender as TObject,
MarkingStopped as Boolean
OnShutterChanged
Sender as TObject
OnMarkingParametersChanged
Sender as TObject
SpeedMark.System.LaserControllerComponents.TLC2.Power = 100
7.3.24 TScAxisControllerComponent
Derived from TScCustomComponent. The axis controller component class handles the various axis
controllers attached to the system.
Property name
Returns
Description
Position
Double
IsMoving
Boolean
IsInPos
Boolean
IsInPosTimeout
Boolean
IsReferenced
Boolean
MaxPosition
Double
MinPosition
Double
LimitEnabled
Boolean
Method name
Returns
Parameters
MoveAbs
Boolean
Position as Double
StopMotion
Boolean
Reference
Boolean
Description
SpeedMark.System.AxisControllerComponents.aAxis.MoveAbs(100)
7.3.25 TScSerialPortComponent
Derived from TScCustomComponent. The serial port controller component class handles the various serial
port controllers attached to the system.
Method name
Returns
Read
String
Write
Parameters
Description
Reads the data from the serial port
Data as String
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
67 / 135
7.3.26 TScTCPComponent
Derived from TScCustomComponent. The TCP controller component class handles the various tcp ports
configured with the laser system.
Method name
Returns
Read
String
Write
Parameters
Description
Reads the data from the tcp port
Data as String
7.3.27 TScCustomVirtualComponent
This is the base class for all virtual component classes. Currently there are no special properties or events
defined.
Virtual IOs and exhausts are components which are provided by other hardware components. E.g. the TLC2
card provides some ios controlling an attached exhaust.
7.3.28 TScVirtualInputIOComponent
Derived from TScCustomVirtualComponent. The virtual input io component class handles the various input
ios configured within the laser system.
Property name
Returns
Description
InputIO
Boolean
Event name
Parameters
Description
OnSignalChanged
(only scripted run screen)
Sender as TObject
MsgBox(SpeedMark.System.VirtualInputIOs.MarkStart.InputIO)
7.3.29 TScVirtualOutputIOComponent
Derived from TScCustomVirtualComponent. The virtual output io component class handles the various output
ios configured within the laser system.
Property name
Returns
Description
OutputIO
Boolean
Event name
Parameters
Description
OnSignalChanged
(only scripted run screen)
Sender as TObject
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
68 / 135
SpeedMark.System.VirtualOutputIOs.MarkBusy.OutputIO = True
7.3.30 TScExhaustComponent
Derived from TScCustomVirtualComponent. The virtual exhaust component class handles the various
exhausts configured within the laser system.
Property name
Returns
Description
IsRunning
Boolean
Method name
Returns
Parameters
Description
StartExhaust
StopExhaust
Event name
Parameters
Description
OnStatusChanged
(only scripted run screen)
Sender as TObject
SpeedMark.System.ExhaustComponents.atmos.StartExhaust
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
69 / 135
Start marking
Marking project
Start
Close door of
workstation if available
Open door of
workstation if available
Layout 1
Layout 2
Layout 3
End
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
70 / 135
In the assignment element Read layout name the current layout name is transferred via data store from the
scripted run screen to the SpeedMark variable Layout
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
71 / 135
8.2.2 Layout 1
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
72 / 135
8.2.3 Layout 2
8.2.4 Layout 3
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
73 / 135
TextValue1
TextValue2
In case of file graphic elements (e.g. dxf graphic) this strategy leads to a problem. Whenever SpeedMark
updates the graphic of a file graphic element the name of the new graphic file updates the element name.
This means that in this case the element name will change with any update and is not useable as an unique
id for the scripted run screen.
To solve this problem every graphic element has a unique id
in form of GUID structure.
Within this tutorial we will use the following ID for the vector
and the raster graphic:
Vector graphic: {1D22EA63-E01B-4AD5-BEDC-C124760ABA4F}
Raster graphic: {8D91BB35-F678-4540-841E-EB77DBDF3E1E}
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
74 / 135
Name
Description
Key
LayoutName
TextValue1
TextValue2
VectorFile
RasterFile
As a basis for the new scripted run screen, choose the following template Data oriented run screen with
menu point Tools Scripted RunScreen New from template.
We will take this template as a basis for the scripted run screen created by the end of this tutorial
Unless the unit TemplateFolder is not needed for this tutorial, remove it by selecting the unit and removing it
with menu point Scripting Remove unit. Remove the unit TemplateFolder from the uses clause as well.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
75 / 135
Input panel after inserting the key field and removing the button
Create a unit Folders by using menu point Scriping Add new unit within the scripting IDE.
'******************************************************************************
' SpeedMark Advanced Scripting script written by Trotec copyright 2012
' The source code is given as is. The author is not responsible for any
' possible damage done due to the use of this code. This script code can be
' freely used in any SpeedMark application. The complete source code remains
' property of the author and may not be distributed, published, given or sold
' in any form as such. No parts of the source code can be included in any
' other application without written authorization of the author.
'******************************************************************************
FUNCTION GetProjectFolder as string
Dim ProjectFolder = ExtractFileDir(SpeedMark.CurrentProject.FileName)
ProjectFolder = IncludeTrailingBackslash(ProjectFolder)
return ProjectFolder
END FUNCTION
By passing the unit name folders in the uses clause of other units, it is now possible to call the function
GetProjectFolder which retrieves the folder of the current loaded project in SpeedMark.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
76 / 135
Create a unit Data by using menu point Scriping Add new unit within the scripting IDE.
'******************************************************************************
' SpeedMark Advanced Scripting script written by Trotec copyright 2012
' The source code is given as is. The author is not responsible for any
' possible damage done due to the use of this code. This script code can be
' freely used in any SpeedMark application. The complete source code remains
' property of the author and may not be distributed, published, given or sold
' in any form as such. No parts of the source code can be included in any
' other application without written authorization of the author.
'******************************************************************************
#CLASS TData
uses SysUtils, TextFileList, Folders
'******************************************************************************
' TData properties
Dim Key as String
Dim Layout as String
Dim TextValue1 as String
Dim TextValue2 as String
Dim VectorGraphic as String
Dim RasterGraphic as String
'******************************************************************************
' TData methods
SUB ClearProperties
Key = ""
Layout = ""
TextValue1 = ""
TextValue2 = ""
VectorGraphic = ""
RasterGraphic = ""
END SUB
'******************************************************************************
' TData class initializer
ClearProperties()
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
77 / 135
if UBound(DataArray) >
return True
else
return False
end if
END FUNCTION
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
78 / 135
Create a unit Layouts by using menu point Scriping Add new unit within the scripting IDE.
'******************************************************************************
' SpeedMark Advanced Scripting script written by Trotec copyright 2012
' The source code is given as is. The author is not responsible for any
' possible damage done due to the use of this code. This script code can be
' freely used in any SpeedMark application. The complete source code remains
' property of the author and may not be distributed, published, given or sold
' in any form as such. No parts of the source code can be included in any
' other application without written authorization of the author.
'******************************************************************************
uses Data
PRIVATE SUB UpdateTextGraphic(TextGraphic as TScTextGraphicElement, TextData as string)
if Assigned(TextGraphic) then
if Trim(TextData) <> "" then
TextGraphic.Enabled = True
TextGraphic.Visible = True
TextGraphic.Text = TextData
else
TextGraphic.Enabled = False
TextGraphic.Visible = False
end if
end if
END SUB
PRIVATE SUB UpdateVectorGraphic(VectorGraphic as TScFileGraphicElement, FileName as string)
if Assigned(VectorGraphic) then
if Trim(FileName) <> "" then
VectorGraphic.Enabled = True
VectorGraphic.Visible = True
VectorGraphic.UpdateGraphicFromFile(FileName, True)
else
VectorGraphic.Enabled = False
VectorGraphic.Visible = False
end if
end if
END SUB
PRIVATE FUNCTION UpdateLayoutDefault(LayoutProgram as TScProgram, Data as TData, BitmapFolder as string) as Boolean
' prepare the variables
Dim FileName as string
' update all graphics to ensure that all values are correctly calculated
LayoutProgram.Graphics.UpdateGraphics
' set text value 1
UpdateTextGraphic(LayoutProgram.Graphics.GraphicByName["TextValue1"], Data.TextValue1)
' get text value 2
UpdateTextGraphic(LayoutProgram.Graphics.GraphicByName["TextValue2"], Data.TextValue2)
' get vector graphic
FileName = BitmapFolder + Data.VectorGraphic
UpdateVectorGraphic(LayoutProgram.Graphics.GraphicByGUID["{1D22EA63-E01B-4AD5-BEDC-C124760ABA4F}"], FileName)
' get vector graphic
FileName = BitmapFolder + Data.RasterGraphic
UpdateVectorGraphic(LayoutProgram.Graphics.GraphicByGUID["{8D91BB35-F678-4540-841E-EB77DBDF3E1E}"], FileName)
END FUNCTION
FUNCTION UpdateLayout(LayoutProgram as TScProgram, Data as TData) as Boolean
' check if layout program is correct
if Not Assigned(LayoutProgram) then return False
Dim GraphicFolder as string = GetProjectFolder + "Graphics\"
' check the layout calculation to use
select case Data.Layout
case "Layout1" return UpdateLayoutDefault(LayoutProgram, Data, GraphicFolder)
case "Layout2" return UpdateLayoutDefault(LayoutProgram, Data, GraphicFolder)
case "Layout3" return UpdateLayoutDefault(LayoutProgram, Data, GraphicFolder)
case else
MsgBox("Layout '" + Data.Layout + "' not found. Applying default layout!")
return UpdateLayoutDefault(LayoutProgram, Data, GraphicFolder)
end select
END FUNCTION
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
79 / 135
Now it is possible to create and use instances of the Data class unit within FormMain.
For better performance only one instance of a data class within FormMain will be created.
#FORM TFormMain, FormMain.sfm
uses
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
ExtCtrls, ComCtrls, Buttons, Data
Dim LayoutData as TData ' initialized in FormCreate event and destroyed in FormDestroy
Before it is possible to create the a layout data object in FormMainCreate it is necessary to create this form
event:
In the function FormMainCreate insert the data object creation code line:
SUB FormMainCreate(Sender AS TObject)
LayoutData = new TData
END SUB
SUB FormMainShow(Sender AS TObject)
UpdateLaserStatus
UpdateParameterStatus
UpdateProjectName
UpdatePreview
SetEvents
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
80 / 135
END SUB
SUB FormMainDestroy(Sender AS TObject)
UnsetEvents
END SUB
To free the object when the form ends, insert the following statement into the function FormMainDestroy:
SUB FormMainDestroy(Sender AS TObject)
LayoutData.Free
LayoutData = nothing
UnsetEvents
END SUB
Now that the data object is created at form startup and destroyed when closing the script. The object is now
ready for usage.
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
81 / 135
SpeedMark.ExecuteProject(Self.Handle)
END SUB
The enter key handling will be implemented in the EditKeyKeyPress event handler. In this case just the event
handler of the button search will be called:
SUB EditKeyKeyPress (Sender AS TObject, BYREF Key AS Char)
if Key = Chr(13) then
ButtonSearchKeyClick(Sender)
end if
END SUB
The search button click event will then handle the search, data update and preview handling:
SUB ButtonSearchKeyClick(Sender AS TObject)
if LayoutData.ReadData(EditKey.Text) then
UpdateLayoutAndPreview
else
ClearData
MsgBox("Reading the data failed!")
end if
' Focus and selct the key field for the next input
EditKey.SetFocus
EditKey.SelectAll
END SUB
In the button search event handler two unknown functions are introduced which have to be implemented:
ClearData, UpdateData and UpdateLayoutAndPreview:
SUB ClearData
' clear the input fields
EditKey.Text = ""
EditTextValue1.Text = ""
EditTextValue2.Text = ""
EditVectorGraphic.Text = ""
EditRasterGraphic.Text = ""
' clear the preview
ImagePreview.Picture.Bitmap = nothing
END SUB
SUB UpdateData
EditKey.Text = LayoutData.Key
EditTextValue1.Text = LayoutData.TextValue1
EditTextValue2.Text = LayoutData.TextValue2
EditVectorGraphic.Text = LayoutData.VectorGraphic
EditRasterGraphic.Text = LayoutData.RasterGraphic
END SUB
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
82 / 135
end if
' update the layout and reset the changes
try
try
UpdateLayout(LayoutProgram, LayoutData)
catch
MsgBox("Failure during update of layout: " + LastExceptionMessage)
ClearData
end
finally
LayoutProgram.Modified = False
SpeedMark.CurrentProject.Modified = False ' reset modified flags
end
' update the preview
Dim Bitmap as TBitmap
Bitmap = new TBitmap
try
LayoutProgram.Graphics.UpdateGraphics ' update all graphics to ensure that all values are
correctly calculated
LayoutProgram.CreatePreviewBitmap(Bitmap, ImagePreview.Width, ImagePreview.Height, 1)
ImagePreview.Picture.Assign(Bitmap)
finally
Bitmap.Free
Bitmap = nothing
end
END SUB
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
83 / 135
Debugging of scripts
The scripting IDE supports debugging of scripts line by line including function step in and variable watching.
Action
F4
Run to cursor
F5
Toggle breakpoint
F7
Step into
F8
Step over
F9
Run
Shift+F9
Pause
Ctrl+F2
Reset
Shift+F11
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
84 / 135
10
This chapter describes the available functions and classes in the different units. Unless all chapters are
important, three of them are important for daily use:
Description
Constants
Enumerations
Create method
The create methods stated in the class definitions show which parameters
have to be passed with the new statement. If no create method is defined no
parameters have to be passed
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
85 / 135
Returns
Parameters
Description
Abs
Float
X as Real
AnsiCompareStr
String
S1:String, S2 as String
AnsiCompareText
String
S1 as String, S2 as String
AnsiLowerCase
String
S as String
AnsiUpperCase
String
S as String
ArcTan
Float
X as extended
Assigned
Integer
P as Variant
Beep
Chdir
S as String
Chr
String
X as Byte
CompareStr
Integer
S1 as String, S2 as String
CompareText
Integer
S1 as String, S2:String
Copy
String
Cos
Float
X as extended
CreateOleObject
Variant
ClassName as String
Date
Float
DateTimeToStr
String
DateTime as TDateTime
DateToStr
String
DateTime as TDateTime
DayOfWeek
Integer
Datetime as TDateTime
Dec
Integer
byref X as Ordinal
DecodeDate
Integer
DecodeTime
Integer
Delete
String
EncodeDate
Float
EncodeTime
Float
Exp
Float
X as extended
FloatToStr
String
Value as extended
Format
String
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
86 / 135
Function name
Returns
Parameters
Description
VariantArray
FormatDateTime
Float
FormatFloat
String
Frac
Float
X as extended
GetActiveOleObject
Variant
ClassName as String
High
Integer
X as VariantArray
Inc
Integer
byref X as Ordinal
IncMonth
Float
DateTime as TDateTime,
NumberOfMonths as integer
InputQuery
String
Insert
String
Int
Integer
X as extended
Interpret
ScriptCode as String
IntToHex
String
IntToStr
String
Value as integer
IsLeapYear
Integer
Year as Word
IsValidIdent
Integer
Ident as String
Length
Integer
S as String
Ln
Float
X as extended
Low
Integer
X as VariantArray
LowerCase
String
S as String
Machine
Class
Now
Float
Odd
Boolean
X as integer
Ord
Integer
X as Ordinal
Pos
Integer
Random
Float
Round
Integer
Scripter
Class
SetOf
Set
Values as VariantArray
ShowMessage
String
Msg as String
Sin
Float
X as extended
Sqr
Float
X as Real
Sqrt
Float
X as extended
StrToDate
Float
S as String
StrToDateTime
Float
S as String
StrToFloat
Float
S as String
StrToInt
Integer
S as String
StrToIntDef
Integer
13/02/2013
X as Real
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
87 / 135
Function name
Returns
Parameters
StrToTime
Float
S as String
Time
Float
TimeToStr
String
DateTime as TDateTime
Trim
String
S as String
TrimLeft
String
S as String
TrimRight
String
S as String
Trunc
Integer
X as Real
UpperCase
String
S as string
VarArrayCreate
Variant
Bounds as VariantArray,
AVarType as integer
VarArrayHighBound
Integer
VarArrayLowBound
Integer
VarIsNull
Integer
V as Variant
VarToStr
String
V as Variant
Description
Returns
Parameters
AssignFile
TFileClass
Reset
F as File
Rewrite
F as File
Append
F as File
CloseFile
F as File
Write
F as File, Value
WriteLn
F as File, Value
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
88 / 135
Function name
Returns
Parameters
ReadLn
Variant
F as File
EOF
Variant
F as File
FilePos
Integer
F as File
FileSize
Integer
F as File
Description
24
Returns
Raise
Parameters
Description
ExceptionMsg as String
Property name
Returns
Description
LastExceptionMessage
String
LastExceptionHelpContext
Integer
LastExceptionClassName
String
Returns
Parameters
Asc
Integer
C as Char
Atn
Float
X as Extended
CBool
Boolean
V as Variant
CByte
Integer
V as Variant
CCur
Float
V as Variant
CDate
Float
V as Variant
CDbl
Float
V as Variant
CInt
Integer
V as Variant
CLng
Integer
V as Variant
CreateObject
Variant
ClassName as string
CSng
Float
V as Variant
CStr
String
V as Variant
DatePart
Integer
DateSerial
Float
DateValue
Float
DateTime as TDateTime
Day
Integer
DateTime as TDateTime
Fix
Integer
X as Real
FormatCurrency
String
FormatDateTime
String
24
Description
Find additional exception handling statements in 6.1.17 Try catch finally on page 40
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
89 / 135
Function name
Returns
Parameters
FormatNumber
String
Hex
String
X as Integer
Hour
Integer
DateTime as TDateTime
InputBox
Integer
InStr
Integer
Int
Integer
X as Real
IsArray
Boolean
V as Variant
IsDate
Boolean
V as Variant
IsEmpty
Boolean
V as Variant
IsNull
Boolean
V as Variant
IsNumeric
Boolean
V as Variant
Join
String
V as VariantArray, Delimiter as
Char = " "
LBound
Integer
V as VariantArray, Dim as
integer = 1
LCase
String
S as string
Left
String
Len
Integer
S as string
Log
Float
X as Extended
LTrim
String
S as string
Mid
String
Minute
Integer
DateTime as TDateTime
Month
Integer
DateTime as TDateTime
MonthName
String
MsgBox
Integer
Description
Randomize
???
Redim
Variant
???
10 Parameters
RedimPreserve
Variant
???
Replace
String
S as string, OldPattern as
string, NewPattern as string
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
90 / 135
Function name
Returns
Parameters
Right
String
Rnd
Float
???
RTrim
String
S as string
Second
Integer
DateTime as TDateTime
Sgn
Integer
X as Real
Space
String
Count as integer
Split
Variant
StrComp
Integer
S1 as string, S2 as string
String
String
StrReverse
String
S as string
Timer
Integer
TimeSerial
Float
TimeValue
Float
DateTime as TDateTime
UBound
Integer
V as VariantArray, Dim as
integer = 1
UCase
String
S as string
Weekday
Integer
DateTime as TDateTime
WeekdayName
String
DateTime as TDateTime,
ShortName as boolean
Year
Integer
DateTime as TDateTime
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
91 / 135
Returns
Description
Capacity
Integer
Count
Integer
Method name
Returns
Parameters
Description
Clear
Delete
Index as Integer
Error
Exchange
Expand
TList
Move
Pack
Assign
Class TStrings
Property name
Returns
Description
Capacity
Integer
Get/set
CommaText
Variant
Get/set
Count
Integer
Read-only.
Delimiter
Variant
Get/set
DelimitedText
Variant
Get/set
Names
Variant [ ]
Read-only.
Objects
TObject [ ]
Get/set
QuoteChar
Variant
Get/set
Values
Variant [ ]
Get/set
ValueFromIndex
Variant [ ]
Get/set
NameValueSeparator
Variant
Get/set
DefinePropStrings
Variant [ ]
Text
Variant
Get/set
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
92 / 135
Method name
Returns
Parameters
Description
Add
Integer
S as string
AddObject
Integer
Append
S as string
AddStrings
Strings as TStrings
Assign
Source as TPersistent
BeginUpdate
Clear
Delete
Index as Integer
EndUpdate
Equals
Variant
Exchange
Strings as TStrings
Index1 as Integer, Index2 as
Integer
GetText
Variant
IndexOf
Integer
S as string
IndexOfName
Integer
Name as string
IndexOfObject
Integer
AObject as TObject
Insert
InsertObject
LoadFromFile
FileName as string
LoadFromStream
Stream as TStream
Move
SaveToFile
FileName as string
SaveToStream
Stream as TStream
SetText
Text as PChar
Class TStringList
Enumeration name
Values
Description
TDuplicates
Property name
Returns
Description
Duplicates
TDuplicates
Get/set .
Sorted
Variant
Get/set
CaseSensitive
Variant
Get/set
Method name
Returns
Parameters
Add
Integer
S as string
AddObject
Integer
Description
Clear
Delete
Index as Integer
Exchange
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
93 / 135
Integer
Find
Variant
S as string, Index as
Integer).SetVarArgs([1]),
IndexOf
Integer
S as string
Insert
InsertObject
Sort
TStream
Property name
Returns
Description
Position
Variant
Get/set
Size
Variant
Get/set
Method name
Returns
Parameters
Read
Integer
Buffer, Count as
Longint).SetVarArgs([0]
Write
Integer
Seek
Integer
Description
ReadBuffer
Buffer, Count as
Longint).SetVarArgs([0]
WriteBuffer
CopyFrom
Variant
ReadComponent
TComponent
Instance as TComponent
ReadComponentRes
TComponent
Instance as TComponent
WriteComponent
Instance as TComponent
WriteComponentRes
WriteDescendent
Instance as TComponent,
Ancestor as TComponent
WriteDescendentRes
WriteResourceHeader
FixupResourceHeader
FixupInfo as Integer
ReadResHeader
Returns
Description
Handle
Integer
Read-only.
Method name
Returns
Parameters
Create
TFileStream
AHandle as Integer
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
94 / 135
Create
TFileStream
Read
Integer
Write
Integer
Returns
Description
DataString
Variant
Read-only.
Method name
Returns
Parameters
Create
TStringStream
AString as string
Read
Integer
ReadString
Variant
Count as Longint
Seek
Integer
Write
Integer
WriteString
Description
AString as string
Returns
Parameters
Read
Integer
Seek
Integer
SaveToStream
Stream as TStream
SaveToFile
FileName as string
Description
Returns
Parameters
Read
Integer
Seek
Integer
SaveToStream
Stream as TStream
SaveToFile
FileName as string
Description
Clear
LoadFromStream
Stream as TStream
LoadFromFile
FileName as string
SetSize
NewSize as Longint
Write
Integer
Returns
Parameters
Create
TResourceStream
Instance as THandle,
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
95 / 135
ResName as string,
ResType as PChar
CreateFromID
TResourceStream
Instance as THandle,
ResID as Integer,
ResType as PChar
Write
Integer
Returns
Description
CF_PICTURE
Integer
Get/set
CF_COMPONENT'
Integer
Get/set
Function name
Returns
Clipboard
TClipboard
SetClipboard
TClipboard
Parameters
Description
NewClipboard as
TClipboard
Class TClipborad
Property name
Returns
Description
AsText
Variant
Get/set
FormatCount
Integer
Read-only.
Formats
Integer [ ]
Read-only.
Method name
Returns
Assign
Parameters
Description
Source as TPersistent
Clear
Close
GetComponent
TComponent
Owner as TComponent,
Parent as TComponent
GetAsHandle
Integer
Format as Word
GetTextBuf
Integer
HasFormat
Variant
Format as Word
Open
SetComponent
Component as
TComponent
SetAsHandle
SetTextBuf
Buffer as PChar
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
96 / 135
Value
Description
Enumeration name
Values
Description
TDuplicates
TValueRelationship
-1 .. 1
Property name
Returns
Description
ApproxDaysPerMonth
Variant
Get/set
ApproxDaysPerYear
Variant
Get/set
Function name
Returns
Parameters
DateOf
Variant
AValue as TDateTime
TimeOf
Variant
AValue as TDateTime
IsInLeapYear
Variant
AValue as TDateTime
IsPM
Variant
AValue as TDateTime
IsValidDate
Variant
IsValidTime
Variant
DaysPerWeek
WeeksPerFortnight
MonthsPerYear
YearsPerDecade
YearsPerCentury
YearsPerMillennium
DayMonday
DayTuesday
DayWednesday
DayThursday
DayFriday
DaySaturday
DaySunday
OneHour
OneMinute
OneSecond
OneMillisecond
RecodeLeaveFieldAsIs
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
97 / 135
Function name
Returns
Parameters
Description
Word
IsValidDateTime
Variant
IsValidDateDay
Variant
AYear as Word,
ADayOfYear as Word
IsValidDateWeek
Variant
AYear as Word,
AWeekOfYear as Word,
ADayOfWeek as Word
IsValidDateMonthWeek
Variant
WeeksInYear
Integer
AValue as TDateTime
WeeksInAYear
Integer
AYear as Word
DaysInYear
Integer
AValue as TDateTime
DaysInAYear
Integer
AYear as Word
DaysInMonth
Integer
AValue as TDateTime
DaysInAMonth
Integer
Today
Variant
Yesterday
Variant
Tomorrow
Variant
IsToday
Variant
AValue as TDateTime
IsSameDay
Variant
AValue as TDateTime,
ABasis as TDateTime
YearOf
Integer
AValue as TDateTime
MonthOf
Integer
AValue as TDateTime
WeekOf
Integer
AValue as TDateTime
DayOf
Integer
AValue as TDateTime
HourOf
Integer
AValue as TDateTime
MinuteOf
Integer
AValue as TDateTime
SecondOf
Integer
AValue as TDateTime
MilliSecondOf
Integer
AValue as TDateTime
StartOfTheYear
Variant
AValue as TDateTime
EndOfTheYear
Variant
AValue as TDateTime
StartOfAYear
Variant
AYear as Word
EndOfAYear
Variant
AYear as Word
StartOfTheMonth
Variant
AValue as TDateTime
EndOfTheMonth
Variant
AValue as TDateTime
StartOfAMonth
Variant
EndOfAMonth
Variant
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
98 / 135
Function name
Returns
Parameters
StartOfTheWeek
Variant
AValue as TDateTime
EndOfTheWeek
Variant
AValue as TDateTime
StartOfAWeek
Variant
AYear as Word,
AWeekOfYear as Word,
ADayOfWeek as Word = 1
EndOfAWeek
Variant
AYear as Word,
AWeekOfYear as Word,
ADayOfWeek as Word = 7
StartOfTheDay
Variant
AValue as TDateTime
EndOfTheDay
Variant
AValue as TDateTime
StartOfADay
Variant
EndOfADay
Variant
MonthOfTheYear
Integer
AValue as TDateTime
WeekOfTheYear
Integer
AValue as TDateTime
DayOfTheYear
Integer
AValue as TDateTime
HourOfTheYear
Integer
AValue as TDateTime
MinuteOfTheYear
Integer
AValue as TDateTime
SecondOfTheYear
Integer
AValue as TDateTime
MilliSecondOfTheYear
Variant
AValue as TDateTime
WeekOfTheMonth
Integer
AValue as TDateTime
DayOfTheMonth
Integer
AValue as TDateTime
HourOfTheMonth
Integer
AValue as TDateTime
MinuteOfTheMonth
Integer
AValue as TDateTime
SecondOfTheMonth
Integer
AValue as TDateTime
MilliSecondOfTheMonth
Integer
AValue as TDateTime
DayOfTheWeek
Integer
AValue as TDateTime
HourOfTheWeek
Integer
AValue as TDateTime
MinuteOfTheWeek
Integer
AValue as TDateTime
SecondOfTheWeek
Integer
AValue as TDateTime
MilliSecondOfTheWeek
Integer
AValue as TDateTime
HourOfTheDay
Integer
AValue as TDateTime
MinuteOfTheDay
Integer
AValue as TDateTime
SecondOfTheDay
Integer
AValue as TDateTime
MilliSecondOfTheDay
Integer
AValue as TDateTime
MinuteOfTheHour
Integer
AValue as TDateTime
SecondOfTheHour
Integer
AValue as TDateTime
MilliSecondOfTheHour
Integer
AValue as TDateTime
SecondOfTheMinute
Integer
AValue as TDateTime
MilliSecondOfTheMinute
Integer
AValue as TDateTime
MilliSecondOfTheSecond
Integer
AValue as TDateTime
WithinPastYears
Variant
ANow as TDateTime,
AThen as TDateTime,
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
99 / 135
Function name
Returns
Parameters
Description
AYears as Integer
WithinPastMonths
Variant
ANow as TDateTime,
AThen as TDateTime,
AMonths as Integer
WithinPastWeeks
Variant
ANow as TDateTime,
AThen as TDateTime,
AWeeks as Integer
WithinPastDays
Variant
ANow as TDateTime,
AThen as TDateTime,
ADays as Integer
WithinPastHours
Variant
ANow as TDateTime,
AThen as TDateTime,
AHours as Int64
WithinPastMinutes
Variant
ANow as TDateTime,
AThen as TDateTime,
AMinutes as Int64
WithinPastSeconds
Variant
ANow as TDateTime,
AThen as TDateTime,
ASeconds as Int64
WithinPastMilliSeconds
Variant
ANow as TDateTime,
AThen as TDateTime,
AMilliSeconds as Int64
YearsBetween
Integer
ANow as TDateTime,
AThen as TDateTime
MonthsBetween
Integer
ANow as TDateTime,
AThen as TDateTime
WeeksBetween
Integer
ANow as TDateTime,
AThen as TDateTime
DaysBetween
Integer
ANow as TDateTime,
AThen as TDateTime
HoursBetween
Variant
ANow as TDateTime,
AThen as TDateTime
MinutesBetween
Variant
ANow as TDateTime,
AThen as TDateTime
SecondsBetween
Variant
ANow as TDateTime,
AThen as TDateTime
MilliSecondsBetween
Variant
ANow as TDateTime,
AThen as TDateTime
YearSpan
Variant
ANow as TDateTime,
AThen as TDateTime
MonthSpan
Variant
ANow as TDateTime,
AThen as TDateTime
WeekSpan
Variant
ANow as TDateTime,
AThen as TDateTime
DaySpan
Variant
ANow as TDateTime,
AThen as TDateTime
HourSpan
Variant
ANow as TDateTime,
AThen as TDateTime
MinuteSpan
Variant
ANow as TDateTime,
AThen as TDateTime
SecondSpan
Variant
ANow as TDateTime,
AThen as TDateTime
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
100 / 135
Function name
Returns
Parameters
MilliSecondSpan
Variant
ANow as TDateTime,
AThen as TDateTime
IncYear
Variant
AValue as TDateTime,
ANumberOfYears as
Integer = 1
IncWeek
Variant
AValue as TDateTime,
ANumberOfWeeks as
Integer = 1
IncDay
Variant
AValue as TDateTime,
ANumberOfDays as
Integer = 1
IncHour
Variant
AValue as TDateTime,
ANumberOfHours as Int64
=1
IncMinute
Variant
AValue as TDateTime,
ANumberOfMinutes as
Int64 = 1
IncSecond
Variant
AValue as TDateTime,
ANumberOfSeconds as
Int64 = 1
IncMilliSecond
Variant
AValue as TDateTime,
ANumberOfMilliSeconds
as Int64 = 1
EncodeDateTime
Variant
DecodeDateTime
AValue as TDateTime,
byref AYear as Word,
byref AMonth as Word,
byref ADay as Word, byref
AHour as Word, byref
AMinute as Word, byref
ASecond as Word, byref
AMilliSecond as Word
EncodeDateWeek
Variant
DecodeDateWeek
AYear as Word,
AWeekOfYear as Word,
ADayOfWeek as Word = 1
AValue as TDateTime,
byref AYear as Word,
byref AWeekOfYear as
Word, byref ADayOfWeek
as Word
EncodeDateDay
Variant
DecodeDateDay
AYear as Word,
ADayOfYear as Word
AValue as TDateTime,
byref AYear as Word,
byref ADayOfYear as
Word
EncodeDateMonthWeek
DecodeDateMonthWeek
13/02/2013
Description
Variant
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
101 / 135
Function name
Returns
Parameters
Description
Variant
TryEncodeDateWeek
Variant
AYear as Word,
AWeekOfYear as Word,
AValue as TDateTime,
ADayOfWeek as Word =
1).SetVarArgs([2]
TryEncodeDateDay
Variant
AYear as Word,
ADayOfYear as Word,
AValue as
TDateTime).SetVarArgs([2
]
TryEncodeDateMonthWe
ek
Variant
RecodeYear
Variant
AValue as TDateTime,
AYear as Word
RecodeMonth
Variant
AValue as TDateTime,
AMonth as Word
RecodeDay
Variant
AValue as TDateTime,
ADay as Word
RecodeHour
Variant
AValue as TDateTime,
AHour as Word
RecodeMinute
Variant
AValue as TDateTime,
AMinute as Word
RecodeSecond
Variant
AValue as TDateTime,
ASecond as Word
RecodeMilliSecond
Variant
AValue as TDateTime,
AMilliSecond as Word
RecodeDate
Variant
AValue as TDateTime,
AYear as Word, AMonth
as Word, ADay as Word
RecodeTime
Variant
AValue as TDateTime,
AHour as Word, AMinute
as Word, ASecond as
Word, AMilliSecond as
Word
RecodeDateTime
Variant
AValue as TDateTime,
AYear as Word, AMonth
as Word, ADay as Word,
AHour as Word, AMinute
as Word, ASecond as
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
102 / 135
Function name
Returns
Parameters
Description
Word, AMilliSecond as
Word
TryRecodeDateTime
Variant
AValue as TDateTime,
AYear as Word, AMonth
as Word, ADay as Word,
AHour as Word, AMinute
as Word, ASecond as
Word, AMilliSecond as
Word, byref AResult as
TdateTime
CompareDateTime
TValueRelationshi
p
A as TDateTime, B as
TdateTime
SameDateTime
Variant
A as TDateTime, B as
TdateTime
CompareDate
TValueRelationshi
p
A as TDateTime, B as
TdateTime
SameDate
Variant
A as TDateTime, B as
TdateTime
CompareTime
TValueRelationshi
p
A as TDateTime, B as
TdateTime
SameTime
Variant
A as TDateTime, B as
TdateTime
NthDayOfWeek
Integer
AValue as TDateTime
DecodeDayOfWeekInMo
nth
AValue as TDateTime,
byref AYear as Word,
byref AMonth as Word,
byref ANthDayOfWeek as
Word, byref ADayOfWeek
as Word
EncodeDayOfWeekInMo
nth
Variant
TryEncodeDayOfWeekIn
Month
Variant
InvalidDateTimeError
InvalidDateWeekError
AYear as Word,
AWeekOfYear as Word,
ADayOfWeek as Word
InvalidDateDayError
AYear as Word,
ADayOfYear as Word
InvalidDateMonthWeekEr
ror
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
103 / 135
Function name
Returns
InvalidDayOfWeekInMont
hError
Parameters
Description
DateTimeToJulianDate
Variant
AValue as TDateTime
JulianDateToDateTime
Variant
AValue as Double
TryJulianDateToDateTim
e
Variant
DateTimeToModifiedJulia
nDate
Variant
AValue as TDateTime
ModifiedJulianDateToDat
eTime
Variant
AValue as Double
TryModifiedJulianDateTo
DateTime
Variant
DateTimeToUnix
Variant
AValue as TDateTime
UnixToDateTime
Variant
AValue as Int64
Returns
Description
FileName
Variant
Read-only.
Method name
Returns
Parameters
Create
TCustomIniFile
FileName as string
SectionExists
Variant
Section as string
ReadString
Variant
WriteString
ReadInteger
WriteInteger
ReadBool
Variant
WriteBool
ReadBinaryStream
Integer
ReadDate
Variant
ReadDateTime
Variant
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
104 / 135
Method name
Returns
Parameters
Description
ReadFloat
Variant
ReadTime
Variant
WriteBinaryStream
WriteDate
WriteDateTime
WriteFloat
WriteTime
ReadSection
ReadSections
Strings as TStrings
ReadSectionValues
EraseSection
Section as string
DeleteKey
UpdateFile
ValueExists
Variant
Returns
Description
CaseSensitive
Variant
Get/set
Method name
Returns
Parameters
Create
TMemIniFile
FileName as string
Description
Clear
DeleteKey
EraseSection
Section as string
GetStrings
List as TStrings
ReadSection
ReadSections
Strings as TStrings
ReadSectionValues
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
105 / 135
Method name
Returns
Parameters
Description
ReadString
Variant
Rename
SetStrings
List as TStrings
UpdateFile
WriteString
Returns
Parameters
Description
ReadString
Variant
WriteString
ReadSection
ReadSections
Strings as TStrings
ReadSectionValues
EraseSection
Section as string
DeleteKey
UpdateFile
Value
MinSingle
1.5e-45
MaxSingle
3.4e+38
MinDouble
5.0e-324
MaxDouble
1.7e+308
NaN
0.0 / 0.0
Infinity
1.0 / 0.0
NegInfinity
-1.0 / 0.0
NegativeValue
-1
ZeroValue
PositiveValue
Enumeration name
Values
TValueSign
-1..1
13/02/2013
Description
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
106 / 135
Enumeration name
Values
TValueRelationship
-1..1
TPaymentTime
ptEndOfPeriod, ptStartOfPeriod
TFPURoundingMode
TFPUPrecisionMode
pmSingle, pmReserved,
pmDouble, pmExtended
TFPUException
exInvalidOp, exDenormalized,
exZeroDivide, exOverflow,
exUnderflow, exPrecision
Function name
Returns
Parameters
ArcCos
Variant
X as Extended
ArcSin
Variant
X as Extended
ArcTan2
Variant
Y as Extended, X as
Extended
SinCos
Description
Tan
Variant
X as Extended
Cotan
Variant
X as Extended
Secant
Variant
X as Extended
Cosecant
Variant
X as Extended
Hypot
Variant
X as Extended, Y as
Extended
RadToDeg
Variant
Radians as Extended
RadToGrad
Variant
Radians as Extended
RadToCycle
Variant
Radians as Extended
DegToRad
Variant
Degrees as Extended
DegToGrad
Variant
Degrees as Extended
DegToCycle
Variant
Degrees as Extended
GradToRad
Variant
Grads as Extended
GradToDeg
Variant
Grads as Extended
GradToCycle
Variant
Grads as Extended
CycleToRad
Variant
Cycles as Extended
CycleToDeg
Variant
Cycles as Extended
CycleToGrad
Variant
Cycles as Extended
Cot
Variant
X as Extended
Sec
Variant
X as Extended
Csc
Variant
X as Extended
Cosh
Variant
X as Extended
Sinh
Variant
X as Extended
Tanh
Variant
X as Extended
CotH
Variant
X as Extended
SecH
Variant
X as Extended
CscH
Variant
X as Extended
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
107 / 135
Function name
Returns
Parameters
ArcCot
Variant
X as Extended
ArcSec
Variant
X as Extended
ArcCsc
Variant
X as Extended
ArcCosh
Variant
X as Extended
ArcSinh
Variant
X as Extended
ArcTanh
Variant
X as Extended
ArcCotH
Variant
X as Extended
ArcSecH
Variant
X as Extended
ArcCscH
Variant
X as Extended
LnXP1
Variant
X as Extended
Log10
Variant
X as Extended
Log2
Variant
X as Extended
LogN
Variant
Base as Extended, X as
Extended
IntPower
Variant
Base as Extended,
Exponent as Integer
Power
Variant
Base as Extended,
Exponent as Extended
Frexp
X as Extended, byref
Mantissa as Extended,
byref Exponent as Integer
Ldexp
Variant
X as Extended, P as
Integer
Ceil
Integer
X as Extended
Floor
Integer
X as Extended
Min
Integer
A as Integer, B as Integer
Max
Integer
A as Integer, B as Integer
RandG
Variant
Mean as Extended,
StdDev as Extended
IsNan
Variant
AValue as Double
IsInfinite
Variant
AValue as Double
Sign
TValueSign
AValue as Integer
CompareValue
TValueRelationship
A as Extended, B as
Extended, Epsilon as
Extended = 0
SameValue
Variant
A as Extended, B as
Extended, Epsilon as
Extended = 0
IsZero
Variant
A as Extended, Epsilon as
Extended = 0
IfThen
Integer
RandomRange
Integer
InRange
Variant
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
108 / 135
Function name
Returns
Parameters
Description
Integer
EnsureRange
Integer
DivMod
RoundTo
Variant
SimpleRoundTo
Variant
DoubleDecliningBalance
Variant
Cost as Extended,
Salvage as Extended, Life
as Integer, Period as
Integer
FutureValue
Variant
Rate as Extended,
NPeriods as Integer,
Payment as Extended,
PresentValue as
Extended, PaymentTime
as TPaymentTime
InterestPayment
Variant
InterestRate
Variant
NPeriods as Integer,
Payment as Extended,
PresentValue as
Extended, FutureValue as
Extended, PaymentTime
as TPaymentTime
NumberOfPeriods
Variant
Rate as Extended,
Payment as Extended,
PresentValue as
Extended, FutureValue as
Extended, PaymentTime
as TPaymentTime
Payment
Variant
Rate as Extended,
NPeriods as Integer,
PresentValue as
Extended, FutureValue as
Extended, PaymentTime
as TPaymentTime
PeriodPayment
Variant
PresentValue
Variant
Rate as Extended,
NPeriods as Integer,
Payment as Extended,
FutureValue as Extended,
PaymentTime as
TPaymentTime
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
109 / 135
Function name
Returns
Parameters
SLNDepreciation
Variant
Cost as Extended,
Salvage as Extended, Life
as Integer
SYDDepreciation
Variant
Cost as Extended,
Salvage as Extended, Life
as Integer, Period as
Integer
GetRoundMode
TFPURoundingMode
SetRoundMode
TFPURoundingMode
GetPrecisionMode
TFPUPrecisionMode
SetPrecisionMode
TFPUPrecisionMode
GetExceptionMask
TFPUExceptionMask
SetExceptionMask
TFPUExceptionMask
ClearExceptions
Description
RoundMode as
TFPURoundingMode
Precision as
TFPUPrecisionMode
Mask as
TFPUExceptionMask
RaisePending as Boolean
= True
Values
Description
TRegDataType
rdUnknown, rdString,
rdExpandString, rdInteger,
rdBinary
Record TRegDataInfo
Element name
Returns
Description
RegData
TRegDataType
Get/set
DataSize
Integer
Get/set
Property name
Returns
Description
CurrentKey
Integer
Read-only.
CurrentPath
Variant
Read-only.
LazyWrite
Variant
Get/set
RootKey
Integer
Get/set
Access
Integer
Get/set
Method name
Returns
Create
TRegistry
Class TRegistry
Parameters
Description
CloseKey
CreateKey
13/02/2013
Variant
Key as string
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
110 / 135
Method name
Returns
Parameters
DeleteKey
Variant
Key as string
DeleteValue
Variant
Name as string
GetDataInfo
Variant
GetDataSize
Integer
ValueName as string
GetDataType
TRegDataType
ValueName as string
GetKeyInfo
Variant
Byref Value as
TRegKeyInfo
GetKeyNames
Strings as TStrings
GetValueNames
Strings as TStrings
HasSubKeys
Variant
KeyExists
Variant
Key as string
LoadKey
Variant
MoveKey
OldName as string,
NewName as string, Delete
as Boolean
OpenKey
Variant
OpenKeyReadOnly
Variant
Key as String
ReadCurrency
Variant
Name as string
ReadBinaryData
Integer
ReadBool
Variant
Name as string
ReadDate
Variant
Name as string
ReadDateTime
Variant
Name as string
ReadFloat
Variant
Name as string
ReadInteger
Integer
Name as string
ReadString
Variant
Name as string
ReadTime
Variant
Name as string
RegistryConnect
Variant
UNCName as string
RenameValue
OldName as string,
NewName as string
ReplaceKey
Variant
RestoreKey
Variant
SaveKey
Variant
UnLoadKey
Variant
Key as string
ValueExists
Variant
Name as string
WriteCurrency
WriteBinaryData
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
111 / 135
Method name
Returns
Parameters
WriteBool
WriteDate
WriteDateTime
WriteFloat
WriteInteger
WriteString
WriteExpandString
WriteTime
Description
Returns
Parameters
Create
TRegistryIniFile
FileName as string
ReadDate
Variant
ReadDateTime
Variant
ReadInteger
Integer
ReadFloat
Variant
ReadString
Variant
ReadTime
Variant
ReadBinaryStream
Integer
WriteDate
WriteDateTime
WriteFloat
WriteInteger
WriteString
WriteTime
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
112 / 135
WriteBinaryStream
ReadSection
ReadSections
Strings as TStrings
ReadSectionValues
EraseSection
Section as string
DeleteKey
UpdateFile
Values
TStringSeachOption
soDown, soMatchCase,
soWholeWord
Property name
Returns
Description
WordDelimiters
Integer
Read-only.
Function name
Returns
Parameters
AnsiResemblesText
Variant
AnsiContainsText
Variant
AnsiStartsText
Variant
AnsiEndsText
Variant
AnsiReplaceText
Variant
AnsiContainsStr
Variant
AnsiStartsStr
Variant
AnsiEndsStr
Variant
AnsiReplaceStr
Variant
DupeString
Variant
ReverseString
Variant
AText as string
AnsiReverseString
Variant
AText as AnsiString
StuffString
Variant
13/02/2013
Description
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
113 / 135
string
IfThen
Variant
LeftStr
Variant
AText as AnsiString,
ACount as Integer
RightStr
Variant
AText as AnsiString,
ACount as Integer
MidStr
Variant
LeftBStr
Variant
AText as AnsiString,
AByteCount as Integer
RightBStr
Variant
AText as AnsiString,
AByteCount as Integer
MidBStr
Variant
AText as AnsiString,
AByteStart as Integer,
AByteCount as Integer
AnsiLeftStr
Variant
AText as AnsiString,
ACount as Integer
AnsiRightStr
Variant
AText as AnsiString,
ACount as Integer
AnsiMidStr
Variant
SearchBuf
Variant
PosEx
Integer
SubStr as string, S as
string, Offset as Cardinal =
1
Soundex
Variant
SoundexInt
Integer
DecodeSoundexInt
Variant
AValue as Integer
SoundexWord
Integer
AText as string
DecodeSoundexWord
Variant
AValue as Word
SoundexSimilar
Variant
SoundexCompare
Integer
SoundexProc
Variant
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
114 / 135
Value
fmOpenRead
0x0000
fmOpenWrite
0x0001
fmOpenReadWrite
0x0002
fmShareCompat
0x0000
fmShareExclusive
0x0010
fmShareDenyWrite
0x0020
fmShareDenyRead
0x0030
fmShareDenyNone
0x0040
faReadOnly
0x00000001
faHidden
0x00000002
faSysFile
0x00000004
faVolumeID
0x00000008
faDirectory
0x00000010
faArchive
0x00000020
faSymLink
0x00000040
faAnyFile
0x0000003F
HoursPerDay
24
MinsPerHour
60
SecsPerMin
60
MsecsPerSec
1000
MinsPerDay
HoursPerDay * MinsPerHour
SecsPerDay
MinsPerDay * SecsPerMin
MsecsPerDay
SecsPerDay * MSecsPerSec
DateDelta
693594
UnixDateDelta
25569
MaxEraCount
PathDelim
PathSep
DefaultTrueBoolStr
True
DefaultFalseBoolStr
False
Enumeration name
Values
TFloatValue
fvExtended, fvCurrency
TFloatFormat
TMbcsByteType
mbSingleByte, mbLeadByte,
mbTrailByte
TFilenameCaseMatch
mkNone, mkExactMatch,
mkSingleMatch, mkAmbiguous
13/02/2013
Description
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
115 / 135
Property name
Returns
Description
EmptyStr
Variant
Get/set
EmptyWideStr
Variant
Get/set
Win32Platform
Integer
Get/set
Win32MajorVersion
Integer
Get/set
Win32MinorVersion
Integer
Get/set
Win32BuildNumber
Integer
Get/set
Win32CSDVersion
Variant
Get/set
CurrencyString
Variant
Get/set
CurrencyFormat
Integer
Get/set
NegCurrFormat
Integer
Get/set
ThousandSeparator
Variant
Get/set
DecimalSeparator
Variant
Get/set
CurrencyDecimals
Integer
Get/set
DateSeparator
Variant
Get/set
ShortDateFormat
Variant
Get/set
LongDateFormat
Variant
Get/set
TimeSeparator
Variant
Get/set
TimeAMString
Variant
Get/set
TimePMString
Variant
Get/set
ShortTimeFormat
Variant
Get/set
LongTimeFormat
Variant
Get/set
SysLocale
Variant
Get/set
TwoDigitYearCenturyWin
dow
Integer
Get/set
ListSeparator
Variant
Get/set
MinCurrency
Variant
Read-only.
MaxCurrency
Variant
Read-only.
MinDateTime
Variant
Read-only.
MaxDateTime
Variant
Read-only.
LeadBytes
Integer
Get/set
HexDisplayPrefix
Variant
Get/set
Function name
Returns
Parameters
CheckWin32Version
Variant
GetFileVersion
Integer
AFileName as string
Languages
TLanguages
AppendStr
UpperCase
Variant
S as string
LowerCase
Variant
S as string
CompareStr
Integer
S1 as string, S2 as string
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
116 / 135
Function name
Returns
Parameters
CompareText
Integer
S1 as string, S2 as string
SameText
Variant
S1 as string, S2 as string
AnsiUpperCase
Variant
S as string
AnsiLowerCase
Variant
S as string
AnsiCompareStr
Integer
S1 as string, S2 as string
AnsiSameStr
Variant
S1 as string, S2 as string
AnsiCompareText
Integer
S1 as string, S2 as string
AnsiSameText
Variant
S1 as string, S2 as string
AnsiStrComp
Integer
S1 as PChar, S2 as PChar
AnsiStrIComp
Integer
S1 as PChar, S2 as PChar
AnsiStrLComp
Integer
S1 as PChar, S2 as PChar,
MaxLen as Cardinal
AnsiStrLIComp
Integer
S1 as PChar, S2 as PChar,
MaxLen as Cardinal
AnsiStrLower
Variant
Str as PChar
AnsiStrUpper
Variant
Str as PChar
AnsiLastChar
Variant
S as string
AnsiStrLastChar
Variant
P as PChar
WideUpperCase
Variant
S as WideString
WideLowerCase
Variant
S as WideString
WideCompareStr
Integer
S1 as WideString, S2 as
WideString
WideSameStr
Variant
S1 as WideString, S2 as
WideString
WideCompareText
Integer
S1 as WideString, S2 as
WideString
WideSameText
Variant
S1 as WideString, S2 as
WideString
Trim
Variant
S as string
TrimLeft
Variant
S as string
TrimRight
Variant
S as string
QuotedStr
Variant
S as string
AnsiQuotedStr
Variant
AnsiExtractQuotedStr
Variant
AnsiDequotedStr
Variant
S as string, AQuote as
Char
AdjustLineBreaks
Variant
S as string, Style as
TTextLineBreakStyle =
tlbsCRLF
IsValidIdent
Variant
Ident as string
IntToStr
Variant
Value as Integer
IntToHex
Variant
StrToInt
Integer
S as string
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
117 / 135
Function name
Returns
Parameters
StrToIntDef
Integer
S as string, Default as
Integer
TryStrToInt
Variant
StrToInt64
Variant
S as string
StrToInt64Def
Variant
S as string, Default as
Int64
TryStrToInt64
Variant
StrToBool
Variant
S as string
StrToBoolDef
Variant
S as string, Default as
Boolean
TryStrToBool
Variant
BoolToStr
Variant
B as Boolean, UseBoolStrs
as Boolean = False
LoadStr
Variant
Ident as Integer
FileOpen
Integer
FileCreate
Integer
FileName as string
FileRead
Integer
FileWrite
Integer
FileSeek
Integer
FileClose
Handle as Integer
FileAge
Integer
FileName as string
FileExists
Variant
FileName as string
DirectoryExists
Variant
Directory as string
ForceDirectories
Variant
Dir as string
FindFirst
Integer
FindNext
Integer
byref F as TSearchRec
FindClose
byref F as TSearchRec
FileGetDate
Integer
Handle as Integer
FileSetDate
Integer
FileGetAttr
Integer
FileName as string
FileSetAttr
Integer
FileIsReadOnly
Variant
FileName as string
FileSetReadOnly
Variant
FileName as string,
ReadOnly as Boolean
DeleteFile
Variant
FileName as string
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
118 / 135
Function name
Returns
Parameters
RenameFile
Variant
OldName as string,
NewName as string
ChangeFileExt
Variant
FileName as string,
Extension as string
ExtractFilePath
Variant
FileName as string
ExtractFileDir
Variant
FileName as string
ExtractFileDrive
Variant
FileName as string
ExtractFileName
Variant
FileName as string
ExtractFileExt
Variant
FileName as string
ExpandFileName
Variant
FileName as string
ExpandFileNameCase
Variant
ExpandUNCFileName
Variant
FileName as string
ExtractRelativePath
Variant
BaseName as string,
DestName as string
ExtractShortPathName
Variant
FileName as string
FileSearch
Variant
DiskFree
Variant
Drive as Byte
DiskSize
Variant
Drive as Byte
FileDateToDateTime
Variant
FileDate as Integer
DateTimeToFileDate
Integer
DateTime as TDateTime
GetCurrentDir
Variant
SetCurrentDir
Variant
Dir as string
CreateDir
Variant
Dir as string
RemoveDir
Variant
Dir as string
StrLen
Integer
Str as PChar
StrEnd
Variant
Str as PChar
StrMove
Variant
StrCopy
Variant
StrECopy
Variant
StrLCopy
Variant
StrPCopy
Variant
StrPLCopy
Variant
StrCat
Variant
StrLCat
Variant
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
119 / 135
Function name
Returns
Parameters
StrComp
Integer
StrIComp
Integer
StrLComp
Integer
StrLIComp
Integer
StrScan
Variant
StrRScan
Variant
StrPos
Variant
StrUpper
Variant
Str as PChar
StrLower
Variant
Str as PChar
StrPas
Variant
Str as PChar
StrAlloc
Variant
Size as Cardinal
StrBufSize
Integer
Str as PChar
StrNew
Variant
Str as PChar
StrDispose
Str as PChar
FloatToStr
Variant
Value as Extended
CurrToStr
Variant
Value as Currency
FloatToCurr
Variant
Value as Extended
TryFloatToCurr
Variant
FloatToStrF
Variant
CurrToStrF
Variant
FloatToText
Integer
FormatFloat
Variant
FormatCurr
Variant
FloatToTextFmt
Integer
StrToFloat
Variant
S as string
StrToFloatDef
Variant
S as string, Default as
Extended
TryStrToFloat
Variant
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
120 / 135
Function name
Returns
Parameters
StrToCurr
Variant
S as string
StrToCurrDef
Variant
S as string, Default as
Currency
TryStrToCurr
Variant
TextToFloat
Variant
FloatToDecimal
DateTimeToTimeStamp
Variant
DateTime as TDateTime
TimeStampToDateTime
Variant
TimeStamp as
TTimeStamp
MSecsToTimeStamp
Variant
MSecs as Comp
TimeStampToMSecs
Variant
TimeStamp as
TTimeStamp
EncodeDate
Variant
EncodeTime
Variant
TryEncodeDate
Variant
TryEncodeTime
Variant
DecodeDate
DateTime as TDateTime,
byref Year as Word, byref
Month as Word, byref Day
as Word
DecodeDateFully
Variant
DateTime as TDateTime,
byref Year as Word, byref
Month as Word, byref Day
as Word, baref DOW as
Word
DecodeTime
DateTime as TDateTime,
byref Hour as Word, byref
Min as Word, byref Sec as
Word, byref MSec as Word
DateTimeToSystemTime
DateTime as TDateTime,
byref SystemTime as
TSystemTime
SystemTimeToDateTime
Variant
SystemTime as
TSystemTime
DayOfWeek
Integer
DateTime as TDateTime
Date
Variant
Time
Variant
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
121 / 135
Function name
Returns
GetTime
Variant
Now
Variant
CurrentYear
Integer
IncMonth
Variant
Parameters
DateTime as TDateTime,
NumberOfMonths as
Integer = 1
IncAMonth
ReplaceTime
byref DateTime as
TDateTime, NewTime as
TDateTime
ReplaceDate
byref DateTime as
TDateTime, NewDate as
TDateTime
IsLeapYear
Variant
Year as Word
DateToStr
Variant
DateTime as TDateTime
TimeToStr
Variant
DateTime as TDateTime
DateTimeToStr
Variant
DateTime as TDateTime
StrToDate
Variant
S as string
StrToDateDef
Variant
S as string, Default as
TDateTime
TryStrToDate
Variant
StrToTime
Variant
S as string
StrToTimeDef
Variant
S as string, Default as
TDateTime
TryStrToTime
Variant
StrToDateTime
Variant
S as string
StrToDateTimeDef
Variant
S as string, Default as
TDateTime
TryStrToDateTime
Variant
FormatDateTime
Variant
DateTimeToString
FloatToDateTime
Variant
Value as Extended
TryFloatToDateTime
Variant
SysErrorMessage
Variant
ErrorCode as Integer
GetLocaleStr
Variant
Locale as Integer,
LocaleType as Integer,
Default as string
GetLocaleChar
Variant
Locale as Integer,
LocaleType as Integer,
Default as Char
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
122 / 135
Function name
Returns
Parameters
Description
GetFormatSettings
GetLocaleFormatSettings
Sleep
milliseconds as Cardinal
GetModuleName
Variant
Module as HMODULE
ByteType
TMbcsByteType
S as string, Index as
Integer
StrByteType
TMbcsByteType
ByteToCharLen
Integer
S as string, MaxLen as
Integer
CharToByteLen
Integer
S as string, MaxLen as
Integer
ByteToCharIndex
Integer
S as string, Index as
Integer
CharToByteIndex
Integer
S as string, Index as
Integer
StrCharLength
Integer
Str as PChar
StrNextChar
Variant
Str as PChar
CharLength
Integer
S as String, Index as
Integer
NextCharIndex
Integer
S as String, Index as
Integer
IsPathDelimiter
Variant
S as string, Index as
Integer
IsDelimiter
Variant
Delimiters as string, S as
string, Index as Integer
IncludeTrailingPathDelimi
ter
Variant
S as string
IncludeTrailingBackslash
Variant
S as string
ExcludeTrailingPathDelim
iter
Variant
S as string
ExcludeTrailingBackslash
Variant
S as string
LastDelimiter
Integer
Delimiters as string, S as
string
AnsiCompareFileName
Integer
S1 as string, S2 as string
SameFileName
Variant
S1 as string, S2 as string
AnsiLowerCaseFileName
Variant
S as string
AnsiUpperCaseFileName
Variant
S as string
AnsiPos
Integer
Substr as string, S as
string
AnsiStrPos
Variant
Abort
OutOfMemoryError
Beep
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
123 / 135
Function name
Returns
Parameters
AnsiStrRScan
Variant
AnsiStrScan
Variant
StringReplace
Variant
S as string, OldPattern as
string, NewPattern as
string, Flags as
TReplaceFlags
WrapText
Variant
FindCmdLineSwitch
Variant
FreeAndNil
Description
byref Obj
Supports
Variant
CreateGUID
Integer
StringToGUID
Variant
S as string
GUIDToString
Variant
GUID as TGUID
IsEqualGUID
Variant
LoadPackage
Integer
Name as string
UnloadPackage
Module as HMODULE
GetPackageDescription
Variant
ModuleName as PChar
InitializePackage
Module as HMODULE
FinalizePackage
Module as HMODULE
RaiseLastOSError
RaiseLastWin32Error
Win32Check
Variant
CallTerminateProcs
Variant
GDAL
Integer
RetVal as BOOL
RCS
RPR
SafeLoadLibrary
Integer
FileName as string,
ErrorMode as UINT =
SEM_NOOPENFILEERRO
RBOX
GetEnvironmentVariable
Variant
Name as string
Class TLanguages
Property name
Returns
Count
Integer
Name
Variant [ ]
NameFromLocaleID
Variant [ ]
NameFromLCID
Variant [ ]
ID
Variant [ ]
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
124 / 135
LocaleID
Integer [ ]
Ext
Variant [ ]
Method name
Returns
Create
TLanguages
IndexOf
Integer
Parameters
Description
ID as LCID
Returns
TextFileList
TTextFileList
Description
TTextFileList class
Method name
Returns
Parameters
Description
Clear
NewFile
FileName as string
LoadFile
FileName as string
SaveFile
FileName as string
ClearFile
FileName as string
GetFileLine
Variant
AddFileLine
DelFileLine
SetFileLine
GetFileLineCount
Integer
FileName as string
FindInFile
Integer
FileExists
Variant
FileName as string
DeleteFile
Variant
FileName as string
CopyFile
Variant
SourceFileName as string,
TargetFileName as string
RenameFile
Variant
SourceFileName as string,
TargetFileName as string
MoveFile
Variant
SourceFileName as string,
TargetFileName as string
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
125 / 135
Returns
Parameters
WideChr
WideString
X as Word
WideUpperCase
Variant
S as WideString
WideLowerCase
Variant
S as WideString
WideLastChar
Variant
S as WideString
WideStringReplace
Variant
S as WideString, OldPattern as
WideString, NewPattern as
WideString, Flags as
TReplaceFlags, WholeWord as
Boolean = False
WideWrapText
Variant
WideIncludeTrailingBacks
lash
Variant
S as WideString
WideIncludeTrailingPathD
elimiter
Variant
S as WideString
WideExcludeTrailingBack
slash
Variant
S as WideString
WideExcludeTrailingPath
Delimiter
Variant
S as WideString
WideIsDelimiter
Variant
Delimiters as WideString, S as
WideString, Index as Integer
WideIsPathDelimiter
Variant
S as WideString, Index as
Integer
WideLastDelimiter
Integer
Delimiters as WideString, S as
WideString
WideChangeFileExt
Variant
FileName as WideString,
Extension as WideString
WideExtractFilePath
Variant
FileName as WideString
WideExtractFileDir
Variant
FileName as WideString
WideExtractFileDrive
Variant
FileName as WideString
WideExtractFileName
Variant
FileName as WideString
WideExtractFileExt
Variant
FileName as WideString
WideExtractRelativePath
Variant
BaseName as WideString,
DestName as WideString
WideExpandFileName
Variant
FileName as WideString
WideExtractShortPathNa
me
Variant
FileName as WideString
WideFileCreate
Integer
FileName as WideString
WideFileOpen
Integer
WideFileAge
Integer
FileName as WideString
WideDirectoryExists
Variant
Name as WideString
WideFileExists
Variant
Name as WideString
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
126 / 135
Function name
Returns
Parameters
WideFileGetAttr
Integer
FileName as WideString
WideFileSetAttr
Variant
WideFileIsReadOnly
Variant
FileName as WideString
WideFileSetReadOnly
Variant
FileName as WideString,
ReadOnly as Boolean
WideRenameFile
Variant
OldName as WideString,
NewName as WideString
WideDeleteFile
Variant
FileName as WideString
WideCopyFile
Variant
WideCreateDir
Variant
Dir as WideString
WideRemoveDir
Variant
Dir as WideString
WideGetCurrentDir
Variant
WideSetCurrentDir
Variant
Dir as WideString
WideTryStrToDateTime
Variant
WideTryStrToDate
Variant
WideTryStrToTime
Variant
WideValidDateTimeStr
Variant
Str as WideString
WideValidDateStr
Variant
Str as WideString
WideValidTimeStr
Variant
Str as WideString
WideStrToDateTime
Variant
Str as WideString
WideStrToDate
Variant
Str as WideString
WideStrToTime
Variant
Str as WideString
WideStrToDateTimeDef
Variant
WideTextPos
Integer
SubStr as WideString, S as
WideString
WideAsc
Integer
C as WideChar
WideInStr
Integer
WideLen
Integer
S as WideString
WideLeft
WideString
S as WideString, Count as
integer
WideMid
WideString
S as WideString, Index as
integer, Count as integer
WideRight
WideString
S as WideString, Count as
integer
WideLTrim
WideString
S as WideString
WideRTrim
WideString
S as WideString
WideLCase
WideString
S as WideString
WideUCase
WideString
S as WideString
13/02/2013
Description
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
127 / 135
Function name
Returns
Parameters
Description
WideReplace
WideString
S as WideString, OldPattern as
WideString, NewPattern as
WideString
WideSpace
WideString
Count as integer
WideStrComp
Integer
S1 as WideString, S2 as
WideString
WideString
WideString
Count as integer, C as
WideChar
WideSplit
Variant
S as WideString, Delimiter as
WideChar = " ", Count as
integer=-1
WideJoin
WideString
V as VariantArray, Delimiter as
WideChar = " "
WideStrReverse
WideString
S as WideString
Values
TVarCompareResult
crLessThan, crEqual,
crGreaterThan
TVariantRelationship
vrEqual, vrLessThan,
vrGreaterThan, vrNotEqual
TNullCompareRule
TBooleanToStringRule
Property name
Returns
EmptyParam
Variant
NullEqualityRule
TNullCompareRule
NullMagnitudeRule
TNullCompareRule
NullStrictConvert
Variant
NullAsStringValue
Variant
PackVarCreation
Variant
BooleanToStringRule
TBooleanToStringRule
Function name
Returns
Parameters
VarType
Integer
V as Variant
VarAsType
Variant
V as Variant, AVarType as
TVarType
VarIsType
Variant
V as Variant, AVarType as
TVarType
VarIsByRef
Variant
V as Variant
VarIsEmpty
Variant
V as Variant
VarCheckEmpty
VarIsNull
13/02/2013
Description
Description
Description
V as Variant
Variant
V as Variant
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
128 / 135
Function name
Returns
Parameters
VarIsClear
Variant
V as Variant
VarIsCustom
Variant
V as Variant
VarIsOrdinal
Variant
V as Variant
VarIsFloat
Variant
V as Variant
VarIsNumeric
Variant
V as Variant
VarIsStr
Variant
V as Variant
VarToStr
Variant
V as Variant
VarToStrDef
Variant
V as Variant, ADefault as
string
VarToWideStr
Variant
V as Variant
VarToWideStrDef
Variant
V as Variant, ADefault as
WideString
VarToDateTime
Variant
V as Variant
VarFromDateTime
Variant
DateTime as TDateTime
VarInRange
Variant
VarEnsureRange
Variant
VarSameValue
Variant
A as Variant, B as Variant
VarCompareValue
TVariantRelations
hip
A as Variant, B as Variant
VarIsEmptyParam
Variant
V as Variant
VarIsError
Variant
VarAsError
Variant
AResult as HRESULT
VarSupports
Variant
V as Variant, IID as
TGUID, byref Intf
VarCopyNoInd
Description
VarIsArray
Variant
A as Variant
VarArrayRef
Variant
A as Variant
VarTypeIsValidArrayType
Variant
AVarType as TVarType
VarTypeIsValidElementT
ype
Variant
AVarType as TVarType
VarArrayDimCount
Integer
A as Variant
VarArrayLowBound
Integer
A as Variant, Dim as
Integer
VarArrayHighBound
Integer
A as Variant, Dim as
Integer
VarArrayUnlock
A as Variant
Unassigned
Variant
Null
Variant
FindCustomVariantType
Variant
AVarType as TVarType,
byref CustomVariantType
as TCustomVariantType
VarCastError
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
129 / 135
Function name
Returns
Parameters
Description
VarInvalidOp
VarInvalidNullOp
VarOverflowError
ASourceType as
TVarType, ADestType as
TVarType
VarRangeCheckError
ASourceType as
TVarType, ADestType as
TVarType
VarArrayCreateError
VarResultCheck
AResult as HRESULT
HandleConversionExcepti
on
ASourceType as
TVarType, ADestType as
TVarType
VarTypeAsText
13/02/2013
Variant
AType as TVarType
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
130 / 135
11
Appendix
GetProgramVersion
SpeedMark.ApplicationVersion
AddProgramMessage
SpeedMark.Logging.AddProgramMessage
AddProgramLogText
SpeedMark.Logging.AddProgramLogText
ClearMessageWindow
SpeedMark.Logging.ClearProgramMessages
Message
SpeedMark.Logging.ShowInfoMessage
CloseMessage
SpeedMark.Logging.CloseInfoMessage
Dialog
MsgBox
Extern
StartProcess
ExternWait
StartProcess
InputBox
InputBox
Wait
Sin
Sin
Cos
Cos
Tan
Math.Tan
ArcSin
Math.ArcSin
ArcCos
Math.ArcCos
ArcTan
Math.ArcTan
Abs
Abs
Round
Round
RoundDown
Floor
RoundUp
Ceil
Frac
Frac
Exp
Exp
Log
Log
Power
Power
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
131 / 135
IntToHexStr
IntToHex
IntToBinStr
IntToBin
BinStrToInt
BinToInt
HexStrToInt
HexToInt
IntToString
IntToStr
IntToStringFmt
Format("%d", [100])
FloatToString
FloatToStr
FloatToStringFmt
Format(%f, [99.99])
FormatFloat(0.00, 99.99)
StringToInt
StrToInt
StringToFloat
StrToFloat
Asc
Chr
WideChr
Ord
Asc
WideAsc
Length
Length
Replace
Replace
Cut
Copy
Copy
Delete
Delete
Pos
Pos
WideTextPos
LowerCase
LowerCase
UpperCase
UpperCase
CalendarWeek
DateUtils.WeekOfTheYear
Date
DateToStr(Date)
DateDay
DateUtils.DecodeDate
DateMonth
DateUtils.DecodeDate
DayOfTheWeek
DateUtils.DayOfTheWeek
DayOfTheYear
DateUtils.DayOfTheYear
DateYear
DateUtils.DecodeDate
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
132 / 135
StartWatch
SpeedMark.Logging.InitStopWatch
Time
TimeToStr(Time)
Watch
SpeedMark.Logging.ReadStopWatch
AddFileLine
TextFileList.AddFileLine
ClearFile
TextFileList.ClearFile
CopyFile
TextFileList.CopyFile, CopyFile
DeleteFile
TextFileList.DeleteFile, DeleteFile
DelFileLine
TextFileList.DelFileLine
FileExists
TextFileList.FileExists, FileExists
FindInFile
TextFileList.FindInFile
GetFileLine
TextFileList.GetFileLine
GetFileLineCount
TextFileList.GetFileLineCount
LoadFile
TextFileList.LoadFile
MoveFile
TextFileList.MoveFile, Windows.MoveFile
NewFile
TextFileList.NewFile
RenameFile
TextFileList.RenameFile, Windows.MoveFile
SaveFile
TextFileList.SaveFile
SetFileLine
TextFileList.SetFileLine
Errors
SpeedMark.Errors.Execution.Count
ErrorString
SpeedMark.Errors.Execution.ErrorString
ClearError
SpeedMark.Errors.Execution.ClearLast
ClearAllErrors
SpeedMark.Errors.Execution.ClearAll
GetGraphicPosX
SpeedMark.CurrentProgram.Graphics.GraphicByName["Name"].GetRectPoint(rppCenter,
PosX, PosY)
GetGraphicPosY
SpeedMark.CurrentProgram.Graphics.GraphicByName["Name"].GetRectPoint(rppCenter,
PosX, PosY)
GetGraphicHeight
SpeedMark.CurrentProgram.Graphics.GraphicByName["Name"].GetRectSize(Width,
Height)
GetGraphicWidth
SpeedMark.CurrentProgram.Graphics.GraphicByName["Name"].GetRectSize(Width,
Height)
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
133 / 135
11.1.9 DataStore
Simple scripting function
DataStoreValue
SpeedMark.DataStore.NamedValue["Name]
DataStoreListPeekFirstAsFloat
DataStoreListPeekFirstAsInt
DataStoreListPeekFirstAsText
SpeedMark.DataStore.NamedList["Name"].PeekFirst
DataStoreListPeekLastAsFloat
DataStoreListPeekLastAsInt
DataStoreListPeekLastAsText
SpeedMark.DataStore.NamedList["Name"].PeekLast
DataStoreListPopFirstAsFloat
DataStoreListPopFirstAsInt
DataStoreListPopFirstAsText
SpeedMark.DataStore.NamedList["Name"].PopFirst
DataStoreListPopLastAsFloat
DataStoreListPopLastAsInt
DataStoreListPopLastAsText
SpeedMark.DataStore.NamedList["Name"].PopLast
DataStoreListEmpty
SpeedMark.DataStore.NamedList["Name"].Empty
GetFrequency
SpeedMark.LaserController.Frequency
GetPower
SpeedMark.LaserController.Power
GetLaserOffDelay
SpeedMark.LaserController.LaserOffDelay
GetLaserOnDelay
SpeedMark.LaserController.LaserOnDelay
SetFrequency
SpeedMark.LaserController.Frequency
SetPower
SpeedMark.LaserController.Power
SetLaserOffDelay
SpeedMark.LaserController.LaserOffDelay
SetLaserOnDelay
SpeedMark.LaserController.LaserOnDelay
GetMarkDelay
SpeedMark.LaserController.MarkDelay
GetMarkSpeed
SpeedMark.LaserController.MarkSpeed
GetPolygonDelay
SpeedMark.LaserController.PolygonDelay
GetPosSpeed
SpeedMark.LaserController.PosSpeed
GetPosDelay
SpeedMark.LaserController.PosDelay
SetMarkDelay
SpeedMark.LaserController.MarkDelay
SetMarkSpeed
SpeedMark.LaserController.MarkSpeed
SetPolygonDelay
SpeedMark.LaserController.PolygonDelay
SetPosDelay
SpeedMark.LaserController.PosDelay
SetPosSpeed
SpeedMark.LaserController.PosSpeed
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
134 / 135
Get
SpeedMark.System.IOControllerComponents.TLC2.InputPort
GetIndex
SpeedMark.System.IOControllerComponents.TLC2.InputIO[0]
Close
Open
Reset
SpeedMark.System.IOControllerComponents.TLC2.OutputIO[0]=0
ResetIndex
SpeedMark.System.IOControllerComponents.TLC2.OutputIO[0]=0
Set
SpeedMark.System.IOControllerComponents.TLC2.OutputIO[0]=1
SetIndex
SpeedMark.System.IOControllerComponents.TLC2.OutputIO[0]=1
13/02/2013
Trotec Produktions- und Vertriebs GmbH_Linzer Strasse 156, A-4600 Wels, Austria, Technical Support
tel_+43 (0)7242 239-7000, fax_+43 (0)7242 239-7380, mailto: techsupport@troteclaser.com
135 / 135