[Gambas-user] hProcess is NULL

Ian Haywood ihaywood at ...1979...
Mon Dec 27 10:21:11 CET 2010


On Mon, Dec 27, 2010 at 8:11 PM, Demosthenes Koptsis
<demosthenesk at ...626...> wrote:
> On Mon, 2010-12-27 at 10:20 +1100, Ian Haywood wrote:
>> On Mon, Dec 27, 2010 at 4:46 AM, Demosthenes Koptsis
>> <demosthenesk at ...626...> wrote:
>> > Hello and merry Christmas,
>> >
>> > i have these lines of code
>> >
>> > -----------
>> >  sCommand = "/opt/avast4workstation-1.3.0/bin/avast -r " &
>> > txtVirusTempFolder.Text & "/avast-report.txt" & " -ac -t A " &
>> > txtVirusTempFolder.Text
>> >
>> >  PRINT sCommand
>> >
>> >  hProcess1 = SHELL sCommand WAIT FOR INPUT OUTPUT AS "AntiVirRun"
>> > -----------
>> >
>> > After that line the hProcess1 is NULL and i get NULL object in
>> >
>> > PUBLIC SUB AntiVirRun_Read()
>> Drop the "WAIT" keyword.
>
> Actually i want the WAIT word.
>
> I want to WAIT until the command is finished but in meanwhile i want to
> be capable to read the stdout.
Use Shell...To as I described.
Or read output and then when you are finished reading use hProcess.Wait()

But you can't wait and read at the same time.

Ian




More information about the User mailing list