GithubHelp home page GithubHelp logo

Comments (3)

jMarcS avatar jMarcS commented on July 3, 2024

Instead of "length string" it should be "string length", or "length of the string in the buffer variable".

Except for that, I'm not offering suggestions, only explanations. The original wording may not be precise, but it is certainly concise. There's a lot of information in there, and there's a lot of latitude in deciding how much to write.

There's a logical leap from the abstract "<buffer_svar>" to the concrete example "buf$". You're resolved it by referring to the string length function len() by name without an argument, which is a common practice but still requires the reader to make a logical connection, and without benefit of the telltale '$'.

There's another leap that takes longer to explain, but it's still logical. If you're reading data and you reach the end of the file, the buffer contains the data you read, so its length is not zero. If after reaching the end of the file you read it again, you don't get an error, and you don't get a special EOF indicator. You get an empty (zero-length) buffer. The only way to know you've read the entire file is to read it again until you get a zero-length string -- that is, until len(<buffer_svar>) returns 0. This may be counter-intuitive to a C programmer, or somebody who uses sockets a lot instead of files.

Finally, there is no mention of what happens if <count_nexp> is bigger than the file. Is that a sin of omission, or does leaving it out imply that BASIC! does the intuitively obvious "right thing"? Okay, that's reaching a little!

from de-re-basic.

mrleavitt avatar mrleavitt commented on July 3, 2024

Good points. Changed "length string" to "string length" (how'd I miss that?). Put in the parameter arguments explicitly instead of buf$. I'm passing on the fourth and fifth paragraphs as they move the text too far (IMHO) in the direction of a "how to" manual, as opposed to a reference manual. I'm certainly open to revisit this if anyone thinks I should.

from de-re-basic.

jMarcS avatar jMarcS commented on July 3, 2024

I think you got it right.

from de-re-basic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.