Ellié Computing Home Page
My Shopping Cart

Your shopping cart is empty

Display Cart

Call us at +1 586 62 ELLIE / +1 586 62 35543 Office Closed
sales@elliecomputing.com - Contact us


Machine object

 

 

Machine global object

Syntax

 A Machine global object is created for you and is only this object can exist in the application. It is named Machine and is globally accessible.

Parameters

none.

Property Of

global name space

Implemented In

ECMerge 2.1

Description

The Machine global object gives a few information about the computer on which the script is executed.

Properties

Property Description
system_name String. Read-Only. Name of the system on which the script is executed.
system_major_version Integer. Read-Only. Major version of the system.
system_minor_version Integer. Read-Only. Minor version of the system.

 

Methods

escape_for_command_line
which

Examples

Example 1.

Logs the version information for the current machine:
log (Machine.system_name + ' ' + Machine.system_major_version + ' ' + Machine.system_minor_version);

See Also 

 none.

 

Method escape_for_command_line

Syntax

function Machine.escape_for_command_line (argument)
returns String

Parameters

argument. String. A text expected to be passed as argument to the command line of a program

Method Of

Machine object.

Implemented In

ECMerge 2.1

Description

This method escapes appropriately the text of argument so that you can concatenate it to a command line string.

Examples

Example 1.

This sample creates a converter which needs redirected I/O and sets the arguments of the built-in 'stdioconv' converter using escape_for_command_line:
converter = new UserProcessFilter;
converter.application_path = ec_get_stdio_converter();
converter.arguments = Machine.escape_for_command_line(path) + " no \"\" yes $(output) " + arguments

See Also 

  UserProcessFilter object

Method which

Syntax

function which (filename)
returns String or undefined

Parameters

 filename. String. Name of file to be searched

Method Of

Machine object.

Implemented In

ECMerge 2.1

Description

This function searches a file which given filename in the directories given by the PATH variable, as would do the "which" command of Unix. The operating system does a similar operation when you enter a program filename to execute on the command line.

Examples

Example 1.

The following example searches the path for the GUI version of merge:
var path=Machine.which("ecmerge" + ec_get_default_app_extension())

See Also 

 none.