Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
TProcess freeze
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Pascal Conference 2025
by
abouchez
[
Today
at 05:23:18 pm]
[Solved] OpenGLContext wi...
by
Seenkao
[
Today
at 05:21:23 pm]
RuntimeError 103 File not...
by
Thaddy
[
Today
at 05:02:47 pm]
Bzzzz It's Cold here: An...
by
Joanna
[
Today
at 04:37:39 pm]
How do you change a packa...
by
n7800
[
Today
at 03:48:53 pm]
Is Lazarus still serious ...
by
ginoo
[
Today
at 02:17:13 pm]
TAChart how to make diffe...
by
tk
[
Today
at 12:29:42 pm]
Problems with libraries f...
by
DonAlfredo
[
Today
at 12:29:38 pm]
Can't register Lazmapview...
by
wp
[
Today
at 12:23:32 pm]
[SOLVED] Can't compile my...
by
Warfley
[
Today
at 11:06:30 am]
-Tembedded Option don't h...
by
marcov
[
Today
at 10:53:18 am]
Rotating Striped Blades
by
Boleeman
[
Today
at 08:57:53 am]
Fast Canvas Library V1.05...
by
Gigatron
[
Today
at 02:39:11 am]
GitHub action setup-lazar...
by
Gustavo 'Gus' Carreno
[
Today
at 01:58:23 am]
Build Lazarus with packag...
by
msch
[
Today
at 12:21:34 am]
Playing video without to ...
by
n7800
[July 19, 2025, 11:40:42 pm]
LazGTFS a freepascal/Laza...
by
EkkehardDomning
[July 19, 2025, 09:03:43 pm]
[solved] can't close app ...
by
Thaddy
[July 19, 2025, 05:26:40 pm]
AI, NLP and CAI: Text Gen...
by
Mongkey
[July 19, 2025, 01:59:33 pm]
[SOVED] Debugger use on O...
by
440bx
[July 19, 2025, 01:19:47 pm]
Not happy with TTimeEdit
by
JuhaManninen
[July 19, 2025, 01:07:54 pm]
Debugger regression in La...
by
Martin_fr
[July 19, 2025, 09:29:04 am]
[SOLVED] UTF8 Keyboard en...
by
Richard Marriott
[July 19, 2025, 07:05:39 am]
Possible Bug or Known Beh...
by
Aruna
[July 19, 2025, 05:26:47 am]
tSQLQuery.UpdateSQL with ...
by
JRBleau
[July 19, 2025, 04:21:39 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TProcess freeze (Read 335 times)
LemonParty
Full Member
Posts: 204
TProcess freeze
«
on:
June 12, 2025, 04:07:43 pm »
I have this code, that by design should compile several units:
Code: Pascal
[Select]
[+]
[-]
P
.
Executable
:
=
CFPC
;
P
.
Options
:
=
P
.
Options
+
[
poWaitOnExit
,
poUsePipes
]
;
Writeln
(
'---32 bit targets---'
)
;
for
i
:
=
0
to
High
(
CUnitNames
)
do
begin
Write
(
' COMPILING '
,
CUnitNames
[
i
]
)
;
P
.
Parameters
[
0
]
:
=
CUnitNames
[
i
]
;
P
.
Execute
;
SL
.
LoadFromStream
(
P
.
Output
)
;
if
P
.
ExitCode
=
0
then
Writeln
(
' OK'
)
else
Writeln
(
SL
.
Text
)
;
end
;
P is TProcess, SL – TStringList. When I run this code it freeze at P.Execute. What the problem?
«
Last Edit: June 12, 2025, 04:10:58 pm by LemonParty
»
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
marcov
Administrator
Hero Member
Posts: 12340
FPC developer.
Re: TProcess freeze
«
Reply #1 on:
June 12, 2025, 04:26:24 pm »
Search for large output here, and implement it.
https://wiki.freepascal.org/Executing_External_Programs
Logged
LemonParty
Full Member
Posts: 204
Re: TProcess freeze
«
Reply #2 on:
June 12, 2025, 05:01:28 pm »
No, still freeze.
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
marcov
Administrator
Hero Member
Posts: 12340
FPC developer.
Re: TProcess freeze
«
Reply #3 on:
June 12, 2025, 05:05:03 pm »
Then you maybe need stderr processing too, see implementation of runcommandloop. (or use runcommand)
Logged
LemonParty
Full Member
Posts: 204
Re: TProcess freeze
«
Reply #4 on:
June 12, 2025, 05:47:18 pm »
I solved this by using RunCommandInDir this way:
Code: Pascal
[Select]
[+]
[-]
RunCommandInDir
(
''
,
CFPC
,
RunSwitches
,
Output
,
ExitCode
)
RunCommandInDir by default wait until process finish.
Thank you for help.
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
TProcess freeze
TinyPortal
© 2005-2018