Class Example

Description

A PhpMyCellScript addon example.

Instruction methods start with "cmd_".

Located in /PhpMyCellScript/Addons/Example.php (line 37)


	
			
Class Constant Summary
Variable Summary
Method Summary
static array compileLLGrammar (array $ll_grammar)
static array compileRegexGrammar (array $regex_grammar)
static SimpleXMLIterator convertValueToXmlObject (string $value, [string $encoding = null])
static void createXmlNodesFromCellArrayData (array $cell_array, SimpleXMLElement/DOMNode &$root_node)
static boolean isXmlNameValid (string $name, [string $encoding = null])
static SimpleXMLIterator parseAgainstLLGrammar (array $compiled_grammar, string $input_string, [string $start_symbol = null], [int $max_depth = null])
static SimpleXMLIterator parseAgainstRegexGrammar (array $compiled_grammar, string $input_string, [string $start_symbol = null], [string $encoding = null])
static string runAutoItScript (string $script)
Example __construct ()
void cmd_ARRAY_MERGE ( $variable,  $keep_empty_row,  $interpreter)
void cmd_ARRAY_MERGE_STRING ( $variable,  $keep_empty_row,  $interpreter,  $expanded_strings)
void cmd_ARRAY_MERGE_VALUE ( $variable,  $keep_empty_row,  $interpreter,  $expressions)
void cmd_ASSERT ( $assertion,  $interpreter,  $code_to_eval)
void cmd_ASSIGN ( $variable,  $string)
void cmd_ASSIGN_TEXT ( $variable,  $text)
void cmd_ASSIGN_VALUE ( $variable,  $value)
void cmd_AUTOIT ( $script,  $output_variable)
void cmd_CLIP_GET ( $output_variable)
void cmd_CLIP_PUT ( $string)
void cmd_CONCAT ( $variable,  $string)
void cmd_DIFF ( $left,  $right,  $result_variable,  $align_result)
void cmd_DIR_COPY ( $source,  $dest,  $preserve_timestamp,  $interpreter)
void cmd_DIR_NEW_ITERATOR ( $iterator_variable,  $path,  $mode,  $regex,  $interpreter)
void cmd_DIR_TEMP ( $dir_name_variable,  $prefix,  $suffix)
void cmd_DOM_LOAD ( $xml_string,  $xml_variable,  $is_html,  $interpreter)
void cmd_ECHO ( $output_string)
void cmd_ECHO_CELL ( $string)
void cmd_ECHO_ROW ( $strings,  $expanded_strings)
void cmd_ECHO_SHEET ( $array)
void cmd_ELSEIF_E ( $string1,  $string2,  $interpreter)
void cmd_ELSEIF_M ( $pattern,  $source_string,  $match_result_variable,  $interpreter)
void cmd_ESCAPE_STRING ( $output_variable,  $string,  $use_full_version)
void cmd_EVAL_CELL_ARRAY ( $cell_array,  $row_separator,  $interpreter,  $code_to_eval)
void cmd_FILE_COPY ( $source,  $dest,  $preserve_timestamp,  $interpreter)
void cmd_FILE_DELETE ( $filename,  $interpreter)
void cmd_FILE_LOAD ( $file_name,  $result_variable,  $interpreter)
void cmd_FILE_MOVE ( $oldpath,  $newpath,  $interpreter)
void cmd_FILE_SAVE ( $file_name,  $file_content)
void cmd_FILE_TEMP ( $file_name_variable,  $prefix,  $suffix)
void cmd_FILE_TOUCH ( $target,  $source)
void cmd_FIND ( $pattern,  $source_string_variable,  $match_result_variable,  $selection_start_variable,  $selection_length_variable,  $interpreter)
void cmd_GRAMMAR_COMPILE ( $grammar,  $compiled_grammar_variable)
void cmd_GRAMMAR_LL_COMPILE ( $grammar,  $compiled_grammar_variable)
void cmd_GRAMMAR_LL_PARSE ( $compiled_grammar,  $input_string,  $parse_tree_variable,  $start_symbol,  $max_depth,  $interpreter)
void cmd_GRAMMAR_PARSE ( $compiled_grammar,  $input_string,  $parse_tree_variable,  $start_symbol,  $encoding,  $interpreter)
void cmd_HTML_LOAD ( $html_string,  $xml_variable,  $interpreter)
void cmd_HTML_TO_STRING ( $result_variable,  $xml_node,  $format_output_flag)
void cmd_ICONV ( $in_charset,  $out_charset,  $input_string,  $output_variable)
void cmd_IF_E ( $string1,  $string2,  $interpreter)
void cmd_IF_M ( $pattern,  $source_string,  $match_result_variable,  $interpreter)
void cmd_INCLUDE_PHP ( $path,  $output_variable,  $interpreter)
void cmd_IS_CLI ( $interpreter)
void cmd_IS_ON_WINDOWS ( $interpreter)
void cmd_IS_WEB ( $interpreter)
void cmd_JSON_LOAD ( $json_string,  $result_variable)
void cmd_JSON_TO_STRING ( $result_variable,  $value)
void cmd_LIST ( $variables,  $code_to_eval)
void cmd_MERGE ( $file_name,  $output_string)
void cmd_MKDIR ( $path_name)
void cmd_MSWORD_FIND ( $range_object,  $search_text,  $result_variable,  $max_num_of_results,  $interpreter)
void cmd_MSWORD_NEW ( $document_variable)
void cmd_MSWORD_OPEN ( $file_name,  $document_variable,  $interpreter)
void cmd_MSWORD_TO_ARRAY ( $collection_object,  $array_variable)
void cmd_ODBC_COLUMNS ( $qualifier,  $schema,  $table_name,  $column_name,  $result_variable,  $interpreter,  $connection_id_variable)
void cmd_ODBC_CONNECT ( $dsn,  $user,  $password,  $connection_id_variable,  $interpreter)
void cmd_ODBC_EXEC ( $query_string,  $result_variable,  $result_type,  $interpreter,  $connection_id_variable)
void cmd_ODBC_PROCEDURES ( $qualifier,  $owner,  $name,  $result_variable,  $interpreter,  $connection_id_variable)
void cmd_ODBC_TABLES ( $qualifier,  $owner,  $name,  $result_variable,  $interpreter,  $connection_id_variable)
void cmd_PASSTHRU ( $command,  $arguments,  $return_status_variable,  $expanded_strings)
void cmd_PHP ( $php_template,  $output_variable)
void cmd_PROC_CLOSE ( $exit_code_variable,  $interpreter)
void cmd_PROC_OPEN ( $command,  $cwd,  $process_variable,  $interpreter)
void cmd_PROC_STDERR ( $output_variable,  $is_read_line,  $length,  $echo_flag,  $interpreter)
void cmd_PROC_STDIN ( $input_string,  $result_variable,  $echo_flag,  $interpreter)
void cmd_PROC_STDOUT ( $output_variable,  $is_read_line,  $length,  $echo_flag,  $interpreter)
void cmd_PROMPT ( $prompt_string,  $output_variable)
void cmd_PROMPT_PWD ( $prompt_string,  $output_variable)
void cmd_REPLACE ( $replacement_string,  $interpreter,  $source_string_variable,  $selection_start_variable,  $selection_length_variable)
void cmd_RMDIR ( $dirname,  $recursive,  $interpreter)
void cmd_RUN_ASYNC ( $command,  $window_style)
void cmd_SELECT_DIR ( $directory_path_variable,  $prompt_string,  $root_folder,  $interpreter)
void cmd_SELECT_OPTION ( $prompt_string,  $options,  $output_variable)
void cmd_SELENIUM_DO ( $command,  $target,  $value,  $result_variable,  $encoding,  $interpreter,  $selenium_variable)
void cmd_SELENIUM_START ( $browser,  $browser_url,  $selenium_variable,  $host,  $port,  $interpreter)
void cmd_SELENIUM_STOP ( $interpreter,  $selenium_variable)
void cmd_SHELL_EXEC ( $command,  $arguments,  $output_variable,  $expanded_strings)
void cmd_STRING ( $string,  $output_variable)
void cmd_STRING_ARRAY ( $strings,  $array_variable,  $expanded_strings)
void cmd_STRING_FROM_CELL_ARRAY ( $string_variable,  $cell_array,  $row_separator,  $cell_separator,  $prefix,  $suffix,  $interpreter)
void cmd_SYSTEM ( $command,  $arguments,  $return_status_variable,  $expanded_strings)
void cmd_UNSET ( $variables,  $code_to_eval)
void cmd_VALUE_ARRAY ( $expressions,  $array_variable,  $values)
void cmd_XML_FROM_CELL_ARRAY ( $xml_variable,  $cell_array,  $interpreter)
void cmd_XML_FROM_VALUE ( $value,  $xml_variable,  $encoding)
void cmd_XML_LOAD ( $xml_string,  $xml_variable,  $interpreter)
void cmd_XML_TO_STRING ( $result_variable,  $xml_node,  $format_output_flag,  $remove_xml_declaration_flag)
void cmd_XML_XPATH ( $xml_node,  $xpath_expression,  $result_variable,  $prefix_and_ns_pairs,  $interpreter,  $expanded_strings)
void cmd_XSLT_NEW ( $stylesheet,  $xslt_variable,  $interpreter)
void cmd_XSLT_TRANSFORM ( $doc,  $result_variable,  $interpreter)
void escapeCellHeredocString (string $s, [boolean $use_full_version = false])
void saveOrMergeOutputToFile (string $output_file_name, string $output)
Variables
array $if_like_instructions = array('INCLUDE_PHP', 'IF_M', 'ELSEIF_M', 'IF_E', 'ELSEIF_E', 'ODBC_CONNECT', 'ODBC_TABLES', 'ODBC_COLUMNS', 'ODBC_PROCEDURES', 'ODBC_EXEC', 'FILE_LOAD', 'FILE_COPY', 'FILE_MOVE', 'FILE_DELETE', 'RMDIR', 'DIR_NEW_ITERATOR', 'DIR_COPY', 'SELECT_DIR', 'MSWORD_OPEN', 'MSWORD_FIND', 'XML_LOAD', 'XML_XPATH', 'HTML_LOAD', 'DOM_LOAD', 'GRAMMAR_PARSE', 'GRAMMAR_LL_PARSE', 'SELENIUM_START', 'SELENIUM_DO', 'PROC_OPEN', 'IS_ON_WINDOWS', 'IS_CLI', 'IS_WEB', 'FIND', 'XSLT_NEW', 'XSLT_TRANSFORM') (line 46)

The IF-like instructions which support the ELSE instruction.

To be read by the PhpMyCellScript interpreter.

  • access: public
array $while_like_instructions = array('FIND') (line 53)

The WHILE-like instructions.

To be read by the PhpMyCellScript interpreter.

  • access: public
Methods
static method compileLLGrammar (line 2212)

Compile a LL grammar for parseAgainstLLGrammar().

  • return: The compiled grammar.
  • access: public
static array compileLLGrammar (array $ll_grammar)
  • array $ll_grammar: The grammar to compile.
static method compileRegexGrammar (line 2001)

Compile a regular-expression-based grammar.

  • return: The compiled grammar. Sample result:
             array(
                 'SIMPLE_SENTENCE' => array(
                     'is_terminal' => false,
                     'regex' => '(((\\w+)(\\s*))+)(\\.)',
                     'is_generating_regex' => false,
                     'quantifier' => '',
                     'is_alternation' => false,
                     'sub_symbols' => array('WORDS', ''),
                     'sub_regexes' => array('((\\w+)(\\s*))+', '\\.')
                 ),
                 'WORDS' => array(
                     'is_terminal' => false,
                     'regex' => '((\\w+)(\\s*))+',
                     'is_generating_regex' => false,
                     'quantifier' => '+',
                     'is_alternation' => false,
                     'sub_symbols' => array('WORD', ''),
                     'sub_regexes' => array('\\w+', '\\s*')
                 ),
                 'WORD' => array(
                     'is_terminal' => true,
                     'regex' => '\\w+'
                 )
             )
  • access: public
static array compileRegexGrammar (array $regex_grammar)
  • array $regex_grammar: The grammar to compile. Sample value:
             array(
                 array(
                     // For a non-terminal symbol.
                     'SIMPLE_SENTENCE', // The first element is the name of the symbol.
                     '', // The second element specifies a quantifier (?, *, +, ...) or an alternation operator (|), if needed.
                     'WORDS', // The remaining elements can refer to another symbol,
                     '\\.' // or specify a regular expression directly.
                 ),
                 array(
                     'WORDS',
                     '+',
                     'WORD',
                     '\\s*'
                 ),
                 array(
                     // For a terminal symbol.
                     'WORD', // The first element is the name of the symbol.
                     '\\w+' // The second element is the regular expression for the symbol.
                 )
             )
static method convertValueToXmlObject (line 1538)

Utility: Convert a value to a SimpleXML object.

  • return: the SimpleXML object. Sample result:
             <list>
                 <list>
                     <list/>
                     <key1/>
                     <item>value</item>
                     <key2>value</key2>
                 </list>
                 <key1>
                     <list/>
                     <key1/>
                     <item>value</item>
                     <key2>value</key2>
                 </key1>
                 <item>value</item>
                 <key2>value</key2>
             </list>
  • access: public
static SimpleXMLIterator convertValueToXmlObject (string $value, [string $encoding = null])
  • string $value: The value to be converted. Sample value:
             array(
                 0 => array(
                     0 => array(),
                     'key1' => array(),
                     1 => 'value',
                     'key2' => 'value'
                 ),
                 'key1' => array(
                     0 => array(),
                     'key1' => array(),
                     1 => 'value',
                     'key2' => 'value'
                 ),
                 1 => 'value',
                 'key2' => 'value'
             )
  • string $encoding: The encoding of the value.
static method createXmlNodesFromCellArrayData (line 1732)

Utility: Create XML nodes according to the data given in a cell array, then insert them to a given XML node, or create a SimpleXML object for accessing them if a XML node is not given.

  • access: public
static void createXmlNodesFromCellArrayData (array $cell_array, SimpleXMLElement/DOMNode &$root_node)
  • array $cell_array: The data which list what nodes to create. Sample value:
             array(
                 // Each row defines a node.
                 0 => array(
                     0 => 'div', // The name of an element node.
                     1 => 'id', // The name of an attribute.
                     2 => 'my_div', // The value of the attribute.
                     3 => 'text()', // Create a text node inside the element node.
                     4 => 'Link: ' // The text content.
                 ),
                 1 => array(
                     0 => null, // Use indentation to create child nodes for 'div'.
                     1 => 'a', // The name of an element node.
                     2 => 'href',
                     3 => 'http://phpmycodegen.sourceforge.net/',
                     4 => 'text()',
                     5 => 'PhpMyCodeGenerator'
                 ),
                 2 => array(
                     0 => null, // Use indentation to create child nodes for 'a'.
                     1 => null, // Use indentation to create child nodes for 'a'.
                     2 => 'text()', // Create a text node.
                     3 => ' & PhpMyCellScript'
                 ),
                 3 => array(
                     0 => null, // Use indentation to create child nodes for 'div'.
                     1 => 'table' // The name of an element node.
                 ),
                 4 => array(
                     0 => null, // Use indentation to create child nodes for 'table'.
                     1 => null, // Use indentation to create child nodes for 'table'.
                     2 => 'rows()', // Used to create row and cell nodes in a more convenient way.
                     3 => 'tr', // The name of the row element nodes.
                     4 => 'td', // The name of the cell element nodes.
                     5 => '2', // The number of cells in a row.
                     6 => 'false' // Indicate whether to convert newline to br.
                 ),
                 5 => array(
                     0 => null, // Use indentation to pass row data to rows().
                     1 => null, // Use indentation to pass row data to rows().
                     2 => null, // Use indentation to pass row data to rows().
                     3 => 'Row 1 Cell 1',
                     4 => 'Row 1 Cell 2'
                 ),
                 6 => array(
                     0 => null, // Use indentation to pass row data to rows().
                     1 => null, // Use indentation to pass row data to rows().
                     2 => null, // Use indentation to pass row data to rows().
                     3 => 'Row 2 Cell 1',
                     4 => 'Row 2 Cell 2'
                 ),
                 7 => array(
                     0 => null, // Use indentation to create child nodes for 'div'.
                     1 => 'html()', // Create nodes for a HTML string.
                     2 => '<div><b>Bold HTML string</b></div>'
                 ),
                 8 => array(
                     0 => null, // Use indentation to create child nodes for 'div'.
                     1 => 'cell_array()', // Create nodes using another cell array.
                     2 => array( // Note that this is an array, not a string.
                         0 => array(
                             0 => 'div',
                             1 => 'text()',
                             2 => 'Text from another cell array.'
                         )
                     )
                 ),
                 9 => array(
                     0 => 'pre' // The name of an element node.
                 ),
                 10 => array(
                     0 => null, // Use indentation to create child nodes for 'pre'.
                     1 => 'text_from_cell_array()', // Create a text node using the following cell array.
                     2 => "\n", // The row separator.
                     3 => "\t", // The cell separator.
                     4 => "\n", // The prefix.
                     5 => "\n" // The suffix.
                 ),
                 11 => array(
                     0 => null, // Use indentation to create child nodes for 'pre'.
                     1 => null, // Use indentation to pass data to text_from_cell_array().
                     2 => 'function test() {'
                 ),
                 12 => array(
                     0 => null, // Use indentation to create child nodes for 'pre'.
                     1 => null, // Use indentation to pass data to text_from_cell_array().
                     2 => null, // Use indentation to pass data to text_from_cell_array().
                     3 => 'alert("Test");'
                 ),
                 13 => array(
                     0 => null, // Use indentation to create child nodes for 'pre'.
                     1 => null, // Use indentation to pass data to text_from_cell_array().
                     2 => '}'
                 ),
                 14 => array(
                     0 => 'macro()', // Define a macro.
                     1 => 'HYPERLINK', // The name of the macro.
                     2 => 'a', // The name of an element node.
                     3 => 'href', // The name of the first attribute.
                     4 => 'text()' // The name of the second attribute.
                 ),
                 15 => array(
                     0 => '@HYPERLINK', // Refer to a macro.
                     1 => 'http://phpmycodegen.sourceforge.net/', // The value of the first attribute.
                     2 => 'PhpMyCodeGenerator' // The value of the second attribute.
                 ),
                 16 => array(
                     0 => 'comment()', // Create a comment.
                     1 => '--End--' // The comment to output.
                 ),
                 17 => array(
                     0 => 'comment()', // Create a comment.
                     1 => null, // No comment to output.
                     2 => '--End--' // The comment which will not be outputted.
                 )
             )
  • SimpleXMLElement/DOMNode &$root_node: The nodes created will be inserted into this node if given, otherwise, a SimpleXML object will be created and returned. Sample result:
             <div id="my_div">Link: <a href="http://phpmycodegen.sourceforge.net/">PhpMyCodeGenerator &amp; PhpMyCellScript</a><table><tr><td>Row 1 Cell 1</td><td>Row 1 Cell 2</td></tr><tr><td>Row 2 Cell 1</td><td>Row 2 Cell 2</td></tr></table><div><b>Bold HTML string</b></div><div>Text from another cell array.</div></div>
             <pre>
             function test() {
                 alert("Test");
             }
             </pre>
             <a href="http://phpmycodegen.sourceforge.net/">PhpMyCodeGenerator</a>
             <!----End---->
static method isXmlNameValid (line 1592)

Utility: Check whether a name is a valid XML name, in a given encoding.

  • return: true/false
  • access: public
static boolean isXmlNameValid (string $name, [string $encoding = null])
  • string $name: The name to check.
  • string $encoding: The encoding of the name.
static method parseAgainstLLGrammar (line 2334)

Parse an input string against a compiled LL grammar.

  • return: The parse tree as a SimpleXML object, or false if the input string does not match the grammar.
  • access: public
static SimpleXMLIterator parseAgainstLLGrammar (array $compiled_grammar, string $input_string, [string $start_symbol = null], [int $max_depth = null])
  • array $compiled_grammar: The data returned by compileLLGrammar().
  • string $input_string: The input string to parse. Should be in UTF-8.
  • string $start_symbol: The start symbol.
  • int $max_depth: An exception will be thrown if the height of the result parse tree would exceed the maximum depth. Ignored if <= 0.
static method parseAgainstRegexGrammar (line 2104)

Parse an input string against a compiled regular-expression-based grammar.

  • return: The parse tree as a SimpleXML object, or false if the input string does not match the grammar. Sample result:
             <SIMPLE_SENTENCE>
                 <WORDS>
                     <WORD>This</WORD>
                     <MATCH> </MATCH>
                     <WORD>is</WORD>
                     <MATCH> </MATCH>
                     <WORD>a</WORD>
                     <MATCH> </MATCH>
                     <WORD>sentence</WORD>
                     <MATCH></MATCH>
                 </WORDS>
                 <MATCH>.</MATCH>
             </SIMPLE_SENTENCE>
  • access: public
static SimpleXMLIterator parseAgainstRegexGrammar (array $compiled_grammar, string $input_string, [string $start_symbol = null], [string $encoding = null])
  • array $compiled_grammar: The data returned by compileRegexGrammar().
  • string $input_string: The input string to parse.
  • string $start_symbol: The start symbol.
  • string $encoding: The encoding of the input string.
static method runAutoItScript (line 2587)

Utility: Execute an AutoIt script, and return its output.

  • return: The output of the script.
static string runAutoItScript (string $script)
  • string $script: The AutoIt script to execute.
Constructor __construct (line 65)

Constructor

Example __construct ()
cmd_ARRAY_MERGE (line 2893)

This instruction collects cell values after the current row and the current column, and then merges them into an array variable.

Syntax: ARRAY_MERGE variable [keep_empty_row]

  • variable: an array variable for merging the cell values to.
  • keep_empty_row: Indicate whether to keep the empty rows. (optional)

void cmd_ARRAY_MERGE ( $variable,  $keep_empty_row,  $interpreter)
cmd_ARRAY_MERGE_STRING (line 2906)

This instruction collects cell values after the current row and the current column, then expands the variables in the cell values, and then merges them into an array variable.

Syntax: ARRAY_MERGE_STRING variable [keep_empty_row]

  • variable: an array variable for merging the cell values (where variables will be parsed) to.
  • keep_empty_row: Indicate whether to keep the empty rows. (optional)

void cmd_ARRAY_MERGE_STRING ( $variable,  $keep_empty_row,  $interpreter,  $expanded_strings)
cmd_ARRAY_MERGE_VALUE (line 2942)

This instruction collects cell values after the current row and the current column, then evaluates the expressions in the cell values, and then merges them into an array variable.

Syntax: ARRAY_MERGE_VALUE variable [keep_empty_row]

  • variable: an array variable for merging the cell values (where expressions will be evaluated) to.
  • keep_empty_row: Indicate whether to keep the empty rows. (optional)

void cmd_ARRAY_MERGE_VALUE ( $variable,  $keep_empty_row,  $interpreter,  $expressions)
cmd_ASSERT (line 405)

This instruction checks an assertion.

If a sheet is supposed to be used by other sheets, then this instruction may be used to check whether parameters are provided.

Syntax: ASSERT assertion

  • assertion: the assertion to check.

void cmd_ASSERT ( $assertion,  $interpreter,  $code_to_eval)
cmd_ASSIGN (line 304)

This instruction assigns a string to a variable.

This instruction may be used to save code snippet for output later.

Syntax: ASSIGN variable string

  • variable: the variable.
  • string: the string to assign. Variables in the string will be parsed.

void cmd_ASSIGN ( $variable,  $string)
cmd_ASSIGN_TEXT (line 328)

This instruction assigns the text in a cell to a variable.

This instruction differs from ASSIGN in that it will not expand variables.

Syntax: ASSIGN_TEXT variable text

  • variable: the variable.
  • text: the cell text to assign.

void cmd_ASSIGN_TEXT ( $variable,  $text)
cmd_ASSIGN_VALUE (line 316)

This instruction assigns a PHP value (obtained by evaluating a PHP expression) to a variable.

This instruction provides a cell-based approach to do assignment, instead of using the PHP assignment operator.

Syntax: ASSIGN_VALUE variable value

  • variable: the variable.
  • value: a PHP expression, which will be evaluated to obtain a value.

void cmd_ASSIGN_VALUE ( $variable,  $value)
cmd_AUTOIT (line 2578)

This instruction executes an AutoIt script, so that it is easier to take advantage of the functions provided by AutoIt.

An alternative to this instruction is to use the AutoItX3.Control ActiveX object provided by AutoIt.

Syntax: AUTOIT script [output_variable]

  • script: the AutoIt script, where variables will be parsed.
  • output_variable: a variable for returning the output of the AutoIt script. (optional)

void cmd_AUTOIT ( $script,  $output_variable)
cmd_CLIP_GET (line 2602)

This instruction gets a string from the clipboard, using AutoIt.

Syntax: CLIP_GET output_variable

  • output_variable: a variable for returning the string, in UTF8.

void cmd_CLIP_GET ( $output_variable)
cmd_CLIP_PUT (line 2620)

This instruction puts a string to the clipboard, using AutoIt.

Syntax: CLIP_PUT string

  • string: the string to put to the clipboard, where variables will be parsed.

void cmd_CLIP_PUT ( $string)
cmd_CONCAT (line 378)

This instruction concats a string to a variable.

This instruction may be used to prepare code for output later.

Syntax: CONCAT variable string

  • variable: the variable.
  • string: the string to concat to the variable. Variables in the string will be parsed.

void cmd_CONCAT ( $variable,  $string)
cmd_DIFF (line 3092)

This instruction compares two strings or two arrays of strings.

Syntax: DIFF left right result_variable [align_result]

  • left: the first string or the first array of strings.
  • right: the second string or the second array of strings.
  • result_variable: a variable for returning the comparison result.
  • align_result: indicate whether to align the result. (optional)

void cmd_DIFF ( $left,  $right,  $result_variable,  $align_result)
cmd_DIR_COPY (line 994)

This instruction copies a directory recursively.

Syntax: DIR_COPY source dest [preserve_timestamp]

  • source: the source directory, where variables will be parsed.
  • dest: the destination path, where variables will be parsed.
  • preserve_timestamp: indicate whether to preserve the timestamp of the file/directory. Default is false. (optional)
If success, then the instructions in the next column will be processed.

void cmd_DIR_COPY ( $source,  $dest,  $preserve_timestamp,  $interpreter)
cmd_DIR_NEW_ITERATOR (line 961)

This instruction creates an iterator for iterating a directory.

Syntax: DIR_NEW_ITERATOR iterator_variable path [mode] [regex]

  • iterator_variable: a variable for returning the created iterator. An Exception object will be returned on error.
  • path: the directory path, where variables will be parsed.
  • mode: the mode (either LEAVES_ONLY, SELF_FIRST or CHILD_FIRST in string) to pass to RecursiveIteratorIterator, where variables will be parsed. Default is LEAVES_ONLY. (optional)
  • regex: if given, a RegexIterator will be used to filter the files. Variables will be parsed. (optional)
If success, then the instructions in the next column will be processed.

void cmd_DIR_NEW_ITERATOR ( $iterator_variable,  $path,  $mode,  $regex,  $interpreter)
cmd_DIR_TEMP (line 1040)

This instruction returns the name of a temporary directory.

Syntax: DIR_TEMP dir_name_variable [prefix] [suffix]

  • dir_name_variable: a variable for returning the name of the temporary directory.
  • prefix: the prefix of the temporary directory, where variables will be parsed. (optional)
  • suffix: the suffix of the temporary directory, where variables will be parsed. (optional)

void cmd_DIR_TEMP ( $dir_name_variable,  $prefix,  $suffix)
cmd_DOM_LOAD (line 1423)

This instruction creates a DOMDocument object from a XML/HTML string, while the instructions XML_LOAD/HTML_LOAD will create a SimpleXML object.

Syntax: DOM_LOAD xml_string xml_variable [is_html]

  • xml_string: the XML/HTML string to interpret, where variables will be parsed.
  • xml_variable: a variable for returning the DOMDocument object, or FALSE on failure.
  • is_html: Indicate whether xml_string is a HTML string. (optional)
If success, then the instructions in the next column will be processed.

void cmd_DOM_LOAD ( $xml_string,  $xml_variable,  $is_html,  $interpreter)
cmd_ECHO (line 211)

This instruction echos a string to the console.

This instruction may be used to output generated code to the console.

Syntax: ECHO output_string

  • output_string: the string to output. Variables in the string will be parsed.

void cmd_ECHO ( $output_string)
cmd_ECHO_CELL (line 243)

This instruction quotes a string for use in a CSV field and echos it.

Syntax: ECHO_CELL string

  • string: the string to echo, where variables will be parsed.

void cmd_ECHO_CELL ( $string)
cmd_ECHO_ROW (line 221)

This instruction echos the strings in the following columns as a row, separating the values by tabs.

Syntax: ECHO_ROW [string1] [string2] ...

  • stringX: the strings, where variables will be parsed.

void cmd_ECHO_ROW ( $strings,  $expanded_strings)
cmd_ECHO_SHEET (line 254)

This instruction echos the strings in a two-dimensional array as rows, separating the cells by tabs, and the rows by newlines.

This instruction may help to inspect the arrays created by ARRAY_MERGE/ARRAY_MERGE_STRING for debug purpose.

Syntax: ECHO_SHEET array

  • array: the array to echo.

void cmd_ECHO_SHEET ( $array)
cmd_ELSEIF_E (line 566)

This instruction supports alternative branches for IF-like instructions, and works similar to IF_E.

Syntax: ELSEIF_E string1 string2

  • string1: the first string, where variables will be parsed.
  • string2: the second string, where variables will be parsed.
If no previous branch is executed, and two strings are equal, then the instructions in the next column will be processed.

void cmd_ELSEIF_E ( $string1,  $string2,  $interpreter)
cmd_ELSEIF_M (line 533)

This instruction supports alternative branches for IF-like instructions, and works similar to IF_M.

Syntax: ELSEIF_M pattern source_string [match_result_variable]

  • pattern: a pattern, which will be passed to preg_match(), and where variables will be parsed.
  • source_string: the source string, where variables will be parsed.
  • match_result_variable: a variable for returning the match information, as returned by preg_match(). (optional)
If no previous branch is executed, and a match is found, then the instructions in the next column will be processed.

void cmd_ELSEIF_M ( $pattern,  $source_string,  $match_result_variable,  $interpreter)
cmd_ESCAPE_STRING (line 341)

This instruction escapes a string and saves the escaped string to a variable.

The escaped string can be unescaped by parsing it as a heredoc string.

Syntax: ESCAPE_STRING output_variable string [use_full_version]

  • output_variable: the variable for returning the escaped string.
  • string: the string to escape. Variables in the string will be parsed.
  • use_full_version: indicate whether to escape more characters. See escapeCellHeredocString(). (optional)

void cmd_ESCAPE_STRING ( $output_variable,  $string,  $use_full_version)
cmd_EVAL_CELL_ARRAY (line 87)

This instruction forms PHP code from strings in a cell array, and then evaluates the PHP code.

Syntax: EVAL_CELL_ARRAY [cell_array] [row_separator]

  • cell_array: a cell array with strings to form the PHP code to pass to the eval() function. If not given, cell values after the current row and the current column will be used instead. (optional)
  • row_separator: the separator to add between rows, where variables will be parsed. Default is \n. (optional)

void cmd_EVAL_CELL_ARRAY ( $cell_array,  $row_separator,  $interpreter,  $code_to_eval)
cmd_FILE_COPY (line 855)

This instruction copies a file, which may be used to download a file or extract a file from an archive too.

Syntax: FILE_COPY source dest [preserve_timestamp]

  • source: the source file, where variables will be parsed.
  • dest: the destination path, where variables will be parsed.
  • preserve_timestamp: indicate whether to preserve the timestamp of the file. Default is false. (optional)
If success, then the instructions in the next column will be processed.

void cmd_FILE_COPY ( $source,  $dest,  $preserve_timestamp,  $interpreter)
cmd_FILE_DELETE (line 908)

This instruction deletes a file.

Syntax: FILE_DELETE filename

  • filename: the path to the file to delete, where variables will be parsed.
If success, then the instructions in the next column will be processed.

void cmd_FILE_DELETE ( $filename,  $interpreter)
cmd_FILE_LOAD (line 814)

This instruction loads the content of a file to a variable, which makes it more convenient to work with files in the spreadsheet.

Syntax: FILE_LOAD file_name result_variable

  • file_name: the file name, where variables will be parsed.
  • result_variable: a variable for returning the file content, or FALSE on failure.
If success, then the instructions in the next column will be processed.

void cmd_FILE_LOAD ( $file_name,  $result_variable,  $interpreter)
cmd_FILE_MOVE (line 893)

This instruction renames/moves a file/directory.

Syntax: FILE_MOVE oldpath newpath

  • oldpath: the path of the file/directory to rename/move, where variables will be parsed.
  • newpath: the new path of the file/directory, where variables will be parsed.
If success, then the instructions in the next column will be processed.

void cmd_FILE_MOVE ( $oldpath,  $newpath,  $interpreter)
cmd_FILE_SAVE (line 829)

This instruction saves some content to a file, which makes it more convenient to work with files in the spreadsheet.

Syntax: FILE_SAVE file_name file_content

  • file_name: the file name, where variables will be parsed.
  • file_content: the file content, where variables will be parsed.

void cmd_FILE_SAVE ( $file_name,  $file_content)
cmd_FILE_TEMP (line 841)

This instruction returns the name of a temporary file.

Syntax: FILE_TEMP file_name_variable [prefix] [suffix]

  • file_name_variable: a variable for returning the name of the temporary file.
  • prefix: the prefix of the temporary file, where variables will be parsed. (optional)
  • suffix: the suffix of the temporary file, where variables will be parsed. (optional)

void cmd_FILE_TEMP ( $file_name_variable,  $prefix,  $suffix)
cmd_FILE_TOUCH (line 874)

This instruction sets the modification time of a file, based on the modification time of another file.

Syntax: FILE_TOUCH target [source]

  • target: the target file, where variables will be parsed.
  • source: if given, the modification time of the target file will be set to the modification time of the source file. Variables will be parsed. (optional)

void cmd_FILE_TOUCH ( $target,  $source)
cmd_FIND (line 424)

This instruction searches a source string for matches to a given regular expression, and iterates over the matches, which makes it easier to extract information from a string in the spreadsheet.

Syntax: FIND pattern source_string_variable [match_result_variable] [selection_start_variable] [selection_length_variable]

  • pattern: a pattern, which will be passed to preg_match(), and where variables will be parsed.
  • source_string_variable: a variable which contains the source string.
  • match_result_variable: a variable for returning the current match information, as returned by preg_match(). (optional)
  • selection_start_variable: a variable for returning the offset of the current match, which should be unset or initialized to 0. (optional)
  • selection_length_variable: a variable for returning the length of the current match, which should be unset or initialized to 0. (optional)
If a match is found, then the instructions in the next column will be processed. The offset and the length returned for the current match can be conceived as the current selection of the source string. In subsequent run of this instruction, search will be started from the end of the current selection.

void cmd_FIND ( $pattern,  $source_string_variable,  $match_result_variable,  $selection_start_variable,  $selection_length_variable,  $interpreter)
cmd_GRAMMAR_COMPILE (line 1438)

This instruction uses the compileRegexGrammar() function to compile a regular-expression-based grammar, and then you can use the GRAMMAR_PARSE instruction to parse input strings.

Syntax: GRAMMAR_COMPILE grammar compiled_grammar_variable

  • grammar: the grammar, see compileRegexGrammar().
  • compiled_grammar_variable: a variable for returning the compiled grammar.

void cmd_GRAMMAR_COMPILE ( $grammar,  $compiled_grammar_variable)
cmd_GRAMMAR_LL_COMPILE (line 1468)

This instruction uses the compileLLGrammar() function to compile a LL grammar, and then you can use the GRAMMAR_LL_PARSE instruction to parse input strings.

Syntax: GRAMMAR_LL_COMPILE grammar compiled_grammar_variable

  • grammar: the grammar.
  • compiled_grammar_variable: a variable for returning the compiled grammar.

void cmd_GRAMMAR_LL_COMPILE ( $grammar,  $compiled_grammar_variable)
cmd_GRAMMAR_LL_PARSE (line 1484)

This instruction uses the parseAgainstLLGrammar() function to parse an input string against a compiled LL grammar, a parse tree will be returned as a SimpleXML object for you to query against.

Syntax: GRAMMAR_LL_PARSE compiled_grammar input_string parse_tree_variable [start_symbol] [max_depth]

  • compiled_grammar: the compiled grammar, returned by GRAMMAR_LL_COMPILE.
  • input_string: the input string to parse, where variables will be parsed. Should be in UTF-8.
  • parse_tree_variable: a variable for returning the parse tree, which is a SimpleXML object. An Exception object will be returned on error.
  • start_symbol: the start symbol of the grammar, where variables will be parsed. (optional)
  • max_depth: failed if the height of the result parse tree would exceed the maximum depth. (optional)
If success, then the instructions in the next column will be processed.

void cmd_GRAMMAR_LL_PARSE ( $compiled_grammar,  $input_string,  $parse_tree_variable,  $start_symbol,  $max_depth,  $interpreter)
cmd_GRAMMAR_PARSE (line 1454)

This instruction uses the parseAgainstRegexGrammar() function to parse an input string against a compiled regular-expression-based grammar, a parse tree will be returned as a SimpleXML object for you to query against.

Syntax: GRAMMAR_PARSE compiled_grammar input_string parse_tree_variable [start_symbol] [encoding]

  • compiled_grammar: the compiled grammar, returned by GRAMMAR_COMPILE.
  • input_string: the input string to parse, where variables will be parsed.
  • parse_tree_variable: a variable for returning the parse tree, which is a SimpleXML object.
  • start_symbol: the start symbol of the grammar, where variables will be parsed. (optional)
  • encoding: the encoding of the input string, where variables will be parsed. (optional)
If success, then the instructions in the next column will be processed.

void cmd_GRAMMAR_PARSE ( $compiled_grammar,  $input_string,  $parse_tree_variable,  $start_symbol,  $encoding,  $interpreter)
cmd_HTML_LOAD (line 1373)

This instruction interprets a string of HTML into a SimpleXML object.

Syntax: HTML_LOAD html_string xml_variable

  • html_string: the HTML string to interpret, where variables will be parsed.
  • xml_variable: a variable for returning the SimpleXMLIterator object, or FALSE on failure.
If success, then the instructions in the next column will be processed.

void cmd_HTML_LOAD ( $html_string,  $xml_variable,  $interpreter)
cmd_HTML_TO_STRING (line 1390)

This instruction dumps a HTML string for a XML node.

Syntax: HTML_TO_STRING result_variable xml_node [format_output_flag]

  • result_variable: a variable for returning the HTML string.
  • xml_node: the XML node to dump. A SimpleXMLElement or DOMNode object.
  • format_output_flag: indicate whether to format the HTML string. (optional)

void cmd_HTML_TO_STRING ( $result_variable,  $xml_node,  $format_output_flag)
cmd_ICONV (line 2840)

This instruction corresponds to the PHP iconv() function, which makes it more convenient to perform character set conversion on strings in the spreadsheet.

As the encoding of the string returned by Cells()->Value depends on the system code page, but some PHP functions (like XML or Selenium ones) take or return UTF-8 strings, you may use this instruction to do conversion if needed.

Syntax: ICONV in_charset out_charset input_string output_variable

  • in_charset: the charset of the input string, where variables will be parsed.
  • out_charset: the output charset, where variables will be parsed.
  • input_string: the string to be converted, where variables will be parsed.
  • output_variable: a variable for returning the converted string, or FALSE on failure.

void cmd_ICONV ( $in_charset,  $out_charset,  $input_string,  $output_variable)
cmd_IF_E (line 550)

This instruction checks whether two strings are equal.

Syntax: IF_E string1 string2

  • string1: the first string, where variables will be parsed.
  • string2: the second string, where variables will be parsed.
If two strings are equal, then the instructions in the next column will be processed.

void cmd_IF_E ( $string1,  $string2,  $interpreter)
cmd_IF_M (line 513)

This instruction searches a source string for a match to a given regular expression, using the PHP function preg_match().

Syntax: IF_M pattern source_string [match_result_variable]

  • pattern: a pattern, which will be passed to preg_match(), and where variables will be parsed.
  • source_string: the source string, where variables will be parsed.
  • match_result_variable: a variable for returning the match information, as returned by preg_match(). (optional)
If a match is found, then the instructions in the next column will be processed.

void cmd_IF_M ( $pattern,  $source_string,  $match_result_variable,  $interpreter)
cmd_INCLUDE_PHP (line 106)

This instruction includes and evaluates a PHP script in a local function scope. It can optionally capture the script output.

Syntax: INCLUDE_PHP path [output_variable]

  • path: the path to the PHP script to include, where variables will be parsed.
  • output_variable: a variable for returning the script output, if given. Otherwise, the script output will not be captured. (optional)
If success, then the instructions in the next column will be processed.

void cmd_INCLUDE_PHP ( $path,  $output_variable,  $interpreter)
cmd_IS_CLI (line 2865)

This instruction checks whether CLI PHP is used.

Syntax: IS_CLI

If success, then the instructions in the next column will be processed.

void cmd_IS_CLI ( $interpreter)
cmd_IS_ON_WINDOWS (line 2851)

This instruction checks whether the operating system is Windows.

Syntax: IS_ON_WINDOWS

If success, then the instructions in the next column will be processed.

void cmd_IS_ON_WINDOWS ( $interpreter)
cmd_IS_WEB (line 2879)

This instruction checks whether PHP is used in the web context.

Syntax: IS_WEB

If success, then the instructions in the next column will be processed.

void cmd_IS_WEB ( $interpreter)
cmd_JSON_LOAD (line 3277)

This instruction decodes a JSON string.

Syntax: JSON_LOAD json_string result_variable

  • json_string: the JSON string to decode, where variables will be parsed.
  • result_variable: a variable for returning the result PHP value.

void cmd_JSON_LOAD ( $json_string,  $result_variable)
cmd_JSON_TO_STRING (line 3288)

This instruction converts a PHP value to a JSON string.

Syntax: JSON_TO_STRING result_variable value

  • result_variable: a variable for returning the JSON string.
  • value: the PHP value to convert.

void cmd_JSON_TO_STRING ( $result_variable,  $value)
cmd_LIST (line 2979)

This instruction assigns element values in an array to the given variables.

This instruction provides an alternative way to assign a list of variables than using the PHP list() language construct.

Syntax: LIST [variable1] [variable2] ... [variablen] array

  • variable1..n: the variables for returning the element values. (optional)
  • array: the array with the element values to assign. This is in the last non-empty cell.

void cmd_LIST ( $variables,  $code_to_eval)
cmd_MERGE (line 269)

This instruction saves/merges a string to a file.

This instruction may be used to output generated code to a file.

Syntax: MERGE file_name output_string

  • file_name: the file name, where variables will be parsed.
  • output_string: the string to output. Variables in the string will be parsed.

void cmd_MERGE ( $file_name,  $output_string)
cmd_MKDIR (line 1027)

This instruction makes a directory.

Syntax: MKDIR path_name

  • path_name: the directory path, where variables will be parsed.

void cmd_MKDIR ( $path_name)
cmd_MSWORD_FIND (line 1178)

This instruction finds all instances of a given search text, and returns the ranges of the instances found.

Syntax: MSWORD_FIND range_object search_text result_variable [max_num_of_results]

  • range_object: the Range object, within which the text will be searched.
  • search_text: the text to find, where variables will be parsed.
  • result_variable: a variable for returning the ranges of the instances found.
  • max_num_of_results: the maximum number of results to return. No limit if <= 0. (optional)
If there are instances found, then the instructions in the next column will be processed.

void cmd_MSWORD_FIND ( $range_object,  $search_text,  $result_variable,  $max_num_of_results,  $interpreter)
cmd_MSWORD_NEW (line 1145)

This instruction adds a new, empty Microsoft Word document, which may be used to save some information (like images) extracted from other documents.

Syntax: MSWORD_NEW document_variable

  • document_variable: a variable for returning a Word.Document object.

void cmd_MSWORD_NEW ( $document_variable)
cmd_MSWORD_OPEN (line 1123)

This instruction opens a Microsoft Word document, which intends to use with other related instructions to make it easier to extract information from Microsoft Word documents.

Syntax: MSWORD_OPEN file_name document_variable

  • file_name: the file name, where variables will be parsed.
  • document_variable: a variable for returning the Word.Document object, or FALSE on failure.
If success, then the instructions in the next column will be processed.

void cmd_MSWORD_OPEN ( $file_name,  $document_variable,  $interpreter)
cmd_MSWORD_TO_ARRAY (line 1161)

This instruction copies the elements in a Collection object to a PHP array, so that you can iterate through the elements using the FOREACH instruction in the spreadsheet.

Syntax: MSWORD_TO_ARRAY collection_object array_variable

  • collection_object: the Collection object, like Documents, Paragraphs, Styles.
  • array_variable: a variable for returning the PHP array.

void cmd_MSWORD_TO_ARRAY ( $collection_object,  $array_variable)
cmd_ODBC_COLUMNS (line 656)

This instruction corresponds to the PHP odbc_columns() function, which makes it easier to write database related scripts.

Syntax: ODBC_COLUMNS qualifier schema table_name column_name result_variable

  • qualifier: a parameter to odbc_columns(), where variables will be parsed.
  • schema: a parameter to odbc_columns(), where variables will be parsed.
  • table_name: a parameter to odbc_columns(), where variables will be parsed.
  • column_name: a parameter to odbc_columns(), where variables will be parsed.
  • result_variable: a variable for returning the result set, or FALSE on failure.
If success, then the instructions in the next column will be processed.

void cmd_ODBC_COLUMNS ( $qualifier,  $schema,  $table_name,  $column_name,  $result_variable,  $interpreter,  $connection_id_variable)
cmd_ODBC_CONNECT (line 581)

This instruction corresponds to the PHP odbc_connect() function, which makes it easier to write database related scripts.

Syntax: ODBC_CONNECT dsn user password [connection_id_variable]

  • dsn: a parameter to odbc_connect(), where variables will be parsed.
  • user: a parameter to odbc_connect(), where variables will be parsed.
  • password: a parameter to odbc_connect(), where variables will be parsed.
  • connection_id_variable: a variable for returning the return value of odbc_connect(). (optional)
If success, then the instructions in the next column will be processed.

void cmd_ODBC_CONNECT ( $dsn,  $user,  $password,  $connection_id_variable,  $interpreter)
cmd_ODBC_EXEC (line 755)

This instruction corresponds to the PHP odbc_exec() function, which makes it easier to write database related scripts.

Syntax: ODBC_EXEC query_string result_variable [result_type]

  • query_string: a parameter to odbc_exec(), where variables will be parsed.
  • result_variable: a variable for returning the result set, or FALSE on failure.
  • result_type: indicate what type of result set array to return, either BOTH, ASSOC or NUM, where variables will be parsed. (optional)
If success, then the instructions in the next column will be processed.

void cmd_ODBC_EXEC ( $query_string,  $result_variable,  $result_type,  $interpreter,  $connection_id_variable)
cmd_ODBC_PROCEDURES (line 708)

This instruction corresponds to the PHP odbc_procedures() function, which makes it easier to write database related scripts.

Syntax: ODBC_PROCEDURES qualifier owner name result_variable

  • qualifier: a parameter to odbc_procedures(), where variables will be parsed.
  • owner: a parameter to odbc_procedures(), where variables will be parsed.
  • name: a parameter to odbc_procedures(), where variables will be parsed.
  • result_variable: a variable for returning the result set, or FALSE on failure.
If success, then the instructions in the next column will be processed.

void cmd_ODBC_PROCEDURES ( $qualifier,  $owner,  $name,  $result_variable,  $interpreter,  $connection_id_variable)
cmd_ODBC_TABLES (line 607)

This instruction corresponds to the PHP odbc_tables() function, which makes it easier to write database related scripts.

Syntax: ODBC_TABLES qualifier owner name result_variable

  • qualifier: a parameter to odbc_tables(), where variables will be parsed.
  • owner: a parameter to odbc_tables(), where variables will be parsed.
  • name: a parameter to odbc_tables(), where variables will be parsed.
  • result_variable: a variable for returning the result set, or FALSE on failure.
If success, then the instructions in the next column will be processed.

void cmd_ODBC_TABLES ( $qualifier,  $owner,  $name,  $result_variable,  $interpreter,  $connection_id_variable)
cmd_PASSTHRU (line 2648)

This instruction uses the PHP function passthru() to execute an external program, which can handle interactive program better.

Syntax: PASSTHRU command [argument1 argument2 ... argumentn return_status_variable]

  • command: the name of the command, where variables will be parsed. Command string will not be escaped.
  • argument1..n: the arguments of the command, where variables will be parsed. Argument strings will be escaped. (optional)
  • return_status_variable: a variable for returning the status of the executed command. This is in the last non-empty cell. Optional if no argument is given.

void cmd_PASSTHRU ( $command,  $arguments,  $return_status_variable,  $expanded_strings)
cmd_PHP (line 76)

This instruction evaluates a PHP template, and returns the evaluation result, which makes it possible to write code template using PHP in the spreadsheet.

Syntax: PHP php_template [output_variable]

  • php_template: the PHP template.
  • output_variable: a variable for returning the output. (optional)

void cmd_PHP ( $php_template,  $output_variable)
cmd_PROC_CLOSE (line 2818)

This instruction closes a process started by PROC_OPEN.

Syntax: PROC_CLOSE [exit_code_variable]

  • exit_code_variable: a variable for returning the exit code. (optional)

void cmd_PROC_CLOSE ( $exit_code_variable,  $interpreter)
cmd_PROC_OPEN (line 2721)

This instruction executes a command using the PHP function proc_open(), which provides a much greater degree of control over the program execution.

Syntax: PROC_OPEN command [cwd] [process_variable]

  • command: the command to execute, where variables will be parsed.
  • cwd: the initial working dir for the command, where variables will be parsed. (optional)
  • process_variable: a variable for returning the return value of proc_open(), or false on error. (optional)
If success, then the instructions in the next column will be processed.

void cmd_PROC_OPEN ( $command,  $cwd,  $process_variable,  $interpreter)
cmd_PROC_STDERR (line 2794)

This instruction receives a string from the stderr of a process, started by PROC_OPEN.

Syntax: PROC_STDERR [output_variable] [is_read_line] [length] [echo_flag]

  • output_variable: a variable for returning the error string. (optional)
  • is_read_line: indicate whether to read a line. (optional)
  • length: The number of bytes to read. Default is 8192, but no default if to read a line. (optional)
  • echo_flag: indicate whether to echo the string received from the process. (optional)

void cmd_PROC_STDERR ( $output_variable,  $is_read_line,  $length,  $echo_flag,  $interpreter)
cmd_PROC_STDIN (line 2749)

This instruction sends a string to the stdin of a process, started by PROC_OPEN.

Syntax: PROC_STDIN input_string [result_variable] [echo_flag]

  • input_string: the input string to send to the stdin of the process, where variables will be parsed.
  • result_variable: a variable for returning the return value of fwrite(), i.e. the number of bytes written, or false on error. (optional)
  • echo_flag: indicate whether to echo the input string sent to the process. (optional)

void cmd_PROC_STDIN ( $input_string,  $result_variable,  $echo_flag,  $interpreter)
cmd_PROC_STDOUT (line 2767)

This instruction receives a string from the stdout of a process, started by PROC_OPEN.

Syntax: PROC_STDOUT [output_variable] [is_read_line] [length] [echo_flag]

  • output_variable: a variable for returning the output string. (optional)
  • is_read_line: indicate whether to read a line. (optional)
  • length: The number of bytes to read. Default is 8192, but no default if to read a line. (optional)
  • echo_flag: indicate whether to echo the string received from the process. (optional)

void cmd_PROC_STDOUT ( $output_variable,  $is_read_line,  $length,  $echo_flag,  $interpreter)
cmd_PROMPT (line 133)

This instruction echos a prompt string, then gets and returns the user input, which helps to get user input in the spreadsheet.

Syntax: PROMPT prompt_string [output_variable]

  • prompt_string: the prompt string, where variables will be parsed.
  • output_variable: a variable for returning the user input. (optional)

void cmd_PROMPT ( $prompt_string,  $output_variable)
cmd_PROMPT_PWD (line 154)

This instruction echos a prompt string, and then gets a password from the user.

Syntax: PROMPT_PWD prompt_string [output_variable]

  • prompt_string: the prompt string, where variables will be parsed.
  • output_variable: a variable for returning the password. (optional)

void cmd_PROMPT_PWD ( $prompt_string,  $output_variable)
cmd_REPLACE (line 479)

This instruction just replaces the current selection marked by the FIND instruction with a given string, and update the current selection, which makes it easier to modify a string in the spreadsheet.

Syntax: REPLACE replacement_string

  • replacement_string: the replacement string, where variables will be parsed.

void cmd_REPLACE ( $replacement_string,  $interpreter,  $source_string_variable,  $selection_start_variable,  $selection_length_variable)
cmd_RMDIR (line 924)

This instruction removes a directory.

Syntax: RMDIR dirname [recursive]

  • dirname: the path to the directory to remove, where variables will be parsed.
  • recursive: indicate whether to remove sub-directories recursively. Default is false. (optional)
If success, then the instructions in the next column will be processed.

void cmd_RMDIR ( $dirname,  $recursive,  $interpreter)
cmd_RUN_ASYNC (line 2698)

This instruction executes a command asynchronously.

Syntax: RUN_ASYNC command [window_style]

  • command: the command and its arguments, where variables will be parsed.
  • window_style: the window style, which will be passed to the Run method of the WScript.Shell object. (optional)

void cmd_RUN_ASYNC ( $command,  $window_style)
cmd_SELECT_DIR (line 1090)

This instruction opens a dialog for selecting a directory.

Syntax: SELECT_DIR directory_path_variable prompt_string [root_folder]

  • directory_path_variable: a variable for returning the path of the selected directory.
  • prompt_string: the prompt string, where variables will be parsed.
  • root_folder: the root folder to use in the dialog box. Variables will be parsed. (optional)
If success, then the instructions in the next column will be processed.

void cmd_SELECT_DIR ( $directory_path_variable,  $prompt_string,  $root_folder,  $interpreter)
cmd_SELECT_OPTION (line 191)

This instruction shows a list of options, and asks the user to select one of them.

Syntax: SELECT_OPTION prompt_string options output_variable

  • prompt_string: the prompt string, where variables will be parsed.
  • options: an array of options.
  • output_variable: a variable for returning the index of the selected option. The variable may be initialized with the index of the default option.

void cmd_SELECT_OPTION ( $prompt_string,  $options,  $output_variable)
cmd_SELENIUM_DO (line 2509)

This instruction executes a Selenium command.

Syntax: SELENIUM_DO command [target] [value] [result_variable] [encoding]

  • command: the Selenium command, where variables will be parsed.
  • target: the first parameter of the command, where variables will be parsed. (optional)
  • value: the second parameter of the command, where variables will be parsed. (optional)
  • result_variable: a variable for returning the command result. (optional)
  • encoding: the encoding of the target string and the value string (after parsed variables), where variables will be parsed. (optional)
If success, then the instructions in the next column will be processed.

void cmd_SELENIUM_DO ( $command,  $target,  $value,  $result_variable,  $encoding,  $interpreter,  $selenium_variable)
cmd_SELENIUM_START (line 2472)

This instruction starts a browser using Selenium Remote Control, so that you can script a browser.

You need to install the Selenium PHP client driver in order to use this instruction.

Syntax: SELENIUM_START browser browser_url [selenium_variable] [host] [port]

  • browser: the browser to start, which will be passed to the constructor of Testing_Selenium, and where variables will be parsed.
  • browser_url: a URL, which will be passed to the constructor of Testing_Selenium, and where variables will be parsed.
  • selenium_variable: a variable for returning the Testing_Selenium object. (optional)
  • host: the host of the RC server, where variables will be parsed. (optional)
  • port: the port of the RC server, where variables will be parsed. (optional)
If success, then the instructions in the next column will be processed.

void cmd_SELENIUM_START ( $browser,  $browser_url,  $selenium_variable,  $host,  $port,  $interpreter)
cmd_SELENIUM_STOP (line 2552)

This instruction stops the browser started by SELENIUM_START.

Syntax: SELENIUM_STOP

void cmd_SELENIUM_STOP ( $interpreter,  $selenium_variable)
cmd_SHELL_EXEC (line 2682)

This instruction uses the PHP function shell_exec() to execute a command.

Syntax: SHELL_EXEC command [argument1 argument2 ... argumentn output_variable]

  • command: the name of the command, where variables will be parsed. Command string will not be escaped.
  • argument1..n: the arguments of the command, where variables will be parsed. Argument strings will be escaped. (optional)
  • output_variable: a variable for returning the output of the executed command. This is in the last non-empty cell. Optional if no argument is given.

void cmd_SHELL_EXEC ( $command,  $arguments,  $output_variable,  $expanded_strings)
cmd_STRING (line 122)

This instruction evaluates and returns a string, which makes it possible to write code template using PHP heredoc string in the spreadsheet.

Syntax: STRING string [output_variable]

  • string: the string, where variables will be parsed.
  • output_variable: a variable for returning the expanded string. (optional)

void cmd_STRING ( $string,  $output_variable)
cmd_STRING_ARRAY (line 3011)

This instruction creates an array of strings.

Syntax: STRING_ARRAY [string1] [string2] ... [stringn] array_variable

  • string1..n: the strings, where variables will be parsed. (optional)
  • array_variable: a variable for returning the array created. This is in the last non-empty cell.

void cmd_STRING_ARRAY ( $strings,  $array_variable,  $expanded_strings)
cmd_STRING_FROM_CELL_ARRAY (line 3030)

This instruction helps to form a string from strings in a cell array.

Trailing empty cells in each row will be ignored.

Syntax: STRING_FROM_CELL_ARRAY string_variable [cell_array] [row_separator] [cell_separator] [prefix] [suffix]

  • string_variable: the string formed will be appended to this variable.
  • cell_array: a cell array with strings. If not given, cell values after the current row and the current column will be used instead. (optional)
  • row_separator: the separator to add between rows, like \n, where variables will be parsed. (optional)
  • cell_separator: the separator to add between cells, like \t, where variables will be parsed. (optional)
  • prefix: the prefix string to add before the first row, where variables will be parsed. (optional)
  • suffix: the suffix string to add after the last row, where variables will be parsed. (optional)

void cmd_STRING_FROM_CELL_ARRAY ( $string_variable,  $cell_array,  $row_separator,  $cell_separator,  $prefix,  $suffix,  $interpreter)
cmd_SYSTEM (line 2636)

This instruction uses the PHP function system() to execute an external program.

Syntax: SYSTEM command [argument1 argument2 ... argumentn return_status_variable]

  • command: the name of the command, where variables will be parsed. Command string will not be escaped.
  • argument1..n: the arguments of the command, where variables will be parsed. Argument strings will be escaped. (optional)
  • return_status_variable: a variable for returning the status of the executed command. This is in the last non-empty cell. Optional if no argument is given.

void cmd_SYSTEM ( $command,  $arguments,  $return_status_variable,  $expanded_strings)
cmd_UNSET (line 388)

This instruction unsets some variables.

Syntax: UNSET variable1 [variable2] ...

  • variableX: the variables to unset.

void cmd_UNSET ( $variables,  $code_to_eval)
cmd_VALUE_ARRAY (line 2997)

This instruction creates an array of values.

Syntax: VALUE_ARRAY [expression1] [expression2] ... [expressionn] array_variable

  • expression1..n: the expressions to evaluate. (optional)
  • array_variable: a variable for returning the array created. This is in the last non-empty cell.

void cmd_VALUE_ARRAY ( $expressions,  $array_variable,  $values)
cmd_XML_FROM_CELL_ARRAY (line 1244)

This instruction uses the createXmlNodesFromCellArrayData() function to create XML nodes, then insert them to a given XML node, or create a SimpleXML object for accessing them if a XML node is not given.

Syntax: XML_FROM_CELL_ARRAY xml_variable [cell_array]

  • xml_variable: a XML node where new nodes will be inserted, or a variable for returning a new SimpleXMLIterator object.
  • cell_array: a cell array with node information. If not given, cell values after the current row and the current column will be used instead. (optional)

void cmd_XML_FROM_CELL_ARRAY ( $xml_variable,  $cell_array,  $interpreter)
cmd_XML_FROM_VALUE (line 1233)

This instruction uses the convertValueToXmlObject() function to convert a value into a SimpleXML object, against which you can run XPath queries.

Syntax: XML_FROM_VALUE value xml_variable [encoding]

  • value: an array, object or simply a scalar value.
  • xml_variable: a variable for returning the SimpleXMLIterator object.
  • encoding: the encoding of the value, where variables will be parsed. (optional)

void cmd_XML_FROM_VALUE ( $value,  $xml_variable,  $encoding)
cmd_XML_LOAD (line 1217)

This instruction uses the simplexml_load_string() function to interpret a string of XML into an object, which makes it more convenient to work with XML in the spreadsheet.

Syntax: XML_LOAD xml_string xml_variable

  • xml_string: the XML string to interpret, where variables will be parsed.
  • xml_variable: a variable for returning the SimpleXMLIterator object, or FALSE on failure.
If success, then the instructions in the next column will be processed.

void cmd_XML_LOAD ( $xml_string,  $xml_variable,  $interpreter)
cmd_XML_TO_STRING (line 1333)

This instruction dumps a XML string for a XML node.

Syntax: XML_TO_STRING result_variable xml_node [format_output_flag] [remove_xml_declaration_flag]

  • result_variable: a variable for returning the XML string.
  • xml_node: the XML node to dump. A SimpleXMLElement or DOMNode object.
  • format_output_flag: indicate whether to format the XML string. (optional)
  • remove_xml_declaration_flag: indicate whether to remove the XML declaration from the XML string. (optional)

void cmd_XML_TO_STRING ( $result_variable,  $xml_node,  $format_output_flag,  $remove_xml_declaration_flag)
cmd_XML_XPATH (line 1264)

This instruction runs a XPath query against a SimpleXML/DOMNode node.

Syntax: XML_XPATH xml_node xpath_expression result_variable [prefix1 namespace_uri1 prefix2 namespace_uri2 ... prefixn namespace_urin]

  • xml_node: the SimpleXML/DOMNode node to query on.
  • xpath_expression: the XPath expression, where variables will be parsed.
  • result_variable: a variable for returning the XPath query results. For a DOMNode node, an array will be returned instead of DOMNodeList.
  • prefix1..n: the namespace prefixes to use in the XPath query, where variables will be parsed. (optional)
  • namespace_uri1..n: the URIs of the corresponding namespaces, where variables will be parsed. (optional)
If success, then the instructions in the next column will be processed.

void cmd_XML_XPATH ( $xml_node,  $xpath_expression,  $result_variable,  $prefix_and_ns_pairs,  $interpreter,  $expanded_strings)
cmd_XSLT_NEW (line 3046)

This instruction creates an XSLTProcessor object, and imports a stylesheet for transformations using the XSLT_TRANSFORM instruction.

Syntax: XSLT_NEW [stylesheet] [xslt_variable]

  • stylesheet: the stylesheet to import, as a DOMDocument or SimpleXMLElement object. (optional)
  • xslt_variable: a variable for returning the new XSLTProcessor object. (optional)
If success, then the instructions in the next column will be processed.

void cmd_XSLT_NEW ( $stylesheet,  $xslt_variable,  $interpreter)
cmd_XSLT_TRANSFORM (line 3070)

This instruction transforms an XML node, using the XSLTProcessor object created by the XSLT_NEW instruction.

Syntax: XSLT_TRANSFORM doc result_variable

  • doc: the XML node to transform.
  • result_variable: a variable for returning the resulting DOMDocument object, or false on error.
If success, then the instructions in the next column will be processed.

void cmd_XSLT_TRANSFORM ( $doc,  $result_variable,  $interpreter)
escapeCellHeredocString (line 357)

For escaping special characters in a PHP heredoc string, like "\" and "$".

Some other characters will be escaped too in order to prevent problems in Excel:

  1. Some non-printable characters, like TAB, and non-ASCII characters may be ignored by Excel.
  2. Excel may interpret a cell differently if the cell starts with certain characters, like "=".
  3. Some HTML tags, like TABLE, may be recognized by Excel, which may cause problems. (full version)

void escapeCellHeredocString (string $s, [boolean $use_full_version = false])
  • string $s: The string to escape.
  • boolean $use_full_version: If true, more characters will be escaped.
saveOrMergeOutputToFile (line 280)

Utility: Save some output to a file.

If the output file exists already, WinMerge will be used to merge the output to the file. Assume that WinMergeU.exe is in the path.

void saveOrMergeOutputToFile (string $output_file_name, string $output)
  • string $output_file_name
  • string $output: The output content to save to the file.
Class Constants
version = 2 (line 38)
version_minor = 25 (line 39)

Documentation generated on Sun, 01 Mar 2015 08:43:49 +0000 by phpDocumentor 1.4.3