<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<pre style="margin: 0em;"><span class="__mozilla-findbar-search"
style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">
> Please provide a compilable program that demonstrates the problem.
> Jonas
</span></pre>
<br>
<br>
<tt>Create a myini.ini file containing :<br>
<br>
[TEST] <br>
CMD_OK=echo 'Hello !'<br>
CMD_NOT_OK=mencoder dvb://M6 -sws 9 -of lavf -lavfopts format=mp4 -vf
scale=480:320,dsize=480:320,harddup -ovc x264 -x264encopts
bitrate=500:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:me=umh:trellis=1:level_idc=30:global_header:threads=2:pass=1:turbo
-oac faac -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 48000
-o test.mp4<br>
<br>
<br>
Then the program :<br>
<br>
program Pb_TProcess_255; <br>
<br>
uses Process, inifiles; <br>
<br>
var <br>
Ini_File : TIniFile;<br>
CMD_OK, CMD_NOT_OK : ansistring;<br>
<br>
// Read INI File<br>
Procedure Read_Parameters_File;<br>
begin<br>
Ini_File := TIniFile.Create('./myini.ini');<br>
<br>
with Ini_File do begin<br>
CMD_OK:=ReadString('TEST', 'CMD_OK', 'error');<br>
CMD_NOT_OK:=ReadString('TEST', 'CMD_NOT_OK', 'error');<br>
writeln;<br>
writeln(' CMD_OK : '+CMD_OK);<br>
writeln;<br>
writeln(' CMD_NOT_OK : '+CMD_NOT_OK);<br>
writeln;<br>
end;<br>
end;<br>
<br>
// Run an OS Command and *Wait* his Completion to Continue<br>
procedure Run_Command_Wait(TheCommand : string); cdecl;<br>
var<br>
AProcess: TProcess;<br>
Begin<br>
AProcess := TProcess.Create(nil);<br>
AProcess.CommandLine := TheCommand;<br>
AProcess.Options := AProcess.Options+ [poWaitOnExit];<br>
AProcess.Execute;<br>
AProcess.Free;<br>
end;<br>
<br>
// Main Program<br>
begin <br>
Read_Parameters_File;<br>
Run_Command_Wait(CMD_OK);<br>
writeln;<br>
Run_Command_Wait(CMD_NOT_OK);<br>
end. <br>
<br>
<br>
The first command runs OK but the 2nd one reports an error and shows
the 255th character :<br>
<br>
Hello !<br>
<br>
MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team<br>
CPU: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (Family: 6, Model:
15, Stepping: 6)<br>
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1<br>
Compiled with runtime CPU detection.<br>
-faaco is not an MEncoder option<br>
Exiting... (error parsing command line)<br>
<br>
THanks.<br>
</tt>
</body>
</html>