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
Recent
How to view the TODO list...
by
dsiders
[
Today
at 09:23:22 pm]
Stack overflow detection
by
PascalDragon
[
Today
at 09:20:33 pm]
Gtk3 widgetset - call for...
by
PascalDragon
[
Today
at 09:17:47 pm]
FPC Unleashed (inline var...
by
creaothceann
[
Today
at 09:16:22 pm]
Windows 10 x64 Kernel Dri...
by
PascalDragon
[
Today
at 09:07:06 pm]
Feature announcement: Fun...
by
PascalDragon
[
Today
at 08:57:47 pm]
How can I suppress except...
by
PascalDragon
[
Today
at 08:34:40 pm]
Qt does not position form...
by
systemgvp
[
Today
at 08:31:50 pm]
TA Chart Axes visibility ...
by
wp
[
Today
at 08:22:28 pm]
USB-C PD logger KM003C
by
DonAlfredo
[
Today
at 07:42:44 pm]
IDE: Property editor does...
by
Raskaton
[
Today
at 07:35:18 pm]
Transparent form
by
Nicole
[
Today
at 07:24:20 pm]
TR-DOS Audio Suite
by
Gigatron
[
Today
at 06:26:53 pm]
show me the parameters ce...
by
Nicole
[
Today
at 05:42:40 pm]
Scripts to generate ofici...
by
robert rozee
[
Today
at 03:39:49 pm]
How to compare floating p...
by
Warfley
[
Today
at 03:16:41 pm]
TToolbutton: Dropdown men...
by
apeoperaio
[
Today
at 03:11:30 pm]
FPGMAP accepts duplicates...
by
Zvoni
[
Today
at 02:04:09 pm]
How to read the values ca...
by
dodgex
[
Today
at 11:17:00 am]
Hint tools gives wrong hi...
by
Nicole
[
Today
at 10:43:50 am]
Connecting to AzureSQL
by
paweld
[
Today
at 09:31:30 am]
Nothing but chaotic attem...
by
dbannon
[
Today
at 09:25:17 am]
How do 'with' statements ...
by
Thaddy
[
Today
at 09:14:38 am]
Pascal port of Unishox2
by
Okoba
[
Today
at 08:48:45 am]
Can I get the position an...
by
CM630
[
Today
at 08:38:48 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TProcess freeze (Read 512 times)
LemonParty
Sr. Member
Posts: 463
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: 12841
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
Sr. Member
Posts: 463
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: 12841
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
Sr. Member
Posts: 463
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