Skip to content
bergsma edited this page Sep 26, 2014 · 3 revisions

#echo

###The echo function provides a means in which to capture the contents of the input stream.

Syntax

result = echo terminator ;

Arguments

  1. str terminator

A string that identifies the end-of-stream.
When the echo function encounters this string, the capture of the input stream is ended. You must put a ';' on the end of the end-of-stream terminator.

Return Value

list result
  • inputStream : The captured input stream is returned line by line in a str variable.

The STATUS variable is set to $ACKNOWLEDGE

list result
  • inputStream : The captured input stream is returned line by line in a str variable.

The STATUS variable is set to $ACKNOWLEDGE

Exceptions

  • %ARGUMENT: Invalid arguments. Usage: result = echo terminator ;

Description

The echo function is useful in cases where portions of the input code need to be captured by HyperScript.

Examples

// Capture the input stream
puts "Capturing the input stream" ;
str inline ; global inline ;
inline = echo "endOfInline" ;
// Comment within the input stream
puts "hello world" ;
put { 1,2,3,4,5 } ;
// *** Remember the semi-colon after the terminator string ***
endOfInline ;

// Show what we just captured
puts "After echo, contents of inputstream are:" ;
puts "------------------------" ;
puts inline ;
puts "------------------------" ;

puts " " ;
puts "Before executing *inline" ;
*inline ;
puts "After executing *inline" ;

Related Links

None

Clone this wiki locally