© Tyl Software Foundation 2019-2021
▶ TEXT ANALYSIS
Tyl has system variables and a string module that can be used to work with
texts.
This is a demonstration of analysing information that is in a settings file 'app.settings':
This is a demonstration of analysing information that is in a settings file 'app.settings':
path 'C:\temp\app.settings'
content io.read path
lines string.lines content
smap { name '' age 0 height 0 isstudent f }
not lines ?
print 'settings file is empty!'
⇋
lines line ~
ind string.index line '='
key string.section line 0 ind
value getvalue string.section line ( ind + 1 )
smap key value
print key + ': ' + value
ᐤ
ᐤ
getvalue value »
result number.of value
not null result ? ✖✖ result
result bool.of value
not null result ? ✖✖ result
value
name: Tony
age: 22
height: 171.5
isstudent: true
age: 22
height: 171.5
isstudent: true
To test this program, create a file 'app.settings', with this content:
All string functionality can be found in String Module Reference.
name=Tony
age=22
height=171.50
isstudent=true
age=22
height=171.50
isstudent=true
All string functionality can be found in String Module Reference.