Home
3.3 Adding files to the project
Contents
1. 53 Lighter Project Editor User s Manual SVDATALOGIC OGIC AUTOMATION Unconditional catch clause When a single unconditional catch clause is used the catch block is entered when any exception is thrown For example when the exception occurs in the following code control transfers to the catch Clause try throw myException generates an exception catch e statements to handle any exceptions logMyErrors e pass exception object to error handler The exception identifier When an exception is thrown in the try block exception_var e g the ein catch e holds the value specified by the throw statement You can use this identifier to get information about the exception that was thrown This identifier is local to the catch clause That Is it is created when the catch clause is entered and after the catch clause finishes executing the identifier is no longer available The finally clause The finally clause contains statements to execute after the try block and catch clause s execute but before the statements following the try statement The finally clause executes regardless of whether or not an exception is thrown If an exception is thrown the statements in the finally clause execute even if no catchclause handles the exception You can use the finally clause to make your script fail gracefully when an exception occurs for example you may need to release a resource that your script has t
2. 51 Lighter Project Editor User s Manual SVDATALOGIC return ZIPCODE_UNKNOWN_ERROR i return Z k a verifyZipCode 95060 returns 95060 p ee returns 1 c verifyZipCode a returns 1 d verifyZipCode 95060 returns 95060 e veriryzZioCode 95060 1234 returns 95060 1234 6 4 10 1 1 1 Rethrow an exception You can use throwto rethrow an exception after you catch it The following example catches an exception with a numeric value and rethrows it if the value is over 50 The rethrown exception propagates up to the enclosing function or to the top level so that the user sees it try throw n throws an exception with a numeric value catch e if 6 lt 50 4 statements to handle exceptions 1 50 else cannot handle this exception so rethrow throw e Lighter Help Online Manual 52 GVATALOGIC DATALOGIC AUTOMATION 6 4 11 Try catch Summary Marks a block of statements to try and specifies a response should an exception be thrown Syntax try 4 Cry stCacements catch exception_var_1l if condition_1 catch statements 1 d catch exception_var_2 catch_statements_2 Jd finally finally_statements b Parameters Parameter Description lt yy statements The statements to be executed catch_statements_1 Statements that are executed if an exception is thrown in catch_statements_2 the try block exc
3. Adds 2 so prints 5 debug counterB 2 Adds 2 so prints 14 debug counterA 7 Adds 7 so prints 12 debug counterB 30 Adds 30 so prints 44 Note that for each call to make_counter the anonymous function that is returned has its own copy of current initialized to the initialValue which is incremented independently of any other anonymous function s current It is this capturing of context that makes the function that is returned a closure See also Declaring Functions Lighter Help Online Manual 106 GVATALOGIC DATALOGIC AUTOMATION in operator property in Object Returns true if the given Object has the given property otherwise returns false instanceof operator object instanceof type Returns t rue if the given object is an instance of the given type or of one of its base classes otherwise returns false new operator var instance new Type optArguments This function calls the constructor for the given Type passing it the optional arguments optArguments if any and returns an instance of the given Type The Type may be one of the built in types one of the library types or a user defined type Example var circle new Circle x y var file new File this operator this property The this operator may only be used within a function that is defined within a class or form i e a member function Within the scope of the function this is a reference
4. Lighter Project Editor User s Manual SVATALOGIC Ba AIl i A EN A h DATALOGIC AUTOMATION 1 WELCOME 1 1 About this Help System This Help System is designed for developers who will be using Project Editor to write and manage programs so as to customize and automate laser engraving operations Project Editor is integrated into Laser Editor 1 1 1 Using the Help System e o access the whole contents choose Help gt Help from the Project Editor s menu bar or press F1 in the main screen of the application e To use the context sensitive Help press F1 or the button in the title bar to open dialog or window level Help 1 1 2 Contents of the Help In particular the Help is organized into the following main topics Chapter Contents Getting started with Presents an overview of the product in terms of scope and work Project Editor environment Mancina Poetis Describes how to create a project how to add source or resource files as vanaging rele well as to manage files Opening Saving and Describes how to open or save an existing project either locally or to from Deleting Projects the laser device i j 1 1 Sending projects to TOGAS 10 Describes how to test and run a project and how to send it to marking marking Laser Engine Language Describes all of the objects types functions variables classes and Reference constants that can be used to write your own programs Ligh
5. or makes the quantifier non greedy matching the minimum number of times as opposed to the default which is greedy matching the maximum number of times Also used in lookahead assertions described under and inthis table The decimal point matches any single character except the new line characters n r u2028 or u2029 s S can be used to match any character including new lines For example n matches an and on in nay an apple is on the tree but not nay Matches x and remembers the match These are called capturing parentheses For example foo matches and remembers foo in foo bar The matched substring can be recalled from the resulting array s elements 1 n or from the predefined RegExp object s properties 1 9 Matches the preceding item 0 or 1 time For example e 1e matches the el in angel and the le in angle X Matches x but does not remember the match These are called non capturing parentheses xX The matched substring can not be recalled from the resulting array s elements 1 n or from the predefined RegExp object s properties 1 9 Matches x only if x is followed by y For example Jack Sprat matches Jack only if it is followed by Sprat Jack Sprat Frost matches Jack only if it is followed by Sprat or Frost However neither Sprat nor Frost is part of the mat
6. Help Online Manual 56 PORLAR DATALOGIC AUTOMATION N 6 4 14 With Summary Extends the scope chain for a statement Syntax with object statement Parameters Parameter Description Adds the given object to the scope chain used when evaluating the statement The object a SSS around object are required statement Any statement statement Description Laser Engine Program looks up an unqualified name by searching a scope chain associated with the execution context of the script or function containing that unqualified name The with statement adds the given object to the head of this scope chain during the evaluation of its statement body If an unqualified name used in the body matches a property in the scope chain then the name is bound to the property and the object containing the property Otherwise a ReferenceError is thrown Performance Pro amp Con e Pro with can help reduce file size by reducing the need to repeat a lengthy object reference without performance penalty The scope chain change required by with is not computationally expensive Use of with will relieve the interpreter of parsing repeated object references Note however that in many cases this benefit can be achieved by using a temporary variable to store a reference to the desired object e Con with forces the specified object to be searched first for all unqualified name lookups Therefore all identifiers that match
7. Laser Engine Program is a fully object oriented language A class s constructor is the function which has the same case sensitive name as the class itself The constructor should not contain an explicit return statement it will return an object of its type automatically Laser Engine Program does not have a destructor function a function that is called when the class is destroyed for a class The class s member variables are declared with var see Declaring Variables and its member functions methods with function see Declaring Functions The object instance itself is referred to using the this operator Inside a member function of a class member variables and member functions can be accessed with an explicit this e g this x posx This is not required but can sometimes help to increase visibility Laser Engine Program supports single inheritance and if a class inherits from another class the constructor of the superclass constructor can be called with super For further information e Qualified Names e Class Properties e Declaring Classes 6 5 1 Qualified Names When you declare an object of a particular type the object itself becomes in effect a namespace For example in Laser Engine Program there is a function called Math sin If you want to have a sin function in your own class that would not be a problem because objects of your class would call the function using theobject function syntax The period
8. Number constructor documentation Numbers are not normally constructed but instead created by simple assignment such as for example var Xx 3 1423 Number function documentation Number toString radix Returns the number as a string value Parameter radix An integer between 2 and 36 specifying the base to use for representing numeric values The toString method parses its first argument and attempts to return a string representation in the specified radix base For radixes above 10 the letters of the alphabet indicate numerals greater than 9 For example for hexadecimal numbers base 16 A through F are used If toString Is given a radix not between 2 and 36 an exception is thrown If the radix is not specified Laser Engine Program assumes the preferred radix is 10 Lighter Help Online Manual 80 GVATALOGIC DATALOGIC AUTOMATION var count 10 print Count loOstring 7 displays 10 Prant 1 s tootring displays 17 var x 7 print x vostring 2 gt l displays 111 Number toExponential fractionDigits Returns a string representing the Number object in exponential notation Parameter fracionDigits An integer specifying the number of digits after the decimal point Defaults to as many digits as necessary to specify the number See also Number toFixed Digits This method returns a string representing a Number object in exponential notation w
9. Array toString Joins all the items of an array together separated by commas This function is used when the array is used in the context of a string concatenation or is used as a text value e g for printing Use join if you want to use your own separator See also Array join String optSeparator var x new Array a b o J Var y x tostring y a b c var z X join y a b c Array unshift String expression optExpression1 optExpressionN Unshifts that is inserts the given items at the bottom left end of the array and returns the new length of the array Parameter expression optExpressionN The items to add to the array Var x Tiew Array a Db Ce y Sstniehairt 121 e 77 121 a Tp go j Property documentation length Holds the number of items in the array Items with string keys are excluded from the length property Lighter Help Online Manual 68 GVATALOGIC DATALOGIC AUTOMATION 6 6 1 3 Boolean Laser Engine Program provides a Boolean data type More Boolean functions String Boolean toString Boolean Boolean valueOf Detailed description Laser Engine Program provides a Boolean data type In general creating objects of this type is not recommended since the behavior will probably not be what you would expect Instead use the boolean constants true and false as required Any expression can be evaluate
10. new Date 95 11 18 17 28 35 months are represented by 0 to 11 today toLocaleDateString Date toLocaleTimeString Converts a date to a string returning the date portion using the current locale s conventions See also Date toString _ The toLocaleTimeString method converts the date to a string using the formatting convention of the operating system where the script is running If the operating system is not year 2000 compliant and does not use the full year for years before 1900 or over 2000 toLocaleDateString returns a string that is not year 2000 compliant toLocaleString behaves similarly to toString when converting a year that the operating system does not properly format 75 Lighter Project Editor User s Manual amp VDATALOGIC DATALOGIC AUTOMATION Methods such aSgetHours getMinutes andgetSeconds give more portable results than toLocaleDateString Use toLocaleTimeString when then intent is to display to the user a string formatted using the regional format chosen by the user Be aware that this method due to its nature behaves differently depending on the operating system and on the user s settings today new Date 95 11 18 17 28 35 months are represented by G To Il today toLocaleTimeString today toLocaleDateString Date valueOf Returns the primitive value of a Date object as a number data type the number of milliseconds since midnight 01 January 1970 UTC This method is funct
11. var names names first John names last Doe var firstName names first var lastName names last names address Somewhere street 2 names phoneNumber 0123456789 var address names address var phoneNumber names phoneNumber Array functions documentation Array concat Array al Array a2 aN Concatenates the array with one or more other arrays in the given order and returns a single array Parameter al aN Arrays and or values to concatenate to the resulting array Ver x new Array a bb Tet J Var y KConcat 1 d e Jy 90 100 7 Iy y Aay TO T euP ae u ME gd 100 Array join String optSeparator Joins all the items of an array together separated by commas or by the specified opt Separator Var x new Array a D ce Var y x oanl y a b c Varz x 7oin Jy j y a b Cc Array pop Pops that is removes the top most right most item off the array and returns it Var x new Array a b ec J var y x pop y c x a p Lighter Help Online Manual 66 SDATALOGIC DATALOGIC AUTOMATION APTER Array push item1 optltem2 optItemN Pushes that is inserts the given items onto the top right end of the array The function returns the new length of the array Parameter item optItemN The items to add to the array Var xX new Arr
12. xCoord yCoord The value returned is always between Math PI and Math PI The following shows an example LUnCTiOn polar x y return Math atan2 y x Math ceil Number number lf the number is an integer it returns the number If the number is a floating point value it returns the smallest integer greater than the number The following shows an example var x 913 41 x Math ceil x x 914 Val y 33 9 77 y Math ceil y y 33 Math cos Number number Returns the cosine of the given number The value will be in the range 1 1 Math exp Number number Returns Math E raised to the power of the given number Math floor Number number If the number is an integer it returns the number If the number is a floating point value it Lighter Help Online Manual 62 GVATALOGIC N DATALOGIC AUTOMATION A G A gt a D la LCLAAPIEN O returns the greatest integer less than the number Math log Number number If the number is gt 0 it returns the natural logarithm of the given number If the number is O it returns Infinity If the number is lt 0 it returns NaN Math max Number number1 Number number2 Returns the largest of number1 and number2 Math min Number number1 Number number2 Returns the smallest of number1 and number2 Math pow Number number Number power Returns the value of the number raised to the power Math ran
13. function instead NEGATIVE_INFINITY A value representing the negative Infinity value Several Laser Engine Program methods such as the Number constructor parseFloat and parseInt return NaNif the value specified in the parameter is significantly lower than Number MIN_VALUE In the following example the variable smallNumber is assigned a value that is smaller than the minimum value When the if statement executes smallNumber has the value Infinity SO smallNumber Is set to a more manageable value before continuing var smallNumber Number MAX VALUE 2 it smallNumber Number NEGATIVE_INFINITY smallNumber returnFinite POSITIVE_INFINITY A value representing the negative Infinity value Several Laser Engine Program methods such as the Number constructor parseFloat and parseInt return NaNif the value specified in the parameter is significantly lower than Number MIN_VALUE In the following example the variable smallNumber Is assigned a value that is smaller than the minimum value When the if statement executes smallNumber has the value Infinity SO smallNumber Is set to a more manageable value before continuing var smallNumber Number MAX VALUE 2 if smallNumber Number NEGATIVE_INFINITY Ssiiie JIN GinloeSie returnkinite A numeric variable can hold a non numeric value in which case isNaN returns true The result of an arithmetic expression may exceed the maximum or minim
14. Array a1 Array a2 aN String Array join String optSeparator Object Array po Number Array oush item1 optitem2 optltemN void Array reverse Object Array shift _ Array Array slice Number startIndex Number optEndIndex Number Array sort Function optComparisonFunction Array Array splice Number startlIndex Number replacementCount optltem1 optitemN String Array toString Number Array unshift String expression optExpression1 optExpressionN Array properties Number length Detailed description An Array is a datatype which contains a named list of items The items can be any Laser Engine object Multi dimensional arrays are achieved by setting array items to be arrays themselves Arrays can be extended dynamically simply by creating items at non existent index positions e Items can also be added using push unshift and splice e Arrays can be concatenated together using concat e tems can be extracted using pop shift and slice e Items can be deleted using splice e Arrays can be turned into strings using join Of Array toString e Use reverse to reverse the items in an array andsort to sort the items The sort function can be passed a comparison function for customized sort orders In general operations that copy array items perform a deep copy on items that are Number Or String objects and a shallow copy on other objects Array
15. Comparison Operators e Bit wise operators e Special Operators 6 6 5 1 Assignment Operators These operators are used to assign the value of expressions to variables operator amp operator operator A operator r operator operator operator lt operator operator gt gt operator operator l gt gt gt operator operator var variable expression The assignment operator is used to assign the value of an expression to the variable lt is an error to attempt to assign to a constant operator variable expression This operator adds the value of the expression to the variable It is the same as variable variable expression but is shorter to write and less error prone See also String Operators string operator variable expression This operator subtracts the value of the expression from the variable operator variable expression This operator multiplies the value of the expression by the value of the variable 101 Lighter Project Editor User s Manual SVDATALOGIC nW oo oe g A gF E LI A T bk DATALOGIC AUTOMATION operator variable expression This operator divides the value of the variable by the value of the expression operator variable expression This operator divides the variable by the expression and assigns the remainder of the division which may be 0 to the variable amp operator variab
16. Sets the seconds to the specified seconds which must be in the range 0 59 in local time Var d new Date 1975 12 25 225 320 J d setSeconds 25 d 1980 12 30T22 30 25 Date setTime Number milliseconds Sets the date and time to the local date and time given in terms of milliseconds since midnight on the 1st January 1970 Var d new Date 1975 12 25 22 30 var duplicate new Date duplicate setTime d getTime Date toString Converts the date into a string on the ISO 8601 extended format YYYY MM DDTHH MM SS var d new Date 1975 12 25 22 30 J Var s d tostring 5 1975 12 29722730200 Date toDateString Returns the date portion of a Date object in human readable form var d new Date 1993 6 28 14 39 7 Prantin a tostring 7 prints Wed Jul 28 1993 14 39 07 GMT 0600 PDT printin d toDateString prints Wed Jul 28 1993 Date toTimeString Returns the time portion of a Date object in human readable form Lighter Help Online Manual 74 GVATALOGIC DATALOGIC AUTOMATION var d new Date 1993 6 26 14 39 7 prantin d toctring gt 7 prints Wed Juk 28 1993 14 39 07 GMT 0600 PDT printin d toTimeString prints 14 39 07 GMT 0600 PDT Date toLocaleString Converts a date to a string using the operating system s locale s conventions The toLocaleString method converts the date to a string using the formatting co
17. Specify the search criteria and then click Replace or Replace all To go to a specific line 1 From the Search menu choose Go to line 2 In the window that is displayed enter the number of the line you want to move to and then click Go to Lighter Help Online Manual 20 GVATALOGIC es DATALOGIC AUTOMATION 3 4 3 Renaming or deleting files You might rename or remove both source and resource files To rename a source or resource file 1 Inthe Project Files list right click the file not the folder you want to rename 2 From the shortcut menu choose Rename File enter a new name in the window that is displayed and then click OK To delete a source or resource file 1 Inthe Project Files list right click the file not the folder you want to delete 2 From the shortcut menu choose Delete File 3 Answer Yes in the window that is displayed 3 4 4 Exporting source files You might export source files so as to be used for other applications When you export a file a copy of it is saved as a qs file in another location and the original is kept into your project To export a source file 1 In the Project Files pane right click the source file not the folder you want to export and then choose Export file from the shortcut menu 2 Inthe Export file window that is displayed select the folder you want to save the qs file in and then click on Save 21 Lighter Project Editor User s Man
18. and 7 Project Files pane It lists the source files and resource files that compose the current project Right clicking an item either the project folder the source files folder the resource files folder or a file will result in a shortcut menu being displayed on which you can choose options for files management This window can float over the work area or you can dock it at the left side of the window by double clicking its title bar Furthermore you can hide display this window by right clicking next to the toolbar and then selecting deselecting the corresponding option Program editor area This is the area where the source file is displayed You can enter your code edit it copy paste or search the code by using the menus or the toolbar To customize how the editor looks choose Edit gt Configuration and then enter the desired values Output area When you run a project it displays the relevant status or error messages This window can float over the work area or you can dock it at the bottom of the window by double clicking its title bar Furthermore you can hide display this window by right clicking next to the toolbar and then selecting deselecting the corresponding option 11 Lighter Project Editor User s Manual SVATALOGIC 3 MANAGING PROJECTS This chapter is organized into the following sections e Editor configuration e Creating a project e Adding files to the project
19. and Built in Objects Reference documentation for native and built in objects is organized as follows Objects Description This set of objects is supplied by the Laser Engine Program implementation Some Native Objects native objects are built in while other may be constructed during the course of execution of a Laser Engine Program Graphical User This set of objects allows defining the graphical interface of the application Interface Objects dialogs checkbox buttons and so forth Base System This set of objects allows defining the system interface as well as accessing Object directories and files or interacting with external programs Laser Graphical This set of objects allows managing the documents and all of the graphic objects ce they may contain arrays codes strings and so forth Laser___ System This set of objects allows managing the low level laser system that is axis Objects movement and I O modules Related topics e Built in Constants e Built in Functions e Control Statements 6 6 1 Native Objects Native objects are supplied by the Laser Engine Program implementation Some native objects are built in others may be constructed during the course of execution of a Laser Engine Program Copyright Portions of the following content is copyright c 2005 2008 by Mozilla Development Center MDC MDC wikis have been prepared with the contributions of many authors both within and outside the Mozil
20. behavior var x new Array my aaa aY MoN x Sort x many hor vO Wc function comparisonFunction a D signature The function above must return an integer as follows e lifa lt b e Oifa e lifa gt b 67 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION The following is an example FUNCTION numerically a b 1 return a lt b 1 7 ate b i1 O var x new Array 8 90 1 4 843 221 x SOrt numerically J x 1 4 8 90 221 843 Array splice Number startIndex Number replacementCount optItem1 optItemN Splices items into the array and out of the array Parameters startIndex The index at which to start changing the array replacementCount The number of items that are to be replaced optlteml optitemN The items to be inserted Make the second argument O if you are simply inserting items If you are simply deleting items the second argument must be gt 0 that is the number of items to delete and there must be no new items given var x new Array a Drg Cr mog 2nd argument 0 plus new items gt insertion kasp ice l 0 x TY J x aS ui a RTEA sla se ea q 2nd argument gt 0 and no items gt deletion x5plice 2 L V7 z ves ue Gage my Esu q 2nd argument gt 0 plus new items gt replacement xop lice 3 2 TZT 73 E res eae CE Ta TZU
21. block of statements to try and specifies a response should an exception be thrown var Declares a variable Declares a variable optionally initializing it to a value initializing it to a value Creates a loop that executes a specified statement as long as the test condition evaluates while to true The statement is executed after SS a e a aeaea the condition with Extends the scope chain for a statement the scope chain for a statement Copyright The material on Control Statements included in this Language Reference is copyright c 2005 2008 by Mozilla Development Center MDC MDC wikis have been prepared with the contributions of many authors both within and outside the Mozilla Foundation Unless otherwise indicated the content is available primarily under the terms and conditions set forth in the Creative Commons Attribution Sharealike License v3 0 or later Code samples are available under the terms of the MIT License The latest versions of these licenses are presently available here e Attribution Sharealike License e MIT License Lighter Help Online Manual 38 GVATALOGIC DATALOGIC AUTOMATION 6 4 1 Break Summary Terminates the current loop switch or label statement and transfers program control to the statement following the terminated statement Syntax break label Parameters Parameter Description label Identifier associated with the label of the statement If the
22. constructor documentation Arrays can be constructed from array literals or using the new operator var mammals human dolphin elephant monkey J var plants new Array flower tree shrub var thangs 1 for 1 0 1 lt mammals length itt things i new Array 2 things i 0 mammals 1i things liji phaents 2 Arrays can be initialized with a size but with all items undefined var a new Array 10 10 items 65 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION Array access Array items are accessed via their names Names can be either integers or strings var m2 mammals 2 mammals 2 gorilla var thing things 2 1 The first statement retrieves the value of the third item of the mammals array and assigns it to m2 which now contains monkey The second statement replaces the third item of the mammals array with the value gorilla The third statement retrieves the second item of the third item s array from the things array and assigns it tothing which now contains shrub As stated above it is also possible to access the arrays using strings These act as normal properties and can be accessed either using the square bracket operator or by directly dereferencing the array object and specifying the property name name These two accessor types can be mixed freely as seen below with theaddress and phoneNumber properties
23. disconnect as argument myQObject somethingChanged disconnect myInterestingFunction e Back to the full list of Built in Functions 6 6 4 3 print Syntax print expression Prints the expression applying toString if necessary to the output stderr followed by a newline e Back to the full list of Built in Functions Lighter Help Online Manual 98 GVATALOGIC EE a oe ee ee Ril B58 A TI h i 8 IG A eh a f ll DATALOGIC AUTOMATION 6 6 4 4 eval Syntax eval string Var x D73 Var y eval AG fa ae 77 y 07 This function parses and executes the contents of the string taking the text to be valid Laser Engine Program e Back to the full list of Built in Functions 6 6 4 5 isFinite Syntax isFinite expression Returns true if the expression s value is a number that is within range otherwise returns false e Back to the full list of Built in Functions 6 6 4 6 isNaN Syntax isNaN expression Returns true if the expression s value is not a number otherwise returns false Example var x parseFloat 3 142 var y parseFloat haystack if i1sNaN x debug x is not a number if isNaN y debug y is not a number 7 Prints y is not a number e Back to the full list of Built in Functions 6 6 4 7 parseFloat Syntax parseFloat string Parses the string and returns the floating point number that the string represents or NaN if the
24. getMonth Number Date getSeconds Number Date getTime Number Date getTimezoneOffset void Date setDate Number dayOfTheMonth void Date setFullYear yearValue monthValue dayValue void Date setHours Number hour void Date setMilliseconds Number milliseconds void Date setMinutes Number minutes void Date setMonth Number month void Date setSeconds void Date setlime Number milliseconds String Date toString String Date toDateString _ String Date toTimeString String Date toLocaleString String Date toLocaleDateString String Date toLocaleTimeString Number Date valueOf Number Date getUTCDate Number Date getUTCDay Number Date getUT CFullYear Number Date getUTCHours Number Date getUT CMilliseconds Number Date getUTCMinutes Number Date getU T CMonth Number Date getUT CSeconds void Date setUTCDate dayvalue void Date setUTCFullYear yearValue monthValue dayValue void Date setUTCHours hoursValue minutesValue secondsValue msValue void Date setUT CMilliseconds _millisecondsValue void Date setUTCMinutes minutesValue secondsValue msValue void Date setUTCMonth monthValue dayValue void Date setUTCSeconds secondsValue msValue String Date toUTCString Lighter Help Online Manual 70 GVATALOGIC DATALOGIC AUTOMA
25. is not an array It is similar to an array but does not have any array properties except length You can use the arguments object if you call a function with more arguments than it is formally declared to accept This technique is useful for functions that can be passed a variable number of arguments You can use arguments length to determine the number of arguments passed to the function and then process each argument by using the arguments object Description lt is an Array of the arguments that were passed to the function It only exists within the context of a function Example function sum total 0 for 1 0 1 lt arguments length itt total arguments i return total Lighter Help Online Manual 96 GVATALOGIC E oe P Poa W A a BE TI ra bo DATALOGIC AUTOMATION 6 6 3 Built in Constants Laser Engine Program provides a number of convenient built in constants For further information e Infinity e NaN e undefined 6 6 3 1 Infinity This is the value of any division by zero Syntax Ver 1 1702 In Laser Engine Program division by zero does not raise an exception instead it assigns the Infinity value as the result of the expression Use isFinite to test whether a value is finite or not 6 6 3 2 NaN NaN means Not a Number and is used to signify that a value is not a legal number Use isNaN function to test a value to see if it is NaN 6 6 3 3 undefine
26. parse fails Leading and trailing whitespace are ignored If the string contains a number followed by non numeric characters the value of the number is returned and the trailing characters ignored e See also parselnt e Back to the full list of Built in Functions 99 Lighter Project Editor User s Manual ODA TALOGIC RATAL OGGI wien Fee DATALOGIC AUTOMATION 6 6 4 8 parselnt Syntax parselInt string optBase Parses the string and returns the integer that the string represents in the given base optBase or NaN if the parse fails If the base isn t specified the base is determined as follows e base 16 hexadecimal if the first non whitespace characters are Ox or OX e base 8 octal if the first non whitespace character is 0 e base 10 otherwise Leading and trailing whitespace are ignored If the string contains a number followed by non numeric characters the value of the number is returned and the trailing characters ignored Example var i parselInt 24 ji ai 24 var h parselInt OxFEF h 255 var x parseInt T 450x727 T js 77 amp 259 e See also parseFloat Lighter Help Online Manual 100 GVATALOGIC DATALOG IC AUTOMATION 6 6 5 Built in Operators Laser Engine Program provides a set of built in operators which are divided into the following types e Assignment Operators e Arithmetic Operators e String Operators e Logical Operators e
27. rcs oreo ree seine aise asc inca E ceca E ENA A NE EENE eee 39 6 4 2 FT rr E ere age eyo oe sects peepee E E P E E E N A 40 6 4 3 ONS cea euanaeeuzguannr none snsaaabnogancaneaiceyniansieqaiiuyancanea condeainuen oumeeanenes 41 6 4 4 gO ge en ee ee ee eee eee ee ee 43 6 4 5 FON CHOR ies crsete ss eget cece ac E E E E sation E E 44 6 4 6 E e cepa E E EEE A E E E E T E E E 45 6 4 7 Esia PE E A E E E E E E E E E E E E EE E EE 47 6 4 8 EILE a PAETA A L N A O EE E AE E 47 6 4 9 SN eaa ecncnctysae ty paasds see staeaue sunene ty sss02seeseaaueseneeee encee ee 48 6 4 10 TON spss ste sscacac dace e E E E 50 6 4 11 TIDY ud CAG g EIEE E EE E E E E T E E E 99 6 4 12 A AI eee sesso EEE EE E ENO E E E E E EE 55 6 4 13 WAE a E E E seseeees cueseeeeee 2 sues dace teen moe scuesesesdaseste 56 6 4 14 AO A g N E P O E E AEE ENEE PEE E EN EE E EE E E EE E 57 6 5 Classes and Methods Member fUNCtiONS cccccsseeeececeeeeeeeeeecaeeseeeeeeeaseeeeesaeeseeeeeseaeseeeessaaeeess 59 6 5 1 MPSA NIOS oriacassat vasa aston A te oslosasuaadaiva A E E 59 6 5 2 CASS FOSS osc gnae ee E E E E A E 59 6 6 Native and Built in Objects cccccssscceccceeeeeecceeesseeecceeaseceecsseuseeeecsauseceecseaaseeeesssugeeeessseageeeesssaaaes 60 6 6 1 NaO ODOC on a EE E S E E E O E RE E 60 6 6 2 Arguments vanaDli esse snr in A E R EE 96 6 6 3 UTE GOS TANS e EE E E E E E E 97 6 6 4 BUTTE TY UAC WINS ira R EAE E E E E E E EE EE AEE 98 6 6 5 BUM ODO aO enee e E gente 101
28. result of division by zero is Infinity See Infinity operator fe operandl operand2 This operator returns the integer remainder which may be 0 from the division of operandi by operand2 6 6 5 3 String Operators These operators provide string functions using operators Many other string functions are available See also String built in type The String operators are described in the table below Operator Syntax Syntax Description This operator returns a string that is the concatenation of its string strl str2 operands str1 and str2 See also Arithmetic Operators operator This operator appends its second operand str2 onto the end of string strl str2_ the first operand st r1 See also Assignment Operators operator 6 6 5 4 Logical Operators These operators are used to evaluate whether their operands are true or false in terms of the operator for unary operators and in terms of each other for binary operators The binary operators use short circuit logic i e they do not evaluate their second operand if the logical value of the expression can be determined by evaluating the first operand alone The Logical operators are described in the table below Operator Syntax Description This operator returns an object whose value is true if both its operands are true otherwise it returns an object whose value is false Specifically if the value ofoperandlis false the opera
29. since midnight on the 1st January 1970 The string must be in the ISO 8601 extended format YYYY MM DD or with time YYYY MM DDTHH MM SS var d new Date Date parse 1976 01 25T22 30 00 d Date parse 1976 01 25 7T22250200 J Date UTC year month date hrs min sec ms Accepts the same parameters as the longest form of the constructor and returns the number of milliseconds in a Date object since January 1 1970 00 00 00 universal time Parameters year A year after 1900 month An integer between 0 and 11 representing the month date An integer between 1 and 31 representing the day of the month hrs An integer between 0 and 23 representing the hours min An integer between 0 and 59 representing the minutes sec An integer between 0 and 59 representing the seconds ms An integer between 0 and 999 representing the milliseconds 71 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION You should specify a full year for the year for example 1998 If a year between 0 and 99 is specified the method converts the year to a year in the 20th century 1900 year for example if you specify 95 the year 1995 is used The utc method differs from the Date constructor in two ways e Date UTC uses universal time instead of the local time e Date UTC returns atime value as a number instead of creating a Date object lf a parameter you specify is outside o
30. statement is not a loop or switch this is required Description The break statement includes an optional label that allows the program to break out of a labeled statement The break statement needs to be nested within this labelled statement The labelled statement can be any block statement it does not have to be preceded by a loop statement Examples The following function has a break statement that terminates the while loop when i is 3 and then returns the value 3 x function testBreak x var i 0 while i lt 6 if i 2 1 break i 1 recur i gt xj Related topics e continue switch 39 Lighter Project Editor User s Manual amp VDATALOGIC DATALOGIC AUTOMATION DATALOGIC AUTOMATIOR 6 4 2 Const Summary Declares a read only named constant Syntax const varnamel valuel varname2 value2 varnameN valueN Parameters Parameter Description lvarnameN Constant name It can be any legal identifier lvalueN Value of the constant It can be any legal expression Description Creates a constant that can be global or local to the function in which it is declared Constants follow the same scope rules as variables The value of a constant cannot change through re assignment and a constant cannot be re declared Because of this although it is possible to declare a constant without initializing it it would be useless to do so A const
31. statement labeled check j If continue is encountered the program continues at the top of the check 4 statement Each time continue IS encountered check j reiterates until its condition returns false When false is returned the remainder of the checkiandjstatement is completed 41 Lighter Project Editor User s Manual SVDATALOGIC Ifcontinuehad a label ofcheckiandj the program would continue at the top of the checkiandj statement checkiandj while i lt 4 Printi J i 1 checkj while j gt 4 print 27 J l Le AC a 2 0 continue checkj Dbrancty 1s odd T Perea S m oE Ly prone Oy Ye ghj Related topics e break label Lighter Help Online Manual 42 GVATALOGIC DATALOGIC AUTOMATION 6 4 4 For Summary Creates a loop that consists of three optional expressions enclosed in parentheses and separated by semicolons followed by a statement executed in the loop Syntax for initial expression condition final expression statement Parameters Parameter Description An expression including assignment expressions or variable declaration Typically initial used to initialize a counter variable This expression may optionally declare new expression _ variables with the var keyword These variables are not local to the loop that is they are in the same scope thefor loop is in The result of this expression is discarded An exp
32. whose zeroth element is the match string In this case the empty string because lastIndex was 2 and still is 2 and hi has length 2 multiline Reflects whether or not to search in strings across multiple lines multiline is a property of an individual regular expression object The value of multiline is true if the m flag was used otherwise false The m flag indicates that a multiline input string should be treated as multiple lines For example if m is used and change from matching at only the start or end of the entire string to the start or end of any line within the string You cannot change this property directly source A read only property that contains the text of the pattern excluding the forward slashes source is a property of an individual regular expression object You cannot change this property directly Lighter Help Online Manual 90 GVATALOGIC DATALOGIC AUTOMATION 6 6 1 7 String A String IS a sequence of zero or more Unicode characters More Static String functions String String fromCharCode Number code1 Number codez String functions String String charAt Number pos Number String charCodeAt Number pos String String concat string2 string3J stringN Number String indexOf String or RegExp pattern Number pos Number String lastIndexOf String or RegExp pattern Number pos String String match RegExp pattern String stri
33. 9 5 2 2 Executing the Marking OPCratiOn c ccccccccssseccccesececceeseecsesececsegseecseuseeeseaseeessauseessanseesseass 29 5 3 Tosinog a prO ole eee ene E eee nee eee ee ee ee 30 Lighter Help Online Manual 4 GVATALOGIC DATALOGIC AUTOMATION 6 LASER ENGINE LANGUAGE REFERENCE wivectecssstscccstisccnadatngsceeviuesGecersessneuataviseeveesdacerstacneitbsuiedabeveees 31 6 1 Identifiers ANd reserved wordS ccccseecceeceseeeeeeeceaeseeeeeeseeseeeesseseeeeessaeeceeeseeaeeeeeesseaeeesssaanseeeeeeeas 32 6 1 1 What are Id ntifiers ccccccccccccssccceceeceeceeseeeeeeeeceeceeceeseeaeeeseaeceeseeeeessaeeeesseeeeeseeeeeeteaeeeesas 32 6 1 2 Reserved words Keywords cccccssssccccceessececcceesececcceaeeeeeceeuececeseaaseceessuaeeeesssaaaeessssaaees 32 6 2 COMMENTING the COG cccccccccsesseeecceeeeceeeeseceeeeecseaeeseeeeeeeeesuaeseeceeeeessueesseeeeeessuaaseeeeeeeeeessaaaasess 34 6 3 Doel aN nice tte dente E E E E E E E E E E 35 6 3 1 Declaring Functions a aiesicrnsiiede ovis scecsivaciundsastznie velsisaiensa dh denier banc cious wuasious wiiedeaitareeduventuddiame ntre nnnennn nnne 35 6 3 2 IB fete Fel gla ek ee e ene en nee ene ee eee ee ee eee 35 6 3 3 Declaring Variables sci ccccccssadeaseLncevndedensseecdscdeieencesseiseacerndeasccecndeusseect lt baseeecedeoeueeadactesededaznetee 36 6 3 4 Declanng Constants sssrinin a a 37 6 4 OTM ULV MOINS e EE cnnten Geasecasastncesube E E 38 6 4 1 B OK te
34. DELETING PROJECTS cccccccccceeeeeeeeeeeeeseeeeeeeeeesaeaceeeeeseeesaseeeeeseesaaas 23 4 1 Opening a proje Cicus ea Ean aE EEN a E OTE NEEE ENSA 24 4 2 72 WA 06 a POEG esmeg eia n e iaae i E aan eee ee ee eee eer 25 4 2 1 SAVING a project locally ccccccccssssseeecceeeeeeeeeeeceeeeeeeeeeseeeeeeeeeesueeeeeeeeessuaeaseeeeeeeesssaegeeseseeeees 25 4 2 2 Saving a project to the device ceeeccccccccceseeseeeeeeeeeeeaeeeeceeeeeesueeseeeeeeeesssueeaeeeeeesssaeaeeeeeeeeees 25 4 3 Managing files on the GEVICE ccecccccccseeeeeeeceeesseeeeeseeeeeesseueceeeseeaseeeeesaaaeeeessaeaeeeesaeaseeseeessaness 26 4 3 1 Opening a project from a COVICE cccccccccsseeeeeeceeeeeeeaeeeeeceeeeeeeeeeeeeeeeeeseeaaeeeeeeeeessaaeeeeeeeeees 26 4 3 2 Saving a project as the default project eeeecccccccecceeeeeeeeeeeeeseeeeseeeeeeeessaeeeeeeeeeessaaaseeseeees 26 4 3 3 Deleting a project from the GOVICE cccccceeeceeeceeeeeeeeeeeeeeeeeeeeeeeseeesseaeeeeessaaeeeeeesaaeeeesssaaees 26 5 SENDING PROJECTS TO MARKING sisiccscccsscsnesisiccsiatexseopestesteevedbasesiadeupeetnotniscstauessvaiesinndesdad asboseeesbees 27 5 1 Connecting to the COVICE ccccceseeseecccceeeceeeeeeeceeeeceeeeseeeeeeeeessaeaseseeeeeeeaesueeceeeeeessuaeaeeeeeeeeessssaasaess 28 5 2 RUNNING d DOECO aae E et een ane eee ee eee 29 5 2 1 Manual Mode vs Auto MOde ccccccccccesseeeceeceeeeeceeeceeeeeeeseeaseeeeesseeeeeeesssaueeesessaaeeesesaaaaees 2
35. Matches a tab v Matches a vertical tab S Matches any alphanumeric character from the basic Latin alphabet including the w underscore Equivalent to A Za z0 9_ For example w matches a in apple 5 in 5 28 and 3 in 3D Matches any character that is not a word character from the basic Latin alphabet W Equivalent to A Za z0 9_ For example W or A Za z0 9_ matches in 50 Where n is a positive integer A back reference to the last substring matching the n co parenthetical in the regular expression counting left parentheses For example apple sorange 1 matches apple orange in apple orange cherry peach 0 Matches a NUL character Do not follow this with another digit xhh Matches the character with the code hh two hexadecimal digits uhhhh Matches the character with the Unicode value hhhh four hexadecimal digits tequivalent_s Equivalent to t n v f r u00a0 u2000 u2001 u2002 u2003 u2004 u2005 u2006 u2007 U2008 u2009 u200a u200b U2028 u2029 u3000 equivalent_S Equivalent to t n v fir u00a0 u2000 u2001 u2002 u2003 u2004 u2005 u2006 u2007 u2008 u2009 u200a u200b U2028 u2029 u3000 The literal notation provides compilation of the regular expression when the expression is evaluated Use literal notation when the regular expression will remain constant For example if you use literal notation to construct a regular expression used in a l
36. R crsiaxactccczcccnedeesassdezendons ceina ara se eea Tarnai 8 2 1 ADOLTO CCU COM asta sencaneicessaesrancdana sete sancusasnbincvadelycetarnumisiassouuetees cubarabosnaatotsdudiardes R EE 9 2 2 Work environment OVELVICW ccccceeccceeececeeseeceneeeceeecsenceeseseesaueessaeeeseaeeeseaeessaueeeseeessaeeessnseesaaees 10 2 2 1 Work environment COMPONENAS ccccccseeeeeeeeeeeeceeeeeceeeeeeseaeeeeeeaueeessaeeeessaeeeeesseeeeesseeeeeeas 11 r MANAGING PP OFC occ ear zaes aneae ua csandecoecoee T E E E 12 3 1 CIO CORTOU NOI a E E A E nen siesneais 13 3 2 RS LUI eh OO aad atesictse scezcrece ccs aisin cieienusbetecaesivoncecaeisestentied aeattenchndacahansind T 14 3 3 POAC MAGNE S tothe Di OIC C eseria nn Aa r a E aE OE aa edie a 16 3 3 1 Creating a new source file ccseeecccccceesseccceeesececccauueceeeseaueeeeessaeeecessauseeeesseageeeesssuagsseees 17 3 3 2 Importing source or resource files into a project c cc eceeeeceeeeeeeeeeeeeeeeeeeeeeeeeaaeeeeeeaaeeeeeesaaees 17 3 4 Working With Source TSS ssis anaana a a aiai 18 3 4 1 Copying cutting and pasting text ec ceeeeeeeceeeeeeseeeeeeeeeeeeeeeeseeeeeeeessueeeeeeeeeeesseaeeeseeees 19 3 4 2 Searching Or replacing EX ara E E EE E 20 3 4 3 Renaming or deleting files ccccccssseccccceeseececcceeeececceeaeeeeseeasececessauseceesseaaeeeeessaaaeesssasaaass 21 3 4 4 E XDONINO SOUNGE TOS saien E a 21 3 5 POUT FOI ACES aeaea E N E E 22 4 OPENING SAVING AND
37. TALOGIC AUTOMATION Example function Employee name salary Person call this name call base constructor this salary salary set the prototype to be an instance of the base class Employee prototype new Person initialize prototype Employee prototype toString function Again you can use theinstanceofto verify that the class relationship between Employee and Person has been correctly established var e new Employee Johnny Bravo 5000000 print e instanceof Employee true print e instanceof Person j true print e instanceof Object true print e instanceof Array false 6 3 3 Declaring Variables Variables are declared using the var keyword Var aj undefined var c foliage the string folvage x l global variable Ifa variable is assigned to without being declared it is automatically declared as a global variable Using global variables can make your code difficult to debug and maintain and is not recommended Using the var keyword you can optionally initialize variables If just the variableName is given the variable is created but it has no value that is its value is undefined var variableName var anotherVariableName InitialValue If an InitialValue is given the variable is created and assigned this InitialValue Variables declared within functions are local to the function in which they are declared Variables declared outsi
38. TION Detailed description Instances of the Date class are used to store and manipulate dates and times A variety of get functions are provided to obtain the date time or relevant parts see Date functions A complementary variety of set functions are also provided such as for example setDate Or set Year The functions operate using local time Conversion between Date objects to and from strings are provided by parse and Date toString Elapsed time in milliseconds can be obtained by creating two dates casting them to Number and subtracting one value from the other var datel new Date 7 time flies var date2 new Date var timedifference date2 getTime datel getTime Date constructor documentation Dates can be constructed with no arguments in which case the value is the date and time at the moment of construction using local time A single integer argument is taken as the number of milliseconds since midnight on the 1st January 1970 Date Date milliseconds Date year month day optHour optMinutes optSeconds optMilliseconds var today new Date var d new Date 1234567 var date new Date 1994 4 21 Var moment new Date 1966 5 Ll 23 55 30 Static Date functions documentation Date parse String dateString This is a static function that parses a string dateString which represents a particular date and time It returns the number of milliseconds
39. The content of myArray e mq inaez T The 0 based index of the match in the string p Myarray TT T The original string lcdbBdbsbz to T The last matched characters dbBd The parenthesized substring matches if any The 1 n number of possible parenthesized substrings is unlimited 87 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION Last Index The index at which to start the next match 5 IgnoreCase Indicates if the i flag was used to ignore case true MyRe lglobal Indicates if the g flag was used for a global match true a Indicates if the m flag was used to search in strings multiline i false across multiple line source The text of the pattern la b d lf your regular expression uses the g flag you can use the exec method multiple times to find successive matches in the same string When you do so the search starts at the substring of str specified by the regular expression s last Index property For example assume you have this script var myRe ab g var str abbcdefabh var myArray while myArray myRe exec str null var msg Found T myArray 0 s msg Next match starts at myRe lastiIndex print msg i This script displays the following text Found abb Next match starts at 3 Found ab Next match starts at 9 Example Using exec to execute a match against the input In the following example t
40. a 2 Press F5 or click S Run Project 3 To stop the project click S Stop Project Note Ei When you press Run Project a copy of the project that you are executing is automatically saved to the device Lighter Help Online Manual 30 GSVATALOGIC DATALOGIC AUTOMATION 6 LASER ENGINE LANGUAGE REFERENCE About this reference This language reference describes the language features provided by Laser Engine Program for Applications Laser Engine is based on the ECMAScript scripting language as defined in the ECMAScript Language Specification Microsoft s JScript and Netscape s JavaScript are also based on the ECMAScript standard Audience This reference is addressed to developers who will use Project Editor to write their own programs in order to automate marking operations and to customize Laser Editor so as to suit their environment specific needs Readers are assumed to have a basic understanding of programming Contents This language reference is organized into the following sections Section Contents Identifiers and reserved words What are identifiers and reserved keywords that you cannot use Commenting the code How to comment the code within your programs Declarations How to declare classes functions variables and constants A full description of the control statements and how to use them in a Control Statements program Classes _and__ Methods Member c functions What are class
41. a project To import a source file You can import an existing source file for further editing 1 Do one of the following o From the menu bar choose File gt Import source file o In the Project Files pane right click the Source Files folder or an existing source file and then choose Import source file from the shortcut menu 2 Inthe Import file window that is displayed browse to locate the qs file and click Open Note that the file is added under the Source files folder in the Project Files pane To import a resource file You might import image files icons database file Word or Excel documents as well as XML files 1 Do one of the following o From the menu bar choose File gt Import file o In the Project Files pane right click the Resource Files folder or an existing resource file and then choose Import file from the shortcut menu 2 Inthe Import file window that is displayed browse to locate the required file and then click Open Note that the file is added under the Resource files folder in the Project Files pane 17 Lighter Project Editor User s Manual SVDATALOGIC 3 4 Working with Source files You can easily manage or edit source files by using the menu bar the toolbar or by right clicking the files into the Project Files pane For further information e Copying cutting and pasting text e Searching or replacing text e Renaming or deleting files e Exporting source files Lig
42. ailable 2 operator instanceof operator J operator new operator function operator this operator in operator typeof operator operator expression resultIfTrue resultIfFalse This operator evaluates its first operand the expression If the expression is true the value of the second operand resultIfTrue is returned otherwise the value of the third operand resultIfFalse is returned operator expressionl expression2 This operator evaluates its first and second operand expression1 and expression2 and returns the value of the second operand expression2 The comma operator can be subtle and is best reserved only for use in argument lists function operator var variable function optArguments Statements This operator is used to create anonymous functions Once assigned the variable is used like any other function name e g variable 1 2 3 Specify the argument names in optArguments if named arguments are required If no optArguments are specified arguments may still be passed and will be available using the arguments list See Arguments variable The Laser Engine Program function operator supports closures for example function make_counter initialValue var current initialValue return function increment 1 Current increment return current Var Counters make comter 3 J 17 7 Start at 3 var counlerBD make counter 12 J 77 Start at 12 debug counterA 2
43. ant cannot share its name with a function or a variable in the same scope Examples The following example produces the output a is 7 const a 7 Prine a dee ot ae oe ae Ne Pe Related topics e var Lighter Help Online Manual 40 GVATALOGIC DATALOGIC AUTOMATION 6 4 3 Continue Summary Terminates execution of the statements in the current iteration of the current or labelled loop and continues execution of the loop with the next iteration Syntax continue label Parameters Parameter Description llabel Identifier associated with the label of the statement Description In contrast to the break statement continue does not terminate the execution of the loop entirely instead e In awhile loop it jumps back to the condition e Ina for loop it jumps to the update expression The continue statement can include an optional label that allows the program to jump to the next iteration of a labelled loop statement instead of the current loop In this case the continue statement needs to be nested within this labelled statement Examples Using continue with while The following example shows awhile loop that has acontinue statement that executes when the value of iis 3 Thus n takes on the values 1 3 7 and 12 1 0 n 0 while i lt 5 LFF if i 3 Continue iPS 1 Using continue with a label In the following example a statement labeled checkiandj contains a
44. ar 3 Note that in the Output pane of the Project Editor s window the results of the operation are displayed In the example here below the message says that the program has been loaded TODO 4 To stop the execution click S Stop Project 29 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION To save a project to the device for next marking From the Project Editor menu bar do one of the following e To save the project choose File gt Save Project to Device or Save Project to Device As The project will be sent to the engraver in an automated way For further information see Saving a project to the device e To save the project as the default choose File gt Save device default project For further information see Saving a project as the default project 5 3 Testing a project Gp Gp By SB Project Editor can be used to test your projects by executing them on the connected device Attention The simulation can only be done in Manual Mode In Auto Mode the feature is not available i and the laser engraving is managed automatically through the Laser Engine see Manual Mode vs Auto Mode To test your program 1 Be sure that you have activated the Manual Mode To activate it from the menu bar choose File gt Switch to Manual Mode Note This is a toggle command if the Manual Mode is activated the command is To Auto Mode and vice versa
45. arger range of values If this argument is omitted it is treated as 0 This method returns a string representation of number that does not use exponential notation and has exactly digits digits after the decimal place The number is rounded if necessary and the fractional part is padded with zeros if necessary so that it has the specified length If number is greater than 1e 21 this method simply calls Number toString and returns a string in exponential notation 81 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION toFixed throws the following e RangeError If digits is too small or too large Values between O and 20 inclusive will not cause aRangeError Implementations are allowed to support larger and smaller values as well e TypeError If this method is invoked on an object that is not a Number Var n 12345 0789 n toFixed Returns 12346 note rounding no fractional part i tori xed 1 j 7 Returns 12345 77 note rounding n torkixed 6 Returns 12345 678900 note added zeros 1 23e 20 toFixed 2 Returns 123000000000000 000000 00 1 23e 10 toFixed 2 Returns 0 00 Number toLocaleString Returns a human readable string representing the number using the locale of the environment Number toPrecision precision Returns a string representing the Number object to the specified precision Parameter precision An integer specifying the number of si
46. aring Constants e Declaring Functions 6 1 2 Reserved words Keywords Laser Engine Program reserves some words which are valid identifiers for its own use Important notice You cannot use any of these reserved words as identifiers for variables functions methods The following words are used as keywords in proposed extensions and are therefore reserved to allow for the possibility of future adoption of those extensions abstract boolean byte char class const debugger double enum export extends final float goto implements import Lighter Help Online Manual 32 GVATALOGIC int interface long native package private protected public short static super synchronized throws transient volatile Related topics e Declarations e Classes and Methods Member functions e Native and Built in Objects e Built in Constants 33 Lighter Project Editor User s Manual SVDATALOGIC 6 2 Commenting the code Laser Engine Program for Applications supports the same commenting syntax as C One line comments may appear on a line of their own or after the statements on a line Multi line comments may appear anywhere A one line comment A multi line comment Lighter Help Online Manual 34 GVATALOGIC DATALOGIC AUTOMATION 6 3 Declarations This section describes how to declare classes functions variables and constants They are declared wit
47. ate information in theDate object accordingly For example if you use 100 for secondsValue the minutes minutesValue will be incremented by 1 minutesValue 1 and 40 will be used for seconds theBigDay new Date theBigDay setUTCMinutes 43 Date setUTCMonth monthValue day Value Sets the month for a specified date according to universal time Parameters monthValue An integer between 0 and 11 representing the months January through December dayValue An integer from 1 to 31 representing the day of the month lf you do not specify the dayValue parameter the value returned from the getUTCDate method is used If a parameter you specify is outside of the expected range set UTCMonth attempts to update the date information in the Date object accordingly For example if you use 15 for monthValue the year will be incremented by 1 year 1 and 3 will be used for month theBigDay new Date theBigDay setUTCMonth 11 Date setUTCSeconds seconds Value ms Value Sets the seconds for a specified date according to universal time Parameters secondsValue An integer between 0 and 59 representing the seconds msValue A number between 0 and 999 representing the milliseconds If you do not specify the msValue parameter the value returned from the getUTCMilliseconds method is used If a parameter you specify is outside of the expected range setUTCSeconds attempts to update the date information in the Date obje
48. ay a ob Cc J3 x push 121 33 77 R Ta Dp a 121 7 Array reverse Reverses the items in the array var x new Array aoe eu ae Ole q xXx reverse IJ x a u ai Oe HET maT Array shift Shifts that is removes the bottom most left most item off the array and returns it Var x Tew Array a p ce y var y x shift y a x p e Array slice Number startIndex Number optEndIndex Extracts a slice of the array from the item with the given starting index to the item before the item with the given ending index optEndIndex Parameters startIndex Zero based index at which to begin extraction optEndIndex Zero based index at which to end extraction slice extracts up to but not including end If no ending index is given all items from the starting index onward are sliced var xX new Array do ae sO ee TO q k var y goliga 1 2 Jj 7 7 y Tp Tom j var 2z klice 2 j fi a eon Ta Array sort Function optComparisonFunction Sorts the items in the array using string comparison Parameter optComparisonFunction Specifies a function that defines the sort order If omitted the array is sorted lexicographically in dictionary order according to the string conversion of each element For customized sorting pass the sort function a comparison function opt ComparisonFunction that has the following signature and
49. ayValue An integer between 1 and 31 representing the day of the month If you specify the dayValue parameter you must also specify the monthValue lf you do not specify the monthValue and dayValue parameters the values returned from the getMonth and getDate methods are used theBigDay new Date theBigDay setFullYear 1997 Date setHours Number hour Sets the hour to the specified hour which must be in the range 0 23 in local time The minutes seconds and milliseconds past the hour optMinutes optSeconds and optMilliseconds can also be specified var d new Date 1975 12 25 22 30 3 a eetHours 10 d 1980 12 30T10230 00 Date setMilliseconds Number milliseconds Sets the milliseconds component of the date to the specified value in local time var d new Date 1975 12 25 22 30 7 d setMilliseconds 998 d 1980 12 30T10 30 00 998 Date setMinutes Number minutes Sets the minutes to the specified minutes which must be in the range 0 59 in local time The seconds and milliseconds past the minute optSeconds and optMilliseconds can also be specified var d new Dave 1975 12 25 22 30 J d setMinutes 15 d 1980 12 30T10 15 00 Date setMonth Number month Sets the month to the specified month which must be in the range 0 11 in local time Var d new Date 19 5 12 25 22 30 13 d setMonth 0 d 1980 01 11T22 30 00 Date setSeconds
50. ch results x y Matches x only if x is not followed by y 7 iy For example d matches a number only if it is not followed by a decimal point d exec 3 141 matches 141 but not 3 141 Matches either x or y For example green red matches green in green apple and red in red apple Where n is a positive integer Matches exactly n occurrences of the preceding item n For example a 2 doesn t match the a in candy but it matches all of the a s in caandy and the first two a s in caaandy Where n Is a positive integer Matches at least n occurrences of the preceding item n For example a 2 doesn t match the a in candy but matches all of the a s in caandy and in caaaaaaandy Where n and m are positive integers Matches at least n and at most m occurrences of the preceding item n m For example a 1 3 matches nothing in cndy the a in candy the first two a s in caandy and the first three a s in caaaaaaandy Notice that when matching caaaaaaandy the match is aaa even though the original string had more a s in tt T A character set Matches any one of the enclosed characters You can specify a range of characters by using a hyphen For example abcd is the same as a d They match the b in brisket and the c in ache xyz A negated or complemented character set That is it matches anything that is not xyz enclo
51. ct accordingly For example if you use 100 forsecondsValue the minutes stored in the Date object will be incremented by 1 and 40 will be used for seconds theBigDay new Date theBigDay setUTCSeconds 20 Date toUTCString Converts a date to a string using the universal time convention The value returned by toUTCString Is a readable string formatted according to UTC convention The format of the return value may vary according to the platform var today new Date ver UTCstring Coday TOoUTCString Mon 03 Jul 2006 21 44 38 GMT DATALOGIC DATALOGIC AUTOMATION 6 6 1 5 Number A Number is a datatype that represents a number In most situations programmers will use numeric literals like 3 142 directly in code More Number functions String Number toString radix String Number toExponential fractionDigits String Number toFixed Digits String Number toLocaleString _ String Number toPrecision recision Number Number valueOf Number properties Number MAX VALUE Number MIN VALUE Number NaN Number NEGATIVE INFINITY Number POSITIVE INFINITY Detailed description A Number is a datatype that represents a number In most situations programmers will use numeric literals like 3 142 directly in code The Number datatype is useful for obtaining system limits e g MIN_VALUE and MAX_VALUE and for performing number to string conversions with toString
52. cted range setUTCFullyYear attempts to update the other parameters and the date information in the Date object accordingly For example if you specify 15 for monthValue the year is incremented by 1 year 1 and 3 is used for the month theBigDay new Date theBigDay setUTCFullYear 1997 Date setUTCHours hours Value minutes Value seconds Value ms Value Sets the hour for a specified date according to universal time Parameters hoursValue An integer between 0 and 23 representing the hour minutes Value An integer between 0 and 59 representing the minutes secondsValue An integer between O and 59 representing the seconds If you specify the secondsValue parameter you must also specify the minutesValue msValue A number between 0O and 999 representing the milliseconds If you specify the msValue parameter you must also specify the minutesValue and secondsValue If you do not specify the minutesValue secondsValue andmsValue parameters the values returned from the getMinutes getSeconds and getMilliseconds methods are used lf a parameter you specify is outside of the expected range set UTCHours attempts to update the other parameters and the date information in the Date object accordingly For example if you use 100 for secondsValue the minutes will be incremented by 1 min 1 and 40 will be used for seconds theBigDay new Date theBigDay setUTCHours 8 Date setUTCMilliseconds millisecond
53. d This is the value of a variable that has never been declared or that has been declared but has not been assigned a value Example Var ij if i undefined 1 77 In this example if execution reaches the if statement and i has not been assigned a value it will be assigned the value 77 97 Lighter Project Editor User s Manual SVDATALOGIC PAT hrr Biaaattt worked DATALOGIC AUTOMATION 6 6 4 Built in Functions Laser Engine Program provides the following built in functions connect lisNaN disconnect lisFinite iprint parseFloat levall parselnt See also e Declaring Functions 6 6 4 1 connect Syntax connect function This function is used to create signals and slots connections between objects It has two forms with or without arguments as it is shown in the following examples Example without arguments function myInterestingScriptFunction sas myQObject somethingChanged connect myInterestingScriptFunction Example with arguments FUNCTION MyInLerstangSscripltrunetion2 argl argq2 ass myQObject SsomethingChanged2 argl arg2 connect myInterestingScriptFunction 2 Note that the function is resolved when the connection is made not when the signal is emitted e Back to the full list of Built in Functions 6 6 4 2 disconnect To disconnect from a signal you invoke the signal s disconnect function passing the function to
54. d in a boolean context for example in an if statement If the expression s value is 0 null false NaN undefined or the empty string the expression IS false otherwise the expression Is true Boolean functions documentation Boolean toString Returns a string representing the specified Boolean object Laser Engine Program calls the toString method automatically when a Boolean is to be represented as a text value or when a Boolean is referred to in a string concatenation For Boolean objects and values the built in toString method returns the string true or false depending on the value of the boolean object In the following code flag toString returns true var flag new Boolean true var myVar flag toString Boolean valueOf Returns the primitive value of a Boolean object or literal Boolean as a Boolean data type x new Boolean myVar x valueOf assigns false to myVar 69 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION 6 6 1 4 Date Instances of the Date class are used to store and manipulate dates and times More Static date functions Number Date parse String dateString Number Date UTC year month date hrs min sec ms Date functions Number Date getDate Number Date getDay Number Date getFullYear Number Date getHours Number Date getMilliseconds Number Date getMinutes Number Date
55. d information Table 1 Statements list S Statement Description Terminates the current loop switch or label statement and transfers program control to break the statement Soe Se a a aaeeeo the terminated statement leont Declares a Declares a global constant and initializes itto a value 000 constant and initializes it to a value This keyword is used within the context of a for while ordo loop Terminates continue execution of the statements in the current iteration of the current or labelled loop and continues execution of the loop with the next iteration Creates a loop that consists of three optional expressions enclosed in parentheses and E ee eee by semicolons followed by a statement executed in the loop function Declares a function a function if else Executes a statement if a specified condition is true If the condition is false another Pandas ar Homifar fora aalowont Goulnus au slow ie Woksaloe WEDGE can be executed Provides an identifier for a statement continue and refers to it elsewhere in a program _ an identifier for a statement continue and refers to it elsewhere in a Sa eeeeEEeeeee return Specifies the value to be returned by a function the value to be returned by a function Evaluates an expression matching the expression s value to a case label and executes switch statements associated with that case throw Throws a user defined Throws a user defined exception eee za aich Marks a
56. d into the Laser Engine Language Reference section of this Help System To access it choose menu Help gt Help or press F1 at a window level Related topics e Work environment overview e Managing Projects 9 Lighter Project Editor User s Manual amp VDATALOGIC 2 2 Work environment overview This section provides an overview of the Project Editor work environment The picture below shows the main window of Project Editor when you access it Function ongQuerysta Y a Source Files i my main gs Tope 89 Resources t Function onQueryStopt TODO aa onLaserStartt 7 rong a onLaserEnd ve Tapa eo System _oninit System onSyshemQueryStart conmect onQuery Start repent pn ap 9 SshemonSyshenmLsserEnd conmect onLaserErnd Tope To hide unhide a pane in the Project Editor window either use the Window menu or right click in a blank area next to the toolbar Lighter Help Online Manual 10 GVATALOGIC DATALOGIC AUTOMATION 2 2 1 Work environment components Area Description Menu bar with all the Project Editor commands All functions are described later Toolbar It shows the tools that allow creating managing and running the project Point and hover a button to display a tooltip All functions are described later Right click this area to display a shortcut menu that allows you to hide unhide the panes 5 6
57. de of functions and classes are global Example var 1 Var Count 22 var Str string Lighter Help Online Manual 36 GVATALOGIC nue a Ts oS r Bil 858 A F OF mt isit ALIITOR r mee PAL ALS AU TOUMA I UMN 6 3 4 Declaring Constants Constants are declared using the const keyword Syntax const identifier Value The const keyword is used to define constant values The identifier is created as a constant with the given value The constant is global unless defined within the scope of a class or function Constants must be defined at the point of declaration because they cannot be changed later Constants are public global if they are declared outside of any enclosing braces When declared within the scope of some braces that is within an i statement their scope is local to the enclosing block Example const PI2 Math PI 2 Const COPYRIGHT Copyright c 2001 37 Lighter Project Editor User s Manual amp VDATALOGIC DATALOGIC AUTOMATION 6 4 Control Statements The flow of control in Laser Engine Program is controlled by control statements Statements consist of keywords used with the appropriate syntax A single statement may span multiple lines Multiple statements may occur on a single line if each statement is separated by a semicolon The following table summarizes the Laser Engine Program Control statements Click the statement s name for detaile
58. dom Returns a pseudo random floating point number between 0 and 1 Pseudo random numbers are not truly random but may be adequate for some applications for example games and simple simulations Math round Number number Returns the number rounded to the nearest integer If the fractional part of the number is gt 0 5 the number is rounded up otherwise it is rounded down Math sin Number number Returns the sine of the given number The value will be in the range 1 1 Math sqrt Number number lf the number is gt 0 it returns the square root If the number is lt 0 it returns NaN Math tan Number number Returns the tangent of the given number 63 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION DATALOGIC AUTOMATION Math properties documentation All the Math properties are read only constants E Eulers constant The base for natural logarithms LN2 Natural logarithm of 2 LN10 Natural logarithm of 10 LOG2E Base 2 logarithm of E LOG10E Base 10 logarithm of E Pl Ratio of the circumference of a circle to its diameter SQRT1_ 2 Square root of 1 2 equivalently 1 over the square root of 2 SQRT2 Square root of 2 Lighter Help Online Manual 64 GVATALOGIC DATALOGIC AUTOMATION Xx An Array is a datatype which contains a named list of items More 6 6 1 2 Array Array functions Array Array concat
59. e but it does not need to be so The optional break statement associated with each case label ensures that the program breaks out of switch once the matched statement is executed and continues execution at the statement following switch Ifbreak is omitted the program continues execution at the next statement in the switch statement Lighter Help Online Manual 48 GVATALOGIC Examples In the following example if expression evaluates to Bananas the program matches the value with case Bananas and executes the associated statement When break is encountered the program breaks out of switch and executes the statement following switch If break were omitted the statement for case Cherries would also be executed Switch expr case Oranges print Oranges ate 0 59 a pound break case Apples print Apples are 0 32 a pound break case Bananas print Bananas are 0 48 a pound break case Cherries print Cherries are 3 00 a pound break case Mangoes case Papayas print Mangoes and papayas are 2 79 a pound break default Oin Dorry We ere out Of Expr t TT print Is there anything else you d like 49 Lighter Project Editor User s Manual amp VDATALOGIC U bape l gim i g ih E I FF eee k TI Fh h Fi 1 rm rA Fa rt J Eai A AT i iN DATALOGIC AUTOMATION 6 4 10 Throw Summary Throws a user defined excepti
60. e Working with Source files e About Formatters Lighter Help Online Manual 12 GVATALOGIC DATALOGIC AUTOMATION CHAPTER 3 3 1 Editor configuration You can customize Project Editor in terms of syntax formatting of the source files during editing To customize the editor 1 From the Project Editor s menu bar choose Edit gt Configuration The Preferences dialog box is displayed showing the current settings Keyword l Bold Preprocessor Label W itait Underine Change color Pee TERY Options Indentation M Word Wrap Tab Size e Indent Size f4 W Completion l Keep Tabs i Parentheses Matching I Auto mident 2 From the Element list choose the item s you want to change the formatting for and enter the desired values 3 When finished click OK Related topics e Creating a project e Adding files to the project SVDATALOGIC DATALOGIC AUTOMATION 3 2 Creating a project About Projects The Project is a program with a xqs extension that works as a container for the files that are used to run the application In particular a project is composed by Source files that is the files that contain the code and Resource files that is any image file database file Word or Excel documents and so forth that are required to run the program See Adding files to the project When you are working on a project the Project Files pa
61. e ee fo hE DATALOGIC AUTOMATION Ee l FE imh aF F F EPEF ER E r fa Another example of throwing an object The following example tests an input string for a U S zip code If the zip code uses an invalid format the throw statement throws an exception by creating an object of type ZipCodeFormatException Creates a ZipCode object Accepted formats for a zip code are 12345 i 1234570789 123456789 as 12343 6139 de Te argument passed to the Z1pCode Conmstrucror does nolL conform to one of these patterns an exception is thrown j function ZipCode zip Zip new String zZip pattern y 0 2 torUl TARIA if pattern test zip zip code value will be the first match in the string this value zip match pattern 0 this valueOf function return this value bi this tCOstring function 4 return String this value bi else throw new ZipCodeFormatException zip function ZipCodeFormatException value this value value this message does not conform to the expected format for a Zip code ChLs coOstring fu unction 4 return this value this message bi This could be in a script that validates address data for US addresses a Var ZALPCODE INVALID 1 var ZIPCODE_UNKNOWN_ERROR 2 function verifyZipCode z ery 4 z new ZipCode z catch e if e instanceof ZipCodeFormatException return ZIPCODE_INVALID else
62. earch from It can be any integer between 0 and the length of the string The default value is O The following example uses indexof to locate a value in the string Brave new world var anyString Brave new world print lt The index of the first w from the beginning is anyString indexOf w Displays 8 Lighter Help Online Manual 92 GSVATALOGIC DATALOGIC AUTOMATION String lastindexOf String or RegExp pattern Number pos Returns the last index ofpatternin the string starting at position pos and searching backwards from there If no position is specified the function starts at the end of the string If the pattern is not found in the string 1 is returned Parameters pattern A string representing the value to search for pos The location within the calling string to start the search from indexed from left to right It can be any integer between 0 and the length of the string The default value is the length of the string The following example uses last IndexoOf to locate a value in the string Brave new world var anyString Brave new world print lt The index of the first w from the end is anyString lastIndexOf w Displays 6 String match RegExp pattern Returns the matched pattern if this string matches the pattern defined by regexp If the string doesn t match or regexp is not a valid regular expression undefined Is returned String replace RegExp pattern String
63. een 0 and the length of the string The following example uses substring to display characters from the string Laser Editor assumes a print function is defined var anyString Laser Editor Displays Light Print lanystring substring 0 3 String toLowerCase Returns the value of the string converted to lowercase toLowerCase does not affect the value of the String itself String toString Returns a string representing the specified object The following example displays the string value of a String object x new String Hello world alert x toString Displays Hello world String toUpperCase Returns the value of the string converted to uppercase toUpperCase does not affect the value of the string itself String property documentation length A value that specifies the length of the string 95 Lighter Project Editor User s Manual SVDATALOGIC nE Te oe E Pe a Baik es ah io a 7 DATALOGIC AUTOMATION 6 6 2 Arguments variable The arguments object is a local variable available within all functions You can refer to a function s arguments within the function by using the arguments object This object contains an entry for each argument passed to the function the first entry s index starting at 0 For example if a function is passed three arguments you can refer to the argument as follows arguments 0 arguments 1 arguments 2 The arguments object
64. eparator is separator print The array has arrayOfStrings length elements for var i U 2 artayoOrstriangs length at print arrayOfrStrings a T 7 var tempestString Oh brave new world that has such people in ILe y Var m nthsString Jan Feb Mar Apr May Jun Jul Aug sep Oct Nov Dec var space var comma SpILtSEfing Lempesesuring space splitsString tempestString splitString monthString comma Lighter Help Online Manual 94 GVATALOGIC DATALOGIC AUTOMATION This example produces the following output The original string is Oh brave new world that has such people i ibs The separator is The array has 10 elements Oh brave new world that has such people in it The original string is Oh brave new world that has such people in les The separator is undefined The array has 1 elements Oh brave new world that has such people in it The original string is Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec The separator is The array has 12 elements Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec String substring Number startIndex Number endIndex Returns a copy of this string which is the substring starting at start Index and ending at endIndex Parameters startIndex An integer between 0 and one less than the length of the string endIndex An integer betw
65. eption_var_l An identifier to hold an exception object for the exception_var_2 associated catch clause lcondition_1 A conditional expression Statements that are executed after thetry statement completes finally_statements These statements execute regardless of whether or not an exception was thrown or caught Description The try statement consists of atry block which contains one or more statements and at least one catch clause or a finally clause or both That is there are three forms of the try statement le CRY sCacch 2 PY tinally 3 TEV os Cetin anti nally A catch Clause contain statements that specify what to do if an exception is thrown in the try block That is you want the try block to succeed and if it does not succeed you want control to pass to the catch block If any statement within the try block or in a function called from within the t ry block throws an exception control immediately shifts to the catch clause If no exception is thrown in the try block the catch clause is skipped The finally clause executes after thetry block andcatchclause s execute but before the statements following the try statement It always executes regardless of whether or not an exception was thrown or caught You can nest one or more try statements If an inner try statement does not have a catch clause the enclosing try statement s catch clause is entered You also use the try statement to handle Java exceptions
66. erties Number Number Number Number Number Number Number Number Im LN10 LOG2E LOG10E PI SQRT1 2 SQRT2 Detailed description The built in Math object provides a variety of functions including all the common mathematical functions The Math object always exists in a Laser Engine program Use the Math object to access mathematical constants and functions for example var x angle y with Math PI 2 angle 1 3 y x gini xX Ps angle 61 Lighter Project Editor User s Manual DATALOGIC DATALOGIC AUTOMATION Math functions documentation Math abs Number number Returns the absolute value of the given number The equivalent of x 5 lt U 7 g 2 X var x 99 Var y 99 with Math x absi X y abs y if x y print equal Math acos Number number Returns the arccosine of the given number in radians between 0 and Math PI If the number is out of range returns NaN Math asin Number number Returns the arcsine of the given number in radians between Math PI 2 andMath PI 2 If the number is out of range returns NaN Math atan Number number Returns the arctangent of the given number in radians between Math PI 2 and Math PI 2 lf the number is out of range returns NaN Math atan2 Number yCoord Number xCoord Returns the counter clockwise angle in radians between the positive x axis and the point at
67. es and methods and what are qualified names A description of the native and built in objects that are supplied with the Laser Engine Program for Applications Arguments variable How to use the arguments variables within functions Bulli ja Constants A full description of the constants that are provided which are built ee into the Laser Engine Program Built in Functions A full description of the functions that are provided which are built a into the Laser Engine Program Built in Operators A full description of the operators that are provided which are built BUMIN V perators into the Laser Engine Program Native and Built in Objects 31 Lighter Project Editor User s Manual cdalapralanniniiinn DATALOGIC AUTOMATION 6 1 Identifiers and reserved words 6 1 1 What are identifiers Identifiers are the names for things that you get to make up Laser Engine Program for Application s identifiers match the regex pattern _A Za z _ A Za z0 9 The rules for the construction of identifiers are simple you may use the 52 upper and lower case alphabetic characters the 10 digits and finally the underscore _ which is considered to be an alphabetic character for this purpose The only restriction is the usual one identifiers must start with an alphabetic character Identifiers are used for variables constants class names function names and labels See also e Declaring Classes e Declaring Variables e Decl
68. ew world var anyString Brave new world print The character at index 0 is anyString charAt 0 mt print The character at index 1 is anyString charAt 1 MERSE These lines display the following The character at index 0 is B The character at index 1 is r String charCodeAt Number pos Returns the character code of the character at position pos in the string If the position is out of bounds undefined is returned Parameter Pos An integer greater than O and less than the length of the string if unspecified defaults to 0 The following example returns 65 the Unicode value for A ABC charCodeAt 0 returns 65 String concat string2 string3 stringN Combines the text from one or more strings and returns a new string Changes to the text in one string do not affect the other string Parameter string2 stringN Strings to concatenate to this string sl 0h s2 what a beautiful s3 mornin s4 sil concat 2 63 returns Ob what a beautiful mornin String indexOf String or RegExp pattern Number pos Returns the index of pattern in the string starting at position pos If no position is specified the function starts at the beginning of the string If the pattern is not found in the string 1 is returned Parameters pattern A string representing the value to search for pos The location within the calling string to start the s
69. f the expected range the urc method updates the other parameters to allow for your number For example if you use 15 for month the year will be incremented by 1 year 1 and 3 will be used for the month Because UTC Is a Static method of Date you always use It aS Date UTC rather than as a method of a Date object you created The following statement creates a Date object using GMT instead of local time gmtDate new Date Date UTC 96 11 1 0 0 O Date functions documentation Date getDate Returns the day of the month using local time The value is always in the range 1 31 var d new Date 1975 12 25 J var x d getDates 7 7 x 25 Date getDay Returns the day of the week using local time The value is always in the range 1 7 with the week considered to begin on Monday Var d new Datet 1975 I2 25 22 30 15 gt Var xX d cerbayi 77 x The following shows an example var JndexToDay Mon Tue Wed Thu Fri Sat Sun var d new Date 19 5 12 28 J System println IndexToDay d getDay 1 Prints Sun Date getFullYear Returns the year of the specified date according to local time The value returned by getFullyYear is an absolute number For dates between the years 1000 and 9999 get FullyYear returns a four digit number for example 1995 Use this function to make sure a year is compliant with years after 2000 The following exa
70. formal function argument and declared local variable names will be found more slowly in a with block Where performance is important with would likely only be used to encompass code blocks that do not use function argument and declared local variable identifiers Ambiguity Con e Con with makes it hard for a human reader or Laser Engine Program compiler to decide whether an unqualified name will be found along the scope chain and if so in which object So given this example function f x with o Print x only when f is called is x either found or not and if found either ino or if no such property exists in S activation object where x names the first formal argument If you forget to define x in the object you pass as the second argument or if there s some similar bug or confusion you won t get an error just unexpected results 57 Lighter Project Editor User s Manual SVDATALOGIC Examples The following with statement specifies that the Math object is the default object The statements following the with statement refer to the PI property and the cos and sin methods without specifying an object Laser Engine Program assumes the Math object for these references Vat dy Ze Y var r 10 with Math a Pi 2 7 X i os PI y r gin PI 2 Lighter Help Online Manual 58 GVATALOGIC DATALOGIC AUTOMATION 6 5 Classes and Methods Member functions
71. g For characters that are usually treated literally indicates that the next character is special and not to be interpreted literally For example b matches the character b By placing a backslash in front of b that is by using b the character becomes special to mean match a word boundary Or For characters that are usually treated specially indicates that the next character is not special and should be interpreted literally For example is a special character that means O or more occurrences of the preceding character should be matched for example a means match O or more a s To match literally precede it with a backslash for example a matches a Matches beginning of input If the multiline flag is set to true also matches immediately after a Ci Ci A Wie OLCAN Lighter Help Online Manual 84 GVATALOGIC DATALOGIC AUTOMATION Matches end of input If the multiline flag is set to true also matches immediately before a line break character For example t does not match the t in eater but does match it in eat Matches the preceding item 0 or more times For example bo matches boooo in A ghost booooed and b in A bird warbled but nothing in A goat grunted Matches the preceding item 1 or more times Equivalent to 1 For example a matches the a in candy and all the a s in caaaaaaandy If used immediately after any of the quantifiers
72. gnificant digits See also Number toFixed Digits Number toString radix This method returns a string representing a Number object in fixed point or exponential notation rounded to precision significant digits See the discussion of rounding in the description of the toFixed method which also applies to toPrecision lf the precision argument is omitted behaves as toString If it is a non integer value it is rounded to the nearest integer After rounding if that value is not between 1 and 100 inclusive a RangeError Is thrown Var num 5 123456 print num toPrecision is num toPrecision displays 5 123456 print num toPrecision 4 is num toPrecision 4 displays 9123 print num toPrecision 2 is num toPrecision 2 displays acd Dring num toPrecision 1 is um toPrecision 1 displays 5 Number valueOf Returns the primitive value of a Number object as a number data type var x new Number print x valueOf F printa To Number properties documentation MAX VALUE Returns the maximum value for floating point values MIN VALUE Returns the minimum value for floating point values Lighter Help Online Manual 82 GSVATALOGIC N DATALOGIC AUTOMATION NaN A value representing Not A Number NaN is always unequal to any other number including Nan itself you cannot check for the not a number value by comparing to Number NaN Use the isNaN
73. h class function var and const respectively In this section e Declaring Functions e Declaring Classes e Declaring Variables e Declaring Constants 6 3 1 Declaring Functions A function definition consists of the function keyword followed by e The name of the function e A list of arguments to the function enclosed in parentheses and separated by commas e The Laser Engine Program statements that define the function enclosed in curly braces The statements in a function can include calls to other functions defined in the current application For example the following code defines a simple function named square function square number return number number 6 3 2 Declaring Classes A class is not defined explicitly there is no class keyword Instead you define a new class by defining a constructor function that will initialize new objects Functions that don t operate on the this object static methods are typically stored as properties of the constructor function not as properties of the prototype object The same applies to constants such as enum values The following code defines a simple constructor function for a class called Person function Person name this name name When defining subclasses there s a general pattern you can use The following example shows how to create a subclass of Person called Employee 35 Lighter Project Editor User s Manual SVDATALOGIC Pi J SS f DA
74. he function executes a match against the input It then cycles through the array to see if other names match the user s name This script assumes that first names of registered party attendees are preloaded into the array A perhaps by gathering them from a party database Var A Frank Emily Jane Harry Nick Bech Rick Terrence Carol Ann Terry Frank Pace Rieck Bali Tom Fiona Jane Walloem Joan Bech function lookup input var firstName wt i exec input if firstName print input isn t a namel return var count for var i1 07 a lt A lenoth 1Ft if firstName 0O toLowerCase A 1i toLowerCase CountT var midstring count 1 other has others have print Thanks count midstring the same name Lighter Help Online Manual GVATALOGIC DATALOGIC AUTOMATION RegExp test String str Executes the search for a match between a regular expression and a specified string Returns true or false Parameter str The string against which to match the regular expression When you want to know whether a pattern is found in a string use the test method similar to the String search method for more information but slower execution use the exec method similar to the String match method The following example prints a message which depends on the success of the test functi
75. hter Help Online Manual 18 GVATALOGIC gt A E p am g F a Fm BE A r Fh h DATALOGIC AUTOMATION L 3 4 1 Copying cutting and pasting text When a source file is displayed in the program editor area you can use the menu bar o the toolbar to perform common operations To copy cut and paste text 1 Select the text in the source file or choose File gt Select all to select all the code o To copy the text use the Edit gt Copy menu command or click the Copy button in the toolbar o To cut the text use the Edit gt Cut menu command or click the P Cut button in the toolbar o To paste the text use Edit gt Paste menu command or click the a Paste button in the toolbar 2 Use the A P Undo Redo commands to reverse the changes 19 Lighter Project Editor User s Manual ov TALOGIC m on g h MATAI amp gt AIITARMATI A DATALOGIC AUTOMATION 3 4 2 Searching or replacing text When a source file is displayed in the program editor area you can use the search functions to locate or replace text To search the text 1 From the Search menu choose the appropriate command Find Find Next or Find Previous 2 Inthe window that is displayed specify the search criteria and then click Find To search and replace the text 1 From the Search menu choose Replace 2 Inthe window that is displayed enter the text to be found and text for the replacement 3
76. ied up The following example opens a file and then executes statements that use the file Server side Laser Engine Program allows you to access files If an exception is thrown while the file is open the finally clause closes the file before the script fails openMyFile try tie up a resource writeMyFile theData finally closeMyFile always close the resource Examples See the examples for throw Lighter Help Online Manual 54 GVATALOGIC DATALOGIC AUTOMATION 6 4 12 Var Summary Declares a variable optionally initializing it to a value Syntax var varnamel valuel varname2 value2 VvarnameN valueN Parameters Parameter Description lvarnameN Variable name It can be any legal identifier lvaluen Initial value of the variable It can be any legal expression Description The scope of a variable is the current function or for variables declared outside a function the current application Using var outside a function is optional assigning a value to an undeclared variable implicitly declares it as a global variable However it is recommended to always use var and it is necessary within functions in the following situations e fa variable in a scope containing the function including the global scope has the same name e f recursive or multiple functions use variables with the same name and intend those variables to be local Failure to declare
77. ion You can directly enter the code into the program editor area of Project Editor or you can import an existing file e Resource files that is any image file icons database file Word or Excel documents and so forth that are required by the program at runtime as well as XML files that are used for marking on plastic cards You can import any of these files into your project For further information see Importing source or resource files into a project Source and resource files that compose the project are listed into the Project Files pane which is displayed by default on the left side of the window All the files that compose the project are then synchronized when the project is executed that is they are copied to the device before being executed Files management commands are available by right clicking the files folder or an individual file and then choosing an option form the shortcut menu See pictures below cr von ae ops ea o a a rer TY eT i Source Files ji sercten 0 a h Default gt Resour New Source Ale Eiris Shitteh i eeen man CT New Source Fle Cashin Import Source Fle CtrleShifteS j Rename Fie Ctr Shift h me eck Seach Propet wrx Hep au OD ae e 220900 94 vr Si Source Filas ___main gs Inport Fie Corl Shift 1 Rename Ale CtleShifteA 1 Delete Fie Chl ShiteD Importhle Ctrl Shiftel Related topics e Creating a new source file e Importi
78. ionally equivalent to the get Time method This method is usually called internally by Laser Engine Program and not explicitly in code See also Date getlTime _ x new Date 56 6 17 myVar x valueOf assigns 424713600000 to myVar Date getUTCDate Returns the day date of the month in the specified date according to universal time The value returned by getUTCDate is an integer between 1 and 31 The following example assigns the day portion of the current date to the variable a var d Today new Date d Today getUTCDate Date getUTCDay Returns the day of the week in the specified date according to universal time The value returned by getUTCDay Is an integer corresponding to the day of the week o for Sunday 1 for Monday 2 for Tuesday and so on The following example assigns the weekday portion of the current date to the variable weekday var weekday Today new Date weekday Today getUTCDay Date getUTCFullYear Returns the year in the specified date according to universal time The value returned by getUTCFullYear is an absolute number that is compliant with year 2000 for example 1995 The following example assigns the four digit value of the current year to the variable yr Var Yr Today new Date yr Today getUTCFullYear Date getUTCHours Returns the hours in the specified date according to universal time The value returned by getUTCHours Is a
79. is used to distinguish the namespace a particular identifier belongs to For example in a Laser Engine Program GUI application every application object belongs to the Application object This can lead to some rather lengthy code for example Application Dialog ListBox count Such long names can often be shortened for example within a signal handler e g this ListBox count In practice Laser Engine Program is intelligent enough to work out the fully qualified name so the code you would actually write is simply ListBox count The only time that you need to qualify your names is when an unqualified name is ambiguous 6 5 2 Class Properties A property is an undeclared variable that can be written to and accessed if the class supports properties The classes supporting properties are the application objects and the classes provided by the object and wrapper factories var obj new Object object myProperty 100 The class Object does not define the variable myProperty but since the class supports properties we can define the variable with that name on the fly and use it later Properties are associated with the object they are assigned to so even though the object obj in the example above gets the property myProperty it does not mean that other objects of type object will have the myProperty property unless explicitly stated 59 Lighter Project Editor User s Manual amp VDATALOGIC DATALOGIC AUTOMATION 6 6 Native
80. ith one digit before the decimal point rounded tofractionDigitsdigits after the decimal point If the fractionDigits argument is omitted the number of digits after the decimal point defaults to the number of digits necessary to represent the value uniquely If you use the toExponential method for a numeric literal and the numeric literal has no exponent and no decimal point leave a space before the dot that precedes the method call to prevent the dot from being interpreted as a decimal point lf anumber has more digits that requested by the fractionDigits parameter the number is rounded to the nearest number represented by fractionDigits digits See the discussion of rounding in the description of the toFixed method which also applies to toExponential var num 7 77 1234 print num toExponential is T num toExponential displays 7 71234e 1 print num toExponential 4 is T num toExponential 4 displays 7 7123e 1 print num toExponential 2 is T num toExponential 2 displays 7 71e 1 prant 1234 lt coExponential is 77 1234 C0Exponential displays 7 71234e 1 print 77 toExponential is 77 toExponential displays erl var x 7 Number toFixed Digits Formats a number using fixed point notation Parameter Digits The number of digits to appear after the decimal point this may be a value between 0 and 20 inclusive and implementations may optionally support a l
81. la Foundation Unless otherwise indicated the content is available primarily under the terms and conditions set forth in the Creative Commons Attribution Sharealike License v3 0 or later Code samples are available under the terms of the MIT License The latest versions of these licenses are presently available here e Attribution Sharealike License e MIT License In this section the following objects are described Math Array Boolean Date Number RegExp String Lighter Help Online Manual 60 GVATALOGIC DATALOGIC AUTOMATION Xx 6 6 1 1 Math The built in Math object provides a variety of functions including all the common mathematical functions More Math Functions Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number Math abs Number number Math acos Number number Math asin Number number Math atan Number number Math atan2 Number yCoord Number xCoord Math ceil Number number Math cos Number number Math exp Number number Math floor Number number Math log Number number Math max Number number1 Number number2 Math min Number number1 Number number Math pow Number number Number power Math random Math round Number number Math sin Number number Math sqrt Number number Math tan Number number Math Prop
82. le amp expression This operator performs a bit wise AND on the value of the expression and the value of the variable and assigns the result to the variable A operator AN variable expression This operator performs a bit wise OR on the value of the expression and the value of the variable and assigns the result to the variable operator variable expression This operator performs a bit wise OR on the value of the expression and the value of the variable and assigns the result to the variable lt lt operator variable lt lt expression This operator performs a bit wise left shift on the variable by an expression number of bits Zeros are shifted in from the right gt gt operator variable gt gt expression This operator performs a bit wise sign preserving right shift on the variable by an expression number of bits gt gt gt operator variable gt gt gt expression This operator performs a bit wise zero padding right shift on the variable by an expression number of bits Lighter Help Online Manual 102 GSVATALOGIC A TAL Se A aon F bl DATALOGIC AUTOMATION 6 6 5 2 Arithmetic Operators These operators are used to perform arithmetic computations on their operands operator fi operator operator operator l operator l operator F operator operator operandl operand2 This operator returns the result of adding the two operand
83. les on the device You can open save or delete projects to and from the device to which you are connected Furthermore you can save a project as the default In order to interact to a device you must be connected with it see Connecting to the device 4 3 1 Opening a project from a device You can open a project that has been previously saved to a device for edit or test operations before sending it to the engraver To open a project from a device 1 From the Project Editor menu bar choose File gt Open project from device 2 In the window Laser device projects list window that is displayed all projects that have been saved to the device are listed Select from the list the project you want to open and click OK 4 3 2 Saving a project as the default project When your project is ready you can save it to the current device as the default This way this project will be automatically executed whenever the Auto Mode default mode is activated that is on any system boot To save a project as the default 1 From the Project Editor menu bar choose File gt Save device default project 2 In the window Laser device projects list window that is displayed all projects that have been saved to the device are listed Select from the list the project you want as the default and click OK 4 3 3 Deleting a project from the device You can delete a project that has been saved to the device To delete a project 1 From the Project Edito
84. me The value is always in the range 0 59 In the example x is 0 because no seconds were specified and the default for unspecified components of the time IS O Var d new Date 1975 12 25 22 30 var x d getSeconds x Date getTime Returns the number of milliseconds since midnight on the 1st January 1970 using local time Var d new Dace 1975 12 255 22 30 33 var x d getTime x 1 91457e 11 Date getTimezoneOffset Returns the time zone offset in minutes for the current locale The time zone offset is the minutes in difference the Greenwich Mean Time GMT is relative to your local time For example if your time zone is GMT 10 600 will be returned Daylight savings time prevents this value from being a constant x new Date currentTimeZoneOffsetInHours x getTimezoneOffset 60 Date setDate Number dayOfTheMonth Sets the day of the month to the specified dayOfTheMonth in local time var d new Date 1975 12 25 22 30 3 d setDate 30 d 1975 12 30T22 30 00 Date setFullYear yearValue monthValue dayValue Sets the full year for a specified date according to local time Parameters yearValue An integer specifying the numeric value of the year for example 1995 73 Lighter Project Editor User s Manual amp VDATALOGIC DATALOGIC AUTOMATION monthValue An integer between 0 and 11 representing the months January through December d
85. mple assigns the four digit value of the current year to the variable yr var today new Date var yr today getFullYear Date getHours Returns the hour using local time The value is always in the range 0 23 var d new Date 1975 12 25 22 l var x d getHours x 22 Lighter Help Online Manual 72 GVATALOGIC DATALOGIC AUTOMATION Date getMilliseconds Returns the milliseconds component of the date using local time The value is always in the range 0 999 In the example x is 0 because no milliseconds were specified and the default for unspecified components of the time is 0 Var d new Date 1975 12 25 22 3 var x d getMilliseconds x Date getMinutes Returns the minutes component of the date using local time The value is always in the range 0 59 Var d new Date 1975 12 25 22 30 var x d getMinutes x 30 Date getMonth Returns the month component of the date using local time The value is always in the range 1 12 Var d new Date 1975 12 2d 22 30 var x d getMonth x 12 The following shows an example var IndexToMonth Jan Feb Mar Apr May Jun W J l j Aug j Sep w F Oct W j Noy Dec var d new Date 1975 12 25 System printin IndexToMonth d getMonth 1 Prints Dec Date getSeconds Returns the seconds component of the date using local ti
86. n integer between 0 and 23 The following example assigns the hours portion of the current time to the variable hrs Lighter Help Online Manual 76 GVATALOGIC DATALOGIC AUTOMATION var hrs Today new Date hrs Today getUTCHours Date getUTCMilliseconds Returns the milliseconds in the specified date according to universal time The value returned by getUTCMilliseconds Is an integer between 0 and 999 The following example assigns the milliseconds portion of the current time to the variable ms var ms Today new Date ms Today getUTCMilliseconds Date getUTCMinutes Returns the minutes in the specified date according to universal time The value returned by getUTCMinutes is an integer between 0 and 59 The following example assigns the minutes portion of the current time to the variable min var min Today new Date min Today getUTCMinutes Date getUTCMonth Returns the month of the specified date according to universal time The value returned by getUTCMonth is an integer between O and 11 corresponding to the month O for January 1 for February 2 for March and so on The following example assigns the month portion of the current date to the variable mon var mon Today new Date mon Today getUTCMonth Date getUTCSeconds Returns the seconds in the specified date according to universal time The value returned by getUTCSeconds is an intege
87. named Untitled which contains a default source file named main qs You can use the default project as the basis for your application 3 If you want rename the project or the file as required Right click the name choose Rename file and then enter the new name Enter the code in the source file as required Add or import any Source or Resource files you need by doing one of the following o Right click the Project folder and choose the option you want o Choose a command from the File menu 6 Save your project as required See Saving a project To install a project deployed from somebody else According to the format the project comes to you flat files or zipped archive do the following steps from point 2 or 1 respectively 1 Unzip the archive in a local directory 2 Follow the steps for opening a project 3 Follow the steps for saving a project to the device Tip c Reference material for developers is provided into the Laser Engine Language Reference section of this Help system Related topics e Adding files to the project e Importing source or resource files into a project 15 Lighter Project Editor User s Manual ee Oo F wered 3 3 Adding files to the project Typically you create or open a Project and then you add the files that are used to run the program In particular e Source files that is the files that contain the code A source file has a qs extens
88. ndows 7 the default folder is Cc Users UserName AppData lt Application Name gt Data Tip To locate the folder where projects are automatically saved in your system do the following Access the system configuration registry Start gt Run and then digit regedit Navigate to HKEY LOCAL MACHINE Software Laservall DataDirectory to see the folder s path 2 To save a copy of an existing project o Choose File gt Save Project as o In the Save project as window that is displayed either go to the desired location or keep the default one o Inthe File name box type a new name for the project and click Save 4 2 2 Saving a project to the device The following procedure allows saving a project to the device to which you are connected The projects are saved into the folder that is shared with the Laser Engine They will be sent to the engraver in an automated way To save the project to a device 1 To save anew unnamed project o From the Project Editor menu bar choose File gt Save project to device The project is saved automatically to the current device 2 To save a copy of an existing project with a specific name o From the Project Editor menu bar choose File gt Save project to device as o In the Project name window that is displayed enter a new name for the project and click OK 25 Lighter Project Editor User s Manual DATALOGIC DATALOGIC AUTOMATION 4 3 Managing fi
89. ne lists all the files that compose the project The pane is displayed by default on the left side of the window Figure Project Files pane i rer Ta Ae ovana TEA W slo Oi 7 a Source Files Function enQueryStartt p startup gs d 2 ai Ppap debug Stat Project fa tor hd i Sytem IsLesertuisy debiol Soole Busy J retuin b h Dommen Fertel E Function enxqueryStapt L E o Stoo Proet 2061 function enLaserStart d bug Start Laser penal 1 function emLaserEnat In particular the Project Files pane allows you to e Right click the Project folder to open a shortcut menu that shows a list of commands for project management such as renaming or adding files B Default xqs 2 aid von ae BERRI Lighter Help Online Manual 14 GVATALOGIC N DATALOGIC AUTOMATION e Right click any document or project file to open a shortcut menu that shows a list of commands relevant to it e Move the pane to another location in the window by clicking the title bar To restore the original position and dock the pane double click the title bar e Hide unhide the pane by right clicking in a blank area next to the toolbar and then deselect select the corresponding item To create a new project 1 Do one of the following PP o Click the New Project button on the toolbar o From the menu bar choose File gt New Project 2 A new default project is created
90. newValue Replaces the first occurrence of pattern in the string with newvalue if the pattern is found in the string A modified copy of string is returned If pattern Is a regular expression with global set all occurrences of pattern in the string will be replaced String search RegExp pattern Executes the search for a match between a regular expression and this String object If successful search returns the index of pattern inside the string The following example prints a message which depends on the success of the test function testinput re str if string search re 1 midstrang contains 3 else midstring does not contain Print Str midotring resource String slice beginslice endSlice Extracts a section of a string and returns a new string Changes to the text in one string do not affect the other string Parameters beginSlice The zero based index at which to begin extraction endSlice The zero based index at which to end extraction If omitted slice extracts to the end of the string 93 Lighter Project Editor User s Manual DATALOGIC DATALOGIC AUTOMATION The following example uses slice to create a new string var strl The morning is upon us Var strz strlslice 3 2 Drine StEeZ This writes morning 1S upon u String split separator limit Splits a String object into an array of strings by separating the stri
91. ng replace RegExp pattern String newValue Number String search RegExp pattern String String slice beginslice endSlice String otring split separator limit String otring substring Number startIndex Number endIndex String String toLowerCase String string toString String String toUpperCase String Properties Number length Detailed description A Stringis a sequence of zero or more Unicode characters Laser Engine s String class uses the QString class s functions and syntax Strings can be created and concatenated as follows var text this is a var another new String text Var concat text anothers oncat this is a text Static String function documentation String fromCharCode Number code1 Number code2 Returns a string made up of the characters with code codel code2 etc according to their Unicode character codes Var S String tromCharCode 65 66 Oly Ob J3 Printcin 6 17 7 7 prints ABCD String functions documentation String charAt Number pos Returns the character in the string at position pos If the position is out of bounds undefined Is returned Parameter Pos An integer between 0 and 1 less than the length of the string 91 Lighter Project Editor User s Manual DATALOGIC DATALOGIC AUTOMATION The following example displays characters at different locations in the string Brave n
92. ng into substrings Parameters separator Specifies the character to use for separating the string The separator is treated as a string or a regular expression see RegExp If separator is omitted the array returned contains one element consisting of the entire string limit Integer specifying a limit on the number of splits to be found The split method returns the new array When found separator Is removed from the string and the substrings are returned in an array If separator is omitted the array contains one element consisting of the entire string lf separatoris a regular expression that contains capturing parentheses then each time separator Is matched the results including any undefined results of the capturing parentheses are spliced into the output array However not all browsers support this capability Note When the string is empty split returns an array containing one empty string rather than an empty array The following example defines a function that splits a string into an array of strings using the specified separator After splitting the string the function displays messages indicating the original string before the split the separator used the number of elements in the array and the individual array elements Function splitstring stringlosplit separator Var arrayOLstrings scringlosplivt splitc separator Pranc The Original String 18 StringTosphit Tjj print The s
93. ng source or resource files into a project e Working with Source files Lighter Help Online Manual 16 GVATALOGIC DATALOGIC AUTOMATION 3 3 1 Creating a new source file To create a new file 1 Create the project See Creating a project and then do one of the following o From the menu bar choose File gt New source file o In the Project Files pane right click the Source Files folder or an existing source file and then choose New source file from the shortcut menu 2 Inthe Input file name window that is displayed enter the name for the source file and click OK Note that the new file is added to the Project Files list Furthermore a new tab is opened in the program editor area allowing you to enter the code Tip Reference material for developers is provided into the Laser Engine Language Reference section of this Help system To print a source file 1 Open the file to be printed If no file is opened the command is disabled 2 From the Project Editor menu bar choose File gt Print source file 3 Choose the printer and click OK 3 3 2 Importing source or resource files into a project You can import both source and resource files The files that you import are added to the corresponding folder into the Project Files pane All the files that compose the project are then synchronized when the project is executed that is they are copied to the device before being executed See also Running
94. ns false p operand lt Returns true if operand1 is less than operand2 otherwise operand2 returns false pa operand 1 lt Returns true if operand1 is less than or equal to operand2 otherwise operand2 returns false 6 6 5 6 Bit wise operators These operators perform their operations on binary representations but they return standard Laser Engine Program numerical values The following table summarizes bit wise operators Operator Syntax err operandl amp Returns result of a bit wise AND on the operands operandz a a operand2 operandl Returns result of a bit wise XOR on the operands operandz operandl pot operand2 operandl Returns result of a bit wise OR on the operands operandz operandl pl operand2 operand Returns the bit wise NOT of the operand Pe operand1 lt lt Returns the result of a bit wise left shift of operandi by the number of bits operand2 specified by operand2 Zeros are shifted in from the right operandl gt gt Returns the result of a _ bit wise sign propagating right shift operandz of operandi by the number of bits specified by operandz2 operandi gt gt gt Returns the result of a bit wise zero filling right shift of operandi by the operand2 number of bits specified by operand2 Zeros are shifted in from the left 105 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION 6 6 5 7 Special Operators The following special operators are av
95. nts Statement that is executed if condition evaluates to false and the else clause ae statement Can be any statement including block statements and further nested if statements Description Multiple if else statements can be nested to create an else if clause il Condit iLoOn statementl else if condition2 statement2 else if condition3 statement3 else statementN To see how this works this is how it would look like if the nesting were properly indented it condition statementl else 1f conditionzZ statement2 else if conditions 45 Lighter Project Editor User s Manual SVDATALOGIC 1 zb A T A m EE Pe a AE r u T E S al Fo DATALOGIC AUTOMATION Do not confuse the primitive boolean values true and false with the true and false values of the Boolean object Any value that is not undefined null 0 NaN or the empty string and any object including a Boolean object whose value is false evaluates to true when passed to a conditional statement For example var b new Boolean false if b 7 this condition evaluates to true Examples Using if else if cipher_char from_char result result to char xr else result result clear_char Assignment within the conditional expression It is advisable to not use simple assignments in a conditional expression because the assignment can be confused with equality when glancing over the c
96. nvention of the operating system where the script is running If the operating system is not year 2000 compliant and does not use the full year for years before 1900 or over 2000 toLocaleString returns a string that is not year 2000 compliant toLocaleString behaves similarly to toString when converting a year that the operating system does not properly format Methods such aSgetHours getMinutes andgetSeconds give more portable results than toLocaleString In the following example today IS a Date object today new Date 95 11 18 17 28 35 months are represented by Jo Li today toLocaleString In this example toLocaleString returns a string value that is similar to the following form The exact format depends on the platform 12 18795 17 20 35 Date toLocaleDateString Converts a date to a string returning the date portion using the operating system s locale s conventions The toLocaleDateString method converts the date to a string using the formatting convention of the operating system where the script is running If the operating system is not year 2000 compliant and does not use the full year for years before 1900 or over 2000 toLocaleDateString returns a string that is not year 2000 compliant toLocaleString behaves similarly to toString when converting a year that the operating system does not properly format Methods such aSgetHours getMinutes andgetSeconds give more portable results than toLocaleDateString today
97. ode For example do not use the following code if Ax y i do the right thing If you need to use an assignment in a conditional expression a common practice is to put additional parentheses around the assignment For example LL Ae y 4 do the right thing Lighter Help Online Manual 46 ainin DATALO GIC AUTO KN Ai ATI ON 6 4 7 Label Summary Provides a statement with an identifier that you can refer to using a break or continue statement For example you can use a label to identify a loop and then use the break or continue statement to indicate whether a program should interrupt the loop or continue its execution Syntax label statement Parameters Parameter Descnpton raaa a Iam label label Any Laser Engine Program identifier that is not a reserved word Laser Engine Program identifier that is not a reserved word Statements break can be used with any labeled statement and continue can be statement used with looping labeled statements Examples For an example of a label statement using break see break For an example of a label statement using continue see continue 6 4 8 Return Summary Specifies the value to be returned by a function Syntax return expression Parameters Parameter Description lexpression The expression to return If omitted undefined is returned instead Examples The following function returns the square of its argument x whe
98. on Syntax throw expression Parameters Parameter Description expression The expression to throw Description Use the throw statement to throw an exception When you throw an exception expression specifies the value of the exception Each of the following throws an exception throw Error2 generates an exception with a string value throw 42 generates an exception with the value 42 throw true generates an exception with the value true Examples Throw an object You can specify an object when you throw an exception You can then reference the object s properties in the catch block The following example creates an objectmyUserException of type UserException and uses It in a throw statement function UserException message this message message this name UserException function getMonthName mo mo mo 1l Adjust month number for array index 1l Jan 12 Dec var months new Array Jan Feb Mar Apr May Jun Tam Aug Sep MOCE 4 Nov Dec i if months mo null return months mo else myUserException new UserException InvalidMonthNo throw myUserException try statements te try monthName getMonthName myMonth catch e monthName unknown logMyErrors e message e name pass exception object to err handler Lighter Help Online Manual 50 GVATALOGIC on oo ee ee oe nF ee l F
99. on testinput re str if re test str Midst ring contains T else midstring does not contain print Str midstring re s urce j RegExp toString Returns a string representing the specified object The following example displays the string value of a RegExp object myExp new RegExp atb c alert myExp toString displays atbtc RegExp valueOf Returns a string representing the source code of the function RegExp properties documentation Note that several of the RegExp properties have both long and short Perl like names Both names always refer to the same value Perl is the programming language from which Laser Engine Program modeled its regular expressions constructor Specifies the function that creates an object s prototype Returns a reference to the RegExp function that created the instance s prototype Note that the value of this property is a reference to the function itself not a string containing the function s name global Whether to test the regular expression against all possible matches in a string or only against the first global is a property of an individual regular expression object The value of global is true if the g flag was used otherwise false The g flag indicates that the regular expression should be tested against all possible matches in a string You cannot change this property directly ignoreCase Whether to ignore case while attemp
100. oop the regular expression won t be recompiled on each iteration Lighter Help Online Manual 86 GVATALOGIC oe N DATALOGIC AUTOMATION The constructor of the ET expression object for example new RegExp ab c provides runtime compilation of the regular expression Use the constructor function when you know the regular expression pattern will be changing or you don t know the pattern and are getting it from another source such as user input RegExp functions documentation RegExp exec String str Executes a search for a match in a specified string Returns a result array or nu11 Parameter str The string against which to match the regular expression As shown in the syntax description a regular expression s exec method can be called either directly with regexp exec str or indirectly with regexp str If you are executing a match simply to find true or false use the test method or the String search method If the match succeeds the exec method returns an array and updates properties of the regular expression object If the match fails the exec method returns null Consider the following example Match one d followed by one or more b s followed by one d Remember matched b s and the following d Ignore case var myRe d bt d ig var myArray myRe exec cdbBdbsbz The following table shows the results for this script Object Property Index Description Example dbBd
101. r between 0 and 59 The following example assigns the seconds portion of the current time to the variable sec var sec Today new Date sec Today getUTCSeconds Date setUTCDate dayvalue Sets the day of the month for a specified date according to universal time Parameter dayvalue An integer from 1 to 31 representing the day of the month lf a parameter you specify is outside of the expected range setUTCDate attempts to update the date information in the Date object accordingly For example if you use 40 for dayValue and the month stored in the Date object is June the day will be changed to 10 and the month will be incremented to July theBigDay new Date theBigDay setUTCDate 20 77 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION Date setUTCFullYear yearValue monthValue day Value Sets the full year for a specified date according to universal time Parameters yearValue An integer specifying the numeric value of the year for example 1995 monthValue An integer between 0 and 11 representing the months January through December dayValue An integer from 1 to 31 representing the day of the month If you specify the dayValue parameter you must also specify the monthValue If you do not specify the monthValue and dayValue parameters the values returned from the getMonth and getDate methods are used If a parameter you specify is outside of the expe
102. r menu bar choose File gt Delete project in device 2 In the window Laser device projects list window that is displayed all projects that have been saved to the device are listed Select from the list the project you want to delete and click OK Lighter Help Online Manual 26 SVATALOGIC 5 SENDING PROJECTS TO MARKING This chapter is organized into the following sections e Connecting to the device e Running a project e Testing a project 2 7 Lighter Project Editor User s Manual SVDATALOGIC nE Te oe E Pe a Baik es ah io a 7 DATALOGIC AUTOMATION 5 1 Connecting to the device The laser device that you will use for marking your layouts can be either local in the case of a stand alone marking solution or remote in the case of a Supervisor unattended marking solution typically on a production line In both cases you can use the File menu to connect to the device To connect to the device 1 From Project Editor menu bar choose File gt Connect to device 2 In the Connect to device device window that is displayed choose the device you want to connect to Note 7 If you have a Supervision installation of Laser Editor all available devices are listed both local and remote if enabled while if you have a Stand alone installation only local devices are listed In the case of a remote device the IP Address is also displayed 3 Click OK Related topics e Running a project e Te
103. re x is a number function square x Tocun a s Ay 47 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION 6 4 9 Switch Summary Evaluates an expression matching the expression s value to a case label and executes statements associated with that case Syntax Switch expression case labell statementsl break case label2 statements2 break case labelN statementsN break default statements_def break Parameters Parameter Description llabe1N Identifier used to match against expression IstatementsN Statements that are executed if expression matches the associated label Istatements_def Statements that are executed if expression does not match any label Description If a match is found the program executes the associated statements If multiple cases match the provided value the first case that matches is selected even if the cases are not equal to each other The program first looks for a case clause with a label matching the value of expression and then transfers control to that clause executing the associated statements If no matching label is found the program looks for the optional default clause and if found transfers control to that clause executing the associated statements If no default clause is found the program continues execution at the statement following the end of switch By convention the default clause is the last claus
104. ression to be evaluated before each loop iteration If this expression evaluates to true statement is executed This conditional test is optional If omitted the condition always evaluates to true If the expression evaluates to false execution skips to the first expression following the for construct An expression to be evaluated at the end of each loop iteration This occurs before the condition final i Soe on next evaluation of condition Generally used to update or increment the counter variable statement A statement that is executed as long as the condition evaluates to true Examples The following for statement starts by declaring the variable i and initializing it to 0 It checks that i is less than nine performs the two succeeding statements and increments i by 1 after each pass through the loop for var i 0 i lt 9 i n 1 myiune n 43 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION 6 4 5 Function Summary Declares a function with the specified parameters Syntax function name param param param statements Parameters Parameter eee sss aaa Iname The function name function name E The name of an argument to be passed to the function A function can have up to 255 a eee statements The statements which comprise the The statements which comprise the body of the function of the function Description To
105. return a value the function must have a return statement that specifies the value to return A function created with the function statement is aFunction object and has all the properties methods and behavior of Function objects A function can also be declared inside an expression In this case the function is usually anonymous See function operator for more information about the function function expression Functions can be conditionally declared That is a function definition can be nested within an if statement Technically such declarations are not actually function declarations they are function expressions Examples The following code declares a function that returns the total dollar amount of sales when given the number of units sold of products a b andc LUNCtCiON Calc sales Units oe Units o units cj ret rn units 2 79 units b 129 units c 0699 Related topics e Built in Functions Lighter Help Online Manual 44 aahon DATALOGIC AUTOMATION 6 4 6 If else Summary Executes a statement if a specified condition is true If the condition is false another statement can be executed Syntax it condition statementil else statement2 Parameters Parameter Description condition An expression that evaluates to true or false Statement that is executed if condition evaluates to true Can be any statement statementl jincluding further nested if stateme
106. s Cie SVDATALOGIC DATALOGIC AUTOMATION Lighte PROJECT EDITOR USER S MANUAL RELEASE 6 0 0 S amp S DATALOGIC DATALOGIC AUTOMATION 2010 2012 Datalogic Automation S r l ALL RIGHTS RESERVED Protected to the fullest extent under U S and international laws Copying or altering of this document is prohibited without express written consent from Datalogic Automation S r l Datalogic and the Datalogic logo are registered trademarks of Datalogic S p A in many countries including the U S A and the E U All other brand and product names mentioned herein are for identification purposes only and may be trademarks or registered trademarks of their respective owners Published 31 October 2012 Printed in Donnas AO Italy Lighter Project Editor User s Manual 2 GVATALOGIC nW Ta 1 IF JE 1 L q ee bm F F ee E h FEFA i T ma REVISION INDEX Revision Date edited pages 31 10 2012 Release Lighter Project Editor User s Manual asiainnlanminion MATALOGIC AUTOMATION SUMMARY REV B gt core enter a mane terete onan eee er eee ee E en he ree ee ee eee ee ee ee iii SONMMAR Y aeea a ede ease a sctaatd eam aencedee ease ea beseastoaeetemeaaceeae hoe 4 1 WELCOME eee cee eee eee ene E een cee eee eee ee 6 1 1 PASO UIT TANS Wey SL a E E O E E O 6 1 1 1 Ucina me HeD SUS IN aier E E 6 1 1 2 Conen Ore Fop an E S 6 2 QGETMINGSIARTED WITH PROJECT EDITO
107. s operandi and operandz2 See also String Operators string operator operand pre increment operand post increment The pre increment version of this operator increments the operand and returns the value of the now incremented operand The post incremented version of this operator returns the value of the operand and then increments the operand z operator var result operandi operand2 subtraction operand operand unary negation The subtraction version of this operator returns the result of subtracting its second operand operand2 from its first operand operandl The unary negation version of this operator returns the result of negating changing the sign of ItS operand operator operand pre decrement operand post decrement The pre decrement version of this operator decrements the operand and returns the value of the now decremented operand The post decremented version of this operator returns the value of the operand and then decrements the operand operator operandl operand2 This operator returns the result of multiplying the two operands operandi and operandz2 103 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION operator operandl operand2 This operator returns the result of dividing the first operand operand1 by the second operand operandz2 Note that division by zero is not an error The
108. s Value Sets the milliseconds for a specified date according to universal time Parameter millisecondsValue A number between 0 and 999 representing the milliseconds lf a parameter you specify is outside of the expected range set UTCMilliseconds attempts to update the other parameters and the date information in the Date object accordingly For example if you use 1100 for millisecondsValue the seconds stored in the Date object will be incremented by 1 and 100 will be used for milliseconds theBigDay new Date thepigbay servuilcCMiliaseconds 500 Lighter Help Online Manual 78 GVATALOGIC DATALOGIC AUTOMATION CHAPTER 6 Date setUTCMinutes minutes Value seconds Value ms Value Sets the minutes for a specified date according to universal time Parameters minutes Value An integer between 0 and 59 representing the minutes secondsValue An integer between O and 59 representing the seconds If you specify the secondsValue parameter you must also specify the minutesValue msValue A number between 0O and 999 representing the milliseconds If you specify the msValue parameter you must also specify the minutesValue and secondsValue lf you do not specify the secondsValue and msValue parameters the values returned from the getSeconds and getMilliseconds methods are used If a parameter you specify is outside of the expected range setUTCMinutes attempts to update the other parameters and the d
109. sed in the brackets You can specify a range of characters by using a hyphen For example abc is the same as a c They initially match r in brisket and h in 85 Lighter Project Editor User s Manual S amp S VDATALOGIC DATALOGIC AUTOMATION chop b Matches a backspace Not to be confused with b Matches a word boundary such as a space Not to be confused with b b For example bn w matches the no in noonday wy b matches the ly in possibly yesterday Matches a non word boundary B For example w Bn matches on in noonday and y B w matches ye in possibly yesterday ex Where x is a letter from A Z Matches a control character in a string For example cM matches control M in a string Matches a digit character in the basic Latin alohabet Equivalent to 0 9 For example d or 0 9 matches 2 in B2 is the suite number d D Matches any non digit character in the basic Latin alphabet Equivalent to 0 9 For example D or 0 9 matches B in B2 is the suite number DT Matches a form feed n Matches a linefeed r Matches a Carriage return ws Matches a single white space character including space tab form feed line feed and s other unicode spaces 1 For example s w matches bar in foo bar Matches a single character other than white space For example S w matches foo in foo bar YE
110. sting a project Lighter Help Online Manual 28 GVATALOGIC DATALOGIC AUTOMATION 5 2 Running a project a Gy gt ial When you are ready with your project see Creating a project you can run the program in two ways es e In Manual Mode By pressing F5 or clicking S Run Project e In Auto Mode By saving the project to the device and executing it at the device level by activating the Auto Mode See Saving a project 5 2 1 Manual Mode vs Auto Mode In Auto Mode programs are executed by the Laser Engine this means that the currently selected default project is executed In order to test your projects you must switch to the Manual Mode This way the Laser Engine waits for commands rather than executing programs automatically To switch to the Manual Mode 1 From the Project Editor menu bar choose File gt Switch to Manual Mode 2 Select either the device or the simulator and then run the project 5 2 2 Executing the marking operation Attention When you execute a project that is when you press Run Project all the source and resource files that compose it are copied to the device before being executed Note that any file with the same name will be overwritten To send the project to the engraver 1 Be sure that you are in Manual Mode 2 Doone of the following o Press F5 or click on S Run Project on the toolbar o Choose Project gt Run project from the menu b
111. ter Help Online Manual 6 GVATALOGIC 7 Lighter Project Editor User s Manual SVDATALOGIC 2 GETTING STARTED WITH PROJECT EDITOR This chapter is organized into the following sections Topic What you will learn About Project Editor Scope and overview of Project Editor Work environment overview Overview on how the work environment is organized Lighter Help Online Manual 8 GVATALOGIC AT AL SP A ITE PET DATALOGIC AUTOMATION 2 1 About Project Editor Project Editor is a programs editor integrated into Laser Editor It has a friendly user interface advanced debugging functions and is provided with samples programs and reference material Developers can use this tool to write and manage programs so as to interact with the laser system Such programs are then interpreted and executed via the Laser Engine The programming language is an implementation of a subset of ECMAScript 4 0 ECMAScript which is also called JavaScript or JScript by some vendors By creating your own programs with Project Editor you can e control the marking process e fully customize your layout e interact with users and with other programs or devices e automate procedures and update the layout s contents at runtime Project Editor is launched by choosing File gt Project Editor from the Laser Editor s menu bar Tip Reference material on the programming language is provide
112. the variable in these cases will very likely lead to unexpected results Examples The following example declares two variables num_hits and cust_no and initializes both to the value 0 var num_hits 0 cust_no QO 55 Lighter Project Editor User s Manual amp VDATALOGIC Fh i a P a on ee Boe eee Oe Ce Ps s ra A TAIL a fim A J Fehi H A T l Pa F GA A L OGIC AUTOMATION 6 4 13 While Summary Creates a loop that executes a specified statement as long as the test condition evaluates to true The condition is evaluated before executing the statement Syntax while condition statement Parameters Parameter Description An expression evaluated before each pass through the loop If this condition evaluates condition to true statement is executed When condition evaluates to false execution continues with the statement after the while loop statement A statement that is executed as long as the condition evaluates to true Examples The following while loop iterates as long as n is less than three n 0 x 0 while n lt 3 n x n Each iteration the loop increments n and adds it to x Therefore x and n take on the following values e After the first pass n 1 and x 1 e After the second pass n 2 and x 3 e After the third pass n 3 and x 6 After completing the third pass the condition n lt 3 is no longer true so the loop terminates Lighter
113. ting a match in a string ignoreCase Is a property of an individual regular expression object The value of ignoreCase is true if the i flag was used otherwise false The i flag indicates that case should be ignored while attempting a match in a string You cannot change this property directly lastindex A read write integer property that specifies the index at which to start the next match lastIndex Isa property of an individual regular expression object This property is set only if the regular expression used the g flag to indicate a global search 89 Lighter Project Editor User s Manual SVDATALOGIC DATALOGIC AUTOMATION The following rules apply e If lastIndex is greater than the length of the string regexp test and regexp exec fail and last Index Is Set to 0 e If lastIndex is equal to the length of the string and if the regular expression matches the empty string then the regular expression matches input starting at Last Index e If last Index is equal to the length of the string and if the regular expression does not match the empty string then the regular expression mismatches input and last Index Is reset to 0 e Otherwise lastIndex is set to the next position following the most recent match For example consider the following sequence of statements re hi g Matches the empty string re hi Returns hi hi with lastIndex equal to 2 re hi Returns an empty array
114. to the particular instance object of the class s type See also Declaring Functions and Declaring Classes To illustrate the concept of binding refer to the following example Example EUNCCLOM Car brand this brand brand Car prototype getBrand function return this brand var foo new Car toyota Print foo getBrand 4 As expected this outputs toyota typeof operator typeof item This operator returns a type of the object as a string Example var f new Function arguments 0 2 object var str text 7 string var pi Math PI number Functions and built in objects have a typeof of function 107 Lighter Project Editor User s Manual DATALOGIC som ws E a f E pI a d gt gt wJATALOGIC DATALOGIC AUTOMATION Headquarters Via Lavino 265 40050 Monte San Pietro Bologna Italy Tel 39 051 6765611 Fax 39 051 6759324 Purchasing Dept Fax 39 051 6765499 info automation it datalogic com Laser Marking operation officies Donnas Reg Gurey via Le Gorrey 10 11020 Donnas AO ITALY Tel 39 0125 8128201 Fax 39 0125 8128401 Sesto Calende Via dell Industria 20 21018 Sesto Calende VA ITALY Tel 39 0331 9180601 Fax 39 0331 9180801
115. tor returns operandias its result If operandlistrue the operator returns operand2 operandl amp amp operand2 This operator returns an object whose value is true if either of its operands are t rue otherwise it returns an object whose value is false Specifically if the value ofoperandlistrue the operator returns operandi as its result If operandlis false the operator returns operand2 If the operand s value is true this operator returns false otherwise it operand returns true operandi operand2 Lighter Help Online Manual 104 GVATALOGIC DATALOGIC AUTOMATION 6 6 5 5 Comparison Operators Comparison operators are used to compare objects and their values The following table summarizes comparison operators Operator Syntax Description operandl Returns true if the operands are equal otherwise returns false operand2 operandl j Returns true if the operands are not equal otherwise returns false operand2 oL operandl Returns true if the operands are equal and of the same type operand2 otherwise returns false N operandl Returns true if the operands are not equal or if the operands are of l operand2 different types otherwise returns false n operandl gt Returns true if operandi is greater than operand2 otherwise operand2 returns false Se operand gt Returns true if operand is greater than or equal to operand2 operand2 otherwise retur
116. ual SVDATALOGIC nE Te oe E Pe a Baik es ah io a 7 DATALOGIC AUTOMATION 3 5 About Formatters Formatters are source files that are supplied with Project Editor These files can be used as functions libraries Their purpose is to make it easier for developers to create custom applications For example as an integrator you might need specific functions that these libraries provide Formatters have a qs extension and are stored in the folder Data Formatters To prepare formatters 1 From the Project Editor s menu bar choose File gt Formatters 2 In the Project Files section double click the formatter source file in order to access its code Alternatively right click Source Files and then click New Source File for creating a new one To use formatters 1 Inthe layout select one or more textual objects 2 Inthe property section set its Custom Formatters property to True 3 Open the combo box named Script just below the preceeding property and set it with the file name of the desired property Lighter Help Online Manual 22 SVATALOGIC 4 OPENING SAVING AND DELETING PROJECTS This chapter is organized into the following sections e Opening a project e Saving a project e Managing files on the device 23 Lighter Project Editor User s Manual _ ov TALOGIC a ry E i DATALOGIC AUTOMATION DATALOGIC AUTOMATION 4 1 Opening a project You can open projects that you ha
117. um representable values in which case the value of the expression will be Infinity and isFinite will return false 83 Lighter Project Editor User s Manual DATALOGIC DATALOGIC AUTOMATION 6 6 1 6 RegExp Creates a regular expression object for matching text according to a pattern More RegExp Functions The global RegExp object has no methods of its own however it does inherit some methods through the prototype chain Array RegExp exec String str Boolean RegExp test String str String RegExp toString String RegExp valueOf RegExp Properties ptFunction constructor Boolean global Boolean ignoreCase Number lastIndex Boolean multiline String source Detailed description Creates a regular expression object for matching text according to a pattern var regex new RegExp pattern flags var literal pattern flags When using the constructor function the normal string escape rules preceding special characters with when included in a string are necessary For example the following are equivalent var re new RegExp wt var re wt Notice that the parameters to the literal format do not use quotation marks to indicate strings while the parameters to the constructor function do use quotation marks So the following expressions create the same regular expression abt c i new Reghxp abte TI Special characters in regular expressions Character Meanin
118. ve previously saved for further editing or for sending them to the engraver You can open a project that was saved locally or a project that was saved to a device See Opening a project from a device To open a project 1 Do one of the following o From the Project Editor menu bar choose File gt Open project o From the Project Editor standard toolbar click the ee Open project bution 2 In the Choose a project to open window that is displayed browse to locate the xqs project you want to open 3 Click on Open The selected project and the related files are listed in the Project Files pane and the current source file appears in the programs editor area Lighter Help Online Manual 24 GVATALOGIC DATALOGIC AUTOMATION Xx 4 2 Saving a project You can save a project either locally or to a device so that it is then sent to the engraver through an automated procedure Furthermore you can save a project to a device as the default project see Saving a project as the default project 4 2 1 Saving a project locally The following procedure allows saving a project with a xqs extension Laser Project file on your disk for later use or editing To save the project 1 To save anew unnamed project o Choose File gt Save Project or click the ud button on the toolbar The project is automatically saved into the default folder which depends on your operating system For example if you are using Wi
Download Pdf Manuals
Related Search
Related Contents
42XV560A 46XV560A 52XV560A - Blake Television & Video Rentals StarTech.com InfoSafe 3.5" 4 Drive eSATA Multi RAID Mode d`emploi Pince ampèremétrique AC/DC 1500 A à valeur はじめに Fujitsu P3PC-1562-01ENZ0 Photo Scanner User Manual Anleitung PD - END Armaturen Lite Version 1.0 User Manual Copyright © All rights reserved.
Failed to retrieve file