Invokes the capture but puts all autocollect data in a new string buffer returns that buffer. Non-autocollecting captures are just invoked with no resulting value.
capture->invokeAutoCollect()
Define a method which takes a givenBlock, invokes it with invokeAutoCollect and writes it to the log.
Code
define log(s) => {
local(f) = file
handle => {#f->close}
#f->openAppend(#s->asString)
#f->writeString(givenBlock->invokeAutoCollect+sys_eol)
}
log('myfile.txt')
'The log message'
/log
Result
The string 'The log message' appended to the file 'myfile.txt'.
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments