Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Solved]How to redirect console output to a TMemo?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Alice0725
Expert Cheater
Reputation: 11

Joined: 24 Jul 2012
Posts: 145

PostPosted: Sun Nov 11, 2012 5:05 am    Post subject: [Solved]How to redirect console output to a TMemo? Reply with quote

How to redirect real-time console output to a TMemo in Lazarus?

Last edited by Alice0725 on Mon Nov 12, 2012 4:31 am; edited 2 times in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25837
Location: The netherlands

PostPosted: Sun Nov 11, 2012 6:52 am    Post subject: Reply with quote

Use the TProcess class.

Code:

uses ...,process;
...


var p: TProcess;
begin
  p:=tprocess.Create(self);
  p.Options:=[poUsePipes, poWaitOnExit, poNoConsole];
  p.Executable:=pathtompressdotexe;
  p.Execute;

  if p.Output<>nil then
    memo1.Lines.LoadFromStream(p.output);

  p.free;

end;   


You can also go without poWaitOnExit but then you need to constantly read the output until the process stops

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Alice0725
Expert Cheater
Reputation: 11

Joined: 24 Jul 2012
Posts: 145

PostPosted: Sun Nov 11, 2012 9:15 am    Post subject: Reply with quote

Very Happy Thanks for your help,Dark Byte! Now it works.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites