[Gambas-user] Read in EXEC..... to Rob

Ron Onstenk ronstk at ...239...
Fri Oct 29 20:36:38 CEST 2004


On Friday 29 October 2004 17:43, LB Audio wrote:
> Hello Rob
> 
> ERROR
> 
> Message error in Gambas: Error -> End OF File
> 
> PUBLIC SUB Process_Read()  
>   DIM sData AS String  
>   DIM l AS String
>   DIM t AS String
>   
>   READ #LAST, sData, -255
>    
>   IF LAST.Id = $hprocess.Id THEN
>       LINE INPUT #$hprocess, l ->>>>>>>>>>>>>>>>>>>>>>> Error
>       IF Instr(l, "Time: ") THEN
>          t = Mid(l, Instr(l, "Time: ") + 6, 8)
>          ' do something with t now...
>          label1.Caption = t
>       ENDIF
>   ENDIF
>      
> END 

What are you try to do with
>   READ #LAST, sData, -255

If it works the possibility is that it read the whole $hprocess data
and nothing available for the LINE INPUT.

And as the message tells  'End OF File' it does just that.

The object LAST is the one that invokes the event.
The event is Process_Read and does for all declared process handles.
In this way Process_Read is a common event entry for 1 till n of them
and you must use the Last.ID to determine what the actions are for it.
 
If you have more declared Process handles it should be done 
the same way as de $hprocess.id logic for the mpg321

PUBLIC SUB Process_Read()  
   IF LAST.Id = $hprocess.Id THEN
      bla bla mpg321
   ENDIF

   IF LAST.Id = $hprocessother.Id THEN
      READ #LAST, sData, -255
   ENDIF
END

Suc6




More information about the User mailing list