[Gambas-user] Dedicated process read subroutines in Gambas 1.0.17

easuter easuter at ...626...
Sat May 26 15:11:14 CEST 2007


Hi there!

I'm having some trouble making a Process_Read event read only from a certain
process in Gambas 1.0.17.
In Gambas2 1.9.49 for example, I would use this kind of code to read data
from each process separately:

-----Snip------

PUBLIC $hProc1 AS Process
PUBLIC $hProc2 AS Process

PUBLIC SUB Command1Btn_Click()

    EXEC ["command1", "flags"] FOR READ AS $hProc1

END

PUBLIC SUB Command2Btn_Click()

   EXEC ["command2", "flags"] FOR READ AS $hProc2

END

PUBLIC SUB $hProc1_Read()

    DIM sLine as String
    
    PRINT "Reading output from Command1..."

    LINE INPUT #$hProc1, sLine
    PRINT sLine

END

PUBLIC SUB $hProc2_Read()

    DIM sLine as String
   
    PRINT "Reading output from Command2..."

    LINE INPUT #$hProc2, sLine
    PRINT sLine

END

----Snip----



But in Gambas 1.0.17 this doesn't work.
The only way I can get the sub to read from the process stream is if I
delete both the $hProc1_Read and $hProc2_Read subs and put only a
Process_Read sub:



----Snip----

PUBLIC $hProc1 AS Process
PUBLIC $hProc2 AS Process

PUBLIC SUB Command1Btn_Click()

    EXEC ["command1", "flags"] FOR READ AS $hProc1

END

PUBLIC SUB Command2Btn_Click()

   EXEC ["command2", "flags"] FOR READ AS $hProc2

END

PUBLIC SUB Process_Read()
    
    DIM sLine AS String
    

    PRINT "Reading output from <don't know which command!!!!>"

    LINE INPUT #LAST, sLine
    
    PRINT sLine

END
----Snip----



I need to have a sub that reads the data from only one designated process,
not all the the process that may be executed.

Do I need to make a module dedicated to each command?
How can I do this in the simplest manner?

Thanks in advance!

Cheers,

Eugéne
-- 
View this message in context: http://www.nabble.com/Dedicated-process-read-subroutines-in-Gambas-1.0.17-tf3820506.html#a10816247
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list