[BLACKBOX] Simple ASCII text editor example
----boundary-LibPST-iamunique-1398879717_-_-
Content-type: text/plain
Hello List,
I am working with a database program which exports the data as an ASCII text file. I have been writing programs to generate additional reports from this ASCII data file. I want to add a function to filter out certain unnecessary lines in the ASCII data, so I want to read the ASCII file line by line, and (a) if the read lines are not the ones to filter out, write them back to the file; or (b) if they are the ones to filter out, NOT write them back; i.e. I want to read and write in the same ASCII text file. The Blackbox documentation indicates I can have a reader rider (scanner) and a writer rider (formatter) connected to the same file; however the documentation for the ASCII text file example (ObxAscii Docu) states "Mixed reading and writing on the same text is not very common and is therefore not supported in this simple model." I have tried a simple program with both a TextMappers.Scanner and a TextMappers.Formatter. This works as expected with only the Scanner, but as soon as I add the Formatter, the Scanner becomes unstable, jumps backward and repeats characters already read. Does anybody have an example of a simple ASCII text editor, which reads and writes to the same file, that they would be willing to share? Thanks for any suggestions.
Stephen Troy
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
----boundary-LibPST-iamunique-1398879717_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbWh0bWwxIFxkZWZmMHtcZm9udHRibA0Ke1xmMFxm
c3dpc3NcZmNoYXJzZXQwIEFyaWFsO30NCntcZjFcZm1vZGVybiBDb3VyaWVyIE5ldzt9DQp7XGYy
XGZuaWxcZmNoYXJzZXQyIFN5bWJvbDt9DQp7XGYzXGZtb2Rlcm5cZmNoYXJzZXQwIENvdXJpZXIg
TmV3O319DQp7XGNvbG9ydGJsXHJlZDBcZ3JlZW4wXGJsdWUwO1xyZWQwXGdyZWVuMFxibHVlMjU1
O30NClx1YzFccGFyZFxwbGFpblxkZWZ0YWIzNjAgXGYwXGZzMjQgDQp7XCpcaHRtbHRhZzE5IDxo
dG1sPn0NCntcKlxodG1sdGFnNTAgPGJvZHk+fXtcKlxodG1sdGFnNjR9XGh0bWxyd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