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

LB Audio lbaudio at ...172...
Fri Oct 29 21:38:34 CEST 2004


OK...OK...

'Simple Code Problem
 
' Gambas class file

PUBLIC SUB Process_Read()  
  DIM sLine AS String  
  LINE INPUT #LAST, sLine
  txt01.Text = sLine
END
 
PUBLIC SUB Button1_Click()  
  EXEC [ "ls", "-la" ] FOR READ 'Yes - Return String in Process
  'EXEC [ "mplayer","file.mp3" ] FOR READ  'Yes - Return String in Process
  'EXEC [ "mpg321","-v","file.mp3" ] FOR READ  'No - Return String in
Process
  'EXEC [ "mpg123","-v","file.mp3" ] FOR READ  'No - Return String in
Process
  'Please I use mpg123 command
END


 
 
-------Original Message-------
 
From: gambas-user at lists.sourceforge.net
Date: 29/10/2004 17:51:47
To: gambas-user at lists.sourceforge.net
Subject: Re: [Gambas-user] Read in EXEC..... to Rob
 
On Friday 29 October 2004 11:43, LB Audio wrote:
> Message error in Gambas: Error -> End OF File
 
Not too surprising, see below...
 
> PUBLIC SUB Process_Read()
....
>   READ #LAST, sData, -255
 
OK, so you've read up to 255 characters from the process.
 
>       LINE INPUT #$hprocess, l ->>>>>>>>>>>>>>>>>>>>>>> Error
 
Now you're trying to read from the process again!  Unless it
returned more than 255 characters you are going to get an error.
 
I suggest you remove that READ line, or put it in the ELSE block
of the IF LAST.Id... statement.
 
Rob
 
 
 
 
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20041029/6e4151e1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BackGrnd.jpg
Type: image/jpeg
Size: 1431 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20041029/6e4151e1/attachment.jpg>


More information about the User mailing list