readline syntax error

Fairlight fairlite at fairlite.com
Wed May 7 12:22:51 PDT 2008


>From inside the gravity well of a singularity, GCC Consulting shouted:
> Found the problem.  The answer is interesting.
>
> Reason is ab was left uncast.  When I changed ab(1024,*) the syntax error
> disappeared.

And here's why:

4.5  READLINE           Read a line of text from a file.

      Syntax:

           aa = READLINE(handle,destination,length)
           aa = READLINE(handle,destination)

        Where handle is the file handle returned by OPEN() or
        CREATE(), destination is the field to store the
        information, and length is the maximum number of bytes
        to read.  If length is not specified, the length of the
        destination field is used.

Since you didn't include a length argument, it tried to fall back on the
field length--which didn't exist because it was uncast.  It would have
worked had you specified the third argument rather than cast it.  Either/or
fixes it.  I use it on uncast vars all the time.

mark->


More information about the Filepro-list mailing list