TYL PROGRAMMING LANGUAGE
▶ WORKING WITH EXECUTABLE PROGRAMS
Output Data from Executable Programs
An executable program has the ability to send data, for informative purpose, or as a program result for use by another program.

Here's a data analysis application, where data is sent from program 'stat.app.tyl', to data analysis executable program 'stat.ageana.exe':

≡    stat.app.tyl
data [ 10 100 2 20 90 30 ]
≡ convert items list to data string
datastr ''
data item ~ datastr ++ item + ' '
≡ send to data analyser for processing
ageana process 'stat.ageana.exe' datastr
result ageana.run
print result
≡    stat.ageana.exe
≡ get incoming data string
datastr in 0
≡ null check
null datastr ? out -1
≡ parse data
data [ ]
words string.words datastr
words word ~ data number.of word
≡ analyse data
sum 0
data item ~ sum ++ item
result sum ÷ len data
≡ output analysis result
out result
First, turn the second code 'stat.ageana.tyl' into an executable 'stat.ageana.exe'.

stat.ageana makes use of in system function to get the data from stat.app. After processing the data, in the last line out result, it uses out system function to output the result.

This out mechanism works with processes that can get data from output stream, such as Process Module, so in stat.app, result gets the result of data processing from stat.ageana.
PART 1