String question?

About Monkey 2 Forums Monkey 2 Development String question?

This topic contains 4 replies, has 3 voices, and was last updated by  EdzUp 1 year, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11945

    EdzUp
    Participant

    Am I missing something I make a series of lines of text in notepad pressing enter after each line. Reading them into Monkey I get ALL the lines in one string.

    Surely ReadString, ReadCString and ReadSizedString shouldn’t read past #10 or #13?

    I’m wondering if I missed something when reading strings from a stream?

    #11946

    abakobo
    Participant

    Not sure what is your problem here but you can have a lot CR or LF or CRLF in a single string.

    Do you mean the string does not contain any ~n(LF #10) or ~r(CR #13) any more? i.e. when you print it, the line return are not there anymore? Do you mean “into Monkey I get ALL then lines in one line“?

    When I load a string with LoadString I then have to split it in lines to process it with some line per line logic.

    #11947

    EdzUp
    Participant

    ah I see I thought it was like MX1 and max etc where it read a line of characters and stopped at the end of line character. Thanks for the parsing code you put up and he information on it 🙂

    The #13’s are there but previous versions stopped at that point which is why I wondered if something was amiss.

    #11967

    TomToad
    Participant

    If you want to read one line at a time, you need to open a stream and use ReadLine() method

    #11968

    EdzUp
    Participant

    TomToad thanks for that 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.