Re: [BLACKBOX] Simple ASCII text editor example

From: Campbell, Robert (SELEX GALILEO, UK) <robert.d.campbell{([at]})nowhere.xy>
Date: Fri, 6 Aug 2010 08:49:27 +0100

----boundary-LibPST-iamunique-1324395342_-_-
Content-type: text/plain

Stephen,

Just guessing, but have you tried suitably placed calls to:

 Files.File.Flush ?

Cheers

Robert


>> -----Original Message-----
>> From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>> Of Stephen R. Troy
>> Sent: 06 August 2010 03:30
>> To: BLACKBOX{([at]})nowhere.xy
>> Subject: [BLACKBOX] Simple ASCII text editor example
>>
>> *** WARNING ***
>>
>> This message has originated outside your organisation,
>> either from an external partner or the Global Internet.
>> Keep this in mind if you answer this message.
>>
>> 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
>>
SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1324395342_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFN0ZXBoZW4sXHBhcg0KXHBhcg0KSnVzdCBndWVz
c2luZywgYnV0IGhhdmUgeW91IHRyaWVkIHN1aXRhYmx5IHBsYWNlZCBjYWxscyB0bzpccGFyDQpc
cGFyDQogRmlsZXMuRmlsZS5GbHVzaCAgP1xwYXINClxwYXINCkNoZWVyc1xwYXINClxwYXINClJv
YmVydFxwYXINClxwYXINClxwYXINCj4+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tXHBhcg0K
Pj4gRnJvbTogQmxhY2tCb3ggW21haWx0bzpCTEFDS0JPWEBMSVNUUy5PQkVST04uQ0hdIE9uIEJl
aGFsZiBccGFyDQo+PiBPZiBTdGVwaGVuIFIuIFRyb3lccGFyDQo+PiBTZW50OiAwNiBBdWd1c3Qg
MjAxMCAwMzozMFxwYXINCj4+IFRvOiBCTEFDS0JPWEBMSVNUUy5PQkVST04uQ0hccGFyDQo+PiBT
dWJqZWN0OiBbQkxB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DQpyZWNpcGllbnQgcGxlYXNlIGRlbGV0ZSBpdCBm
cm9tIHlvdXIgc3lzdGVtIGFuZCBub3RpZnkgdGhlIHNlbmRlci5ccGFyDQpZb3Ugc2hvdWxkIG5v
dCBjb3B5IGl0IG9yIHVzZSBpdCBmb3IgYW55IHB1cnBvc2Ugbm9yIGRpc2Nsb3NlIG9yXHBhcg0K
ZGlzdHJpYnV0ZSBpdHMgY29udGVudHMgdG8gYW55IG90aGVyIHBlcnNvbi5ccGFyDQoqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKlxwYXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1l
c3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVS
T04uQ0hccGFyDQp9
----boundary-LibPST-iamunique-1324395342_-_---
Received on Fri Aug 06 2010 - 09:49:27 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:30 UTC