OK, so this divergence of the implementation from the spec is now
implemented for normal files in svn and will be supported in future
binaries builds.  In the meantime, is anyone clever enough to write a
library module version of open() that implements Jafar's solution at the
Unicon level?

reads(... -1) was originally introduced in the messaging facilities (mode
"m" only feature) and when the book was being written it was decided to
implement for regular files as well. But no one ever volunteered before
now. There are no current plans to support reads(... -1) for sockets,
windows, etc.

Kim, thanks for the prod!

Cheers,
Clint

On Tue, Jul 17, 2012 at 12:08 AM, Kim Bastin <[email protected]> wrote:

> The book says (page 304):
>
> reads(file:&input, integer:1): string?
> reads(f,i) reads up to i characters from file f. ... If i is -1, reads()
> reads and produces the entire file as a string. ...
>
> I have written:
>
> 55:     kf := open(fn, "ru") | stop(ErrorMsg[2])
> 56:     line := reads(kf, -1)
> 57:     close(kf)
>
> I get:
>
> Run-time error 205
> File fixdll.icn; Line 56
> invalid value
> offending value: -1
> Traceback:
>     main(list_1 = ["KBDUSKCB.dll","0274.2074","0275.2075","0277.2077"])
>     reads(file(KBDUSKCB.DLL),-1) from line 56 in fixdll.icn
>
> I’m running Unicon version 11.9 on WinXP SP3.
>
> Run-time error 205 is defined as ‘invalid value’.
>
> Is the -1 parameter to reads() not supported?
>
> Thanks for help!
>
> Kim
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Unicon-group mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/unicon-group
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to