Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TMemo buffer boost over 100k?? 1

Status
Not open for further replies.

finnmike

Programmer
Oct 17, 2001
50
DE
Dear Guys,

I am in desperate need for a component/solution to read about 1500 Lines into a TMemo which won't allow me this at once.

I have tried Tfilestream but do not know how to to make my app just read the first, let's say 500, lines and then continue after them.
Please note, I can't just use FileSeek as I do not know the length of the Strings to read; I only know a minimum length.

Can u help????
Best regards
Michael
 
I would make an array of char and load the file into that, then the length of lines can be calculated on the fly. Another approach could be to allocate an array of AnsiStrings and fill them with the datas and then show an appropriate selection. Totte
 
I'm gonna agree with the AnsiString array. You can just make an infinite array of Strings and then simply use something as simple as a for statement and loop through exactly what you need. Cyprus
 
There may be another way. If each line in the file ends with a new line character, you could use getline in a for loop that would get a certain number of lines. If you don't close the stream the buffer should be pointing the the next line in the file so you could repeat this procedure until the EOF is found.

Just a thought. [idea] James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Hello.

The TMemo can only load 32kb of data if you're running Win95/98/ME, just like the MS Notepad.Try using the TRichEdit instead, you shouldn't have this problem.I've read that its default maxlength value is 64kb so just add this line on startup of the Form SendMessage(RichEdit1->Handle, EM_EXLIMITTEXT, 0, 100000);
 
Hej Btecho,

yes, I have already tried that. it works, even without the handlermessage...

but good ideas anyway, >THANX!<
I would have tried a TStringList if the RichEdit wouldn't have helped.

You know, now I am rather in a big ditch with my brandnew Asynch Pro package...

bye,

Michael

What was that about Windows:
Getting out of the car and slamming the door will do it every time.


 
Hi finnmike.

Glad you figured it out :)

You know, now I am rather in a big ditch with my brandnew Asynch Pro package...

If you mean the pack from Turbopower? I myself use the Async Pro and very happy with it. I'm new to the forums so Im not up to date on happenings here. Whatever troubles you have you should certainly contact Turbopower if you haven't they have great cust. support. I usually contact them through their newsgroups or shearch the knowledge base.
 
Hi BTecho,

thank You again,

in the meantime I HAVE talked/mailed to the people at Turbopower.

they once in a while have good ideas, but sometimes don't like to reply more often than once...
after a week posting and reading the knowledgebase (annoying my boss...) I found a bug of APRO myself.
(the one with the APDstatuslightcontroller which inhibits any other timers from working...)

anyway, still it seems a mightx package, but it is slower than the bcbdev.com package for serial comms.
do You have an idea to boost the communication?

greetings from
michael
 
Hello finnmike

I have not known of the bug you mention. Exactely how can I replicate it? I have a device connected to COM1 , I have put a TApdComPort, TApdDataPacket and TApdSLController with all Lights properties set to a different TApdStatusLight, and put a plain TTimer on a Form whith some code on the OnTimer event. I can't seem to see that the TTimer is being disabled.

Also I have not tried this freeware component, buy it is recommended buy those who use it.

Happy Holidays!
 
Dear BTecho,

I have the TApdComPort on one Form, the APDSLcontroller on te mainform.
No datapackets. I MUST read every char for itself to find STX/EOT and/or ACK/NAK which inhibits me from using datapackets.
Or would You say using datapackets would boost speed up?
I heard of a thread priority to be set at runtime, i will try this soon.

Anyway I am reading my chars into an AnsiString, with ApdComPort->GetChar in the OnTriggerAvaliable - Eventhandler.
But the OnTriggerAvail only came sporadically unless I disabled the Lightscontroller. What I also do is that after every string I send to my unit I wait for an answer using DelayTicks(1, TRUE); where the &quot;true&quot; is of the utmost importance. Setting this to &quot;false&quot; left me reading no char at all as I received no OnTriggerAvail event..

Thanks for the other suggestion, but I think it is better not to mix the ComportComponents when using different types of connections. Or would You do this? Using APRO for the modem connections and a fast freeware for the direct connection??

Again, a fresh and happy new year! (-:

Michael
 
Hello Michael :)

<<Or would You say using datapackets would boost speed up?>>
Here is a some text from Apro help

/*
You would typically use data packets in place of data triggers when the data you are looking for has a fixed length or starts or ends with a known string of data. These conditions can be set in the data packet component at design time or run time.
*/

<<I think it is better not to mix the ComportComponents when using different types of connections. Or would You do this?Using APRO for the modem connections and a fast freeware for the direct connection??
>>

Most of APRO components are connected to the TApdComPort component. I'm not sure if you can have 2 different comport components opening the same port. But if they don't collide I see no reason why you can't use the best component for the job.

Happy New Year to you too :-D
 
On a sad note,

TurboPower discontinues retail business

I just hope they will count Async as one of the open source releases. Even if they don't I still haven't found anything better, and there won't be for a while. So if you have bought it in the last 60 you can get a refund, though I would wait a while longer to see how everything unfolds to see how to continue if they offer it as opensource I would get a refund if not and you want to keep the source then its up to you .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top