[Gambas-user] Errotr message " Illegal seek"

Mr. Robert the.at.robert at ...626...
Mon May 4 18:54:04 CEST 2009


Firstly, a Line # of where the error occurred would help, but i'm guessing
its where it tries to READ.
 I'm no expert unfortunately, but a quick 'guess' response would be that
when using READ with streams, the position is incremented by 1, so when you
try to read again, you are not reading from the start, but rather the next
byte after your previous read, which seems to be unavailable. I'm not sure
if Gambas has a SEEK function, but if it does, you need to use it to "reset"
your position in the file to 0 (or 1 depending, probably 0).

On Sun, May 3, 2009 at 2:10 PM, frenchpark43 <tinker43 at ...626...> wrote:

>
> When I execute the code below , it works fine for the first "Single" button
> push. But on the second push
> I get an error message " System error. Illegal seek". Any ideas ?
>
> PUBLIC SUB Single_Click()
>  DIM i AS Integer
>  DIM dump AS Byte
>  DIM data AS Byte
>  ' DIM data AS String
>  PRINT "Test"
>  PRINT #hfile "S"                ' Send S to start sweep
>     FOR i = 0 TO points - 1
>     READ #hfile, data, points
>     buffer[i] = data
>     NEXT
>   draw_chart(buffer, points)
> END
> --
> View this message in context:
> http://www.nabble.com/Errotr-message-%22-Illegal-seek%22-tp23359909p23359909.html
> Sent from the gambas-user mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list