Re: Does 'seek' have to used with 'if'.....

new topic     » goto parent     » topic index » view thread      » older message » newer message

John F Dutcher wrote:

> Here's a brief code sample that fails on the first occurence of the 'seek'
> attempt with this message:
>
> Syntax error:
> ... "expected possibly to see 'end', not a function"
>       'seek(fn, tobyte)'
>
> }}}
<eucode>

<snip>

>    if fn < 1 then
>   	puts(1, "Unable to open the disk file\n")
>         abort(fn)
>    else
>      tobyte = 0
>      seek (fn, tobyte)

<snip>

> </eucode>
{{{


seek() is a function, so it must not be called like a procedure.
You can use the return value of a function like in
   print(1, seek(fn,tobyte))
   x = seek(fn,tobyte)

Of course, you also can write e.g.
   if seek(fn,tobyte) != 0 then
      puts(1, "Error!")
   end if

Regards,
   Juergen

-- 
A: Because it considerably reduces the readability of the text.
Q: Why?
A: Top posting.
Q: What is annoying in e-mail and news?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu