Re: [BLACKBOX] Simple ASCII text editor example
----boundary-LibPST-iamunique-618918184_-_-
Content-type: text/plain
Stephen,
I suggest you write to a temporary file and when done delete the original file
Files.dir.Delete(loc, name)
and then register the temporary file
tmp.Register(name, type, ask, res)
with the name of the original file. That should get you want you want.
-Doug Danforth
Stephen R. Troy wrote:
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
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
----boundary-LibPST-iamunique-618918184_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbWh0bWwxIFxkZWZmMHtcZm9udHRibA0Ke1xmMFxm
c3dpc3NcZmNoYXJzZXQwIEFyaWFsO30NCntcZjFcZm1vZGVybiBDb3VyaWVyIE5ldzt9DQp7XGYy
XGZuaWxcZmNoYXJzZXQyIFN5bWJvbDt9DQp7XGYzXGZtb2Rlcm5cZmNoYXJzZXQwIENvdXJpZXIg
TmV3O319DQp7XGNvbG9ydGJsXHJlZDBcZ3JlZW4wXGJsdWUwO1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