Re: just for fun: pop quiz
Jerry Jensen jhj@... writes: On 2/3/13 3:08 PM, Mark Wieder wrote: Yeah, interesting point. I'm not sure what EOF means in that case either. Is that I received an EOF char from the port? I don't think EOF is meaningful with a serial driver. The closest character is Ctrl-D, EOT, end of transmission. Thanks. Yes, I meant EOT. If EOF for a file stream means you've gotten to the end then possibly EOF for a serial stream could mean you've received an EOT char. -- Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
I had a vague memory of this and checked in an old script and found the following: read from file laFile[pUrl] for 4096 if the result empty and the result eof then ... Dave On 3 Feb 2013, at 00:36, Richard Gaskin ambassa...@fourthworld.com wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
I think one of my guesses would have actually made more sense. Have the result return the number of characters read. That way you could check for zero in the result, and if not, you have the size of your chunk ready to go. But EOF in the result is surprising. It's hard to imagine the developer logic that drove them to this conclusion. Bob On Feb 3, 2013, at 11:08 AM, Richard Gaskin wrote: Jerry Jensen wrote: On 03/02/2013, at 11:36 AM, Richard Gaskin wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath On 03/02/2013, at 11:38 AM, Monte Goulding wrote: empty? On Feb 2, 2013, at 4:39 PM, Monte Goulding wrote: :-( Me too. ;-( Curious, isn't it? In my informal survey among people I've talked with the results were the same as here, with nearly everyone guessing that a read command which executes without error would have empty in the result. Instead, in the case of using specifically ...until EOF or ...until end, the result contains eof. This turns out to be documented (down in the fine print toward the bottom of the Dictionary entry for read from file, but not above in the section that describes what EOF does), yet it's such a departure from the rest of the language that I was tempted to flag it as a bug. It's been around so long that they're not likely to change it, so I won't be littering the RQCC with yet another unactionable request. Still, does seem odd. Can you think of a circumstance in which you've already specified to read until EOF, and the command executes flawlessly just as you've asked it to, yet you still need to be notified that it reached EOF? -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
I ran into this a few weeks ago when I was having problems reading a file. Turned out it was because I should have been doing a binary read, but seeing EOF in the result made me think I'd run into some sort of error like an unexpected EOF or something - wasted a couple of hours trying to track that down. On Sun, Feb 3, 2013 at 11:08 AM, Richard Gaskin ambassa...@fourthworld.comwrote: It's been around so long that they're not likely to change it, so I won't be littering the RQCC with yet another unactionable request. Still, does seem odd. Can you think of a circumstance in which you've already specified to read until EOF, and the command executes flawlessly just as you've asked it to, yet you still need to be notified that it reached EOF? Pete lcSQL Software http://www.lcsql.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
Once again, Jacque puts the kibosh on our it's a bug! session by injecting facts! sigh You can't have any fun around here anymore. ;-) Bob On Feb 3, 2013, at 12:40 PM, J. Landman Gay wrote: On 2/3/13 1:08 PM, Richard Gaskin wrote: Can you think of a circumstance in which you've already specified to read until EOF, and the command executes flawlessly just as you've asked it to, yet you still need to be notified that it reached EOF? The read from file command is a subset of the generic read command which also includes reading from sockets and drivers (and by extension, reading from servers.) They all have the same syntax, and in the MC dictionary there's only one listing for them all. Because they are the same command internally, they all share the same values in the result. In the case of sockets and drivers it is possible to read without error but not receive all the data due to communication issues. In that case you'd want to know if the read had paused or had really finished. -- Jacqueline Landman Gay ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
Jacque- Sunday, February 3, 2013, 12:40:43 PM, you wrote: In the case of sockets and drivers it is possible to read without error but not receive all the data due to communication issues. In that case you'd want to know if the read had paused or had really finished. I was about to post the same, but then Bob would be on my case instead g, so I'm glad you beat me to it. I'd be happier if the read command had been written to return the number of characters read, in which case 0 or -1 would be an error, but we're stuck with what we've got. -- -Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
On 2/3/13 3:08 PM, Mark Wieder wrote: Jacque- Sunday, February 3, 2013, 12:40:43 PM, you wrote: In the case of sockets and drivers it is possible to read without error but not receive all the data due to communication issues. In that case you'd want to know if the read had paused or had really finished. I was about to post the same, but then Bob would be on my case instead g, so I'm glad you beat me to it. I'd be happier if the read command had been written to return the number of characters read, in which case 0 or -1 would be an error, but we're stuck with what we've got. If you're reading a serial port, you don't always know how many characters to expect. I'm not sure if that's still the same thing though. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
Jacque- Sunday, February 3, 2013, 1:51:24 PM, you wrote: On 2/3/13 3:08 PM, Mark Wieder wrote: Jacque- Sunday, February 3, 2013, 12:40:43 PM, you wrote: In the case of sockets and drivers it is possible to read without error but not receive all the data due to communication issues. In that case you'd want to know if the read had paused or had really finished. I was about to post the same, but then Bob would be on my case instead g, so I'm glad you beat me to it. I'd be happier if the read command had been written to return the number of characters read, in which case 0 or -1 would be an error, but we're stuck with what we've got. If you're reading a serial port, you don't always know how many characters to expect. I'm not sure if that's still the same thing though. Yeah, interesting point. I'm not sure what EOF means in that case either. Is that I received an EOF char from the port? -- -Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
On Feb 3, 2013, at 2:49 PM, Mark Wieder mwie...@ahsoftware.net wrote: Jacque- Sunday, February 3, 2013, 1:51:24 PM, you wrote: On 2/3/13 3:08 PM, Mark Wieder wrote: Jacque- Sunday, February 3, 2013, 12:40:43 PM, you wrote: In the case of sockets and drivers it is possible to read without error but not receive all the data due to communication issues. In that case you'd want to know if the read had paused or had really finished. I was about to post the same, but then Bob would be on my case instead g, so I'm glad you beat me to it. I'd be happier if the read command had been written to return the number of characters read, in which case 0 or -1 would be an error, but we're stuck with what we've got. If you're reading a serial port, you don't always know how many characters to expect. I'm not sure if that's still the same thing though. Yeah, interesting point. I'm not sure what EOF means in that case either. Is that I received an EOF char from the port? I don't think EOF is meaningful with a serial driver. The closest character is Ctrl-D, EOT, end of transmission. I've always had to use read from driver tPort until empty in tTimeout milliseconds and put that in a timed repeating loop, buffering until a real return char comes in. .Jerry ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
just for fun: pop quiz
Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
empty? On 03/02/2013, at 11:36 AM, Richard Gaskin ambassa...@fourthworld.com wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
:-( On 03/02/2013, at 11:38 AM, Monte Goulding mo...@sweattechnologies.com wrote: empty? On 03/02/2013, at 11:36 AM, Richard Gaskin ambassa...@fourthworld.com wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
Me too. empty? .Jerry On Feb 2, 2013, at 4:38 PM, Monte Goulding mo...@sweattechnologies.com wrote: empty? On 03/02/2013, at 11:36 AM, Richard Gaskin ambassa...@fourthworld.com wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
Me too. ;-( On Feb 2, 2013, at 4:39 PM, Monte Goulding mo...@sweattechnologies.com wrote: :-( On 03/02/2013, at 11:38 AM, Monte Goulding mo...@sweattechnologies.com wrote: empty? On 03/02/2013, at 11:36 AM, Richard Gaskin ambassa...@fourthworld.com wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
EOF -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com We have time for new software development projects. Contact me for a quote. On 14 January, we suffered severe server problems. If you tried to send an e-mail between 13 and 18 January and didn't get a reply, please try again. On 2/3/2013 01:36, Richard Gaskin wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
empty On Feb 2, 2013, at 4:36 PM, Richard Gaskin wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: just for fun: pop quiz
Wait... the number of characters read? On Feb 2, 2013, at 4:36 PM, Richard Gaskin wrote: Without looking in the Dictionary, what would you expect the value of tResult to be after successful execution of: open file tValidFilePath for read read from file tValidFilePath until EOF put the result into tResult close file tValidFilePath ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode