[Implemented] Reading strings until reaching a size of bytes

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Sunny
User
User
Posts: 16
Joined: Wed Feb 04, 2004 7:46 pm
Location: Germany | Hannover

[Implemented] Reading strings until reaching a size of bytes

Post by Sunny »

Hello,

I got an idea for a better handling with the file-system. What is about reading a string until a size of bytes is reached? Is that possible?
Like that:

Code: Select all

ReadString([size_in_byte])
So it is not necessary to got a "end of line"- sign and many strings could be in one line without seperate them, but could be read seperated and correctly with the size-parameter. Then it would stop reading at reaching the size of bytes in the optional parameter.

So, that is what I'd like to have in in the future for better handling with strings.

mfg.

Sunny
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Sounds like you've just described ReadData.
Syntax

Length = ReadData(*MemoryBuffer, LengthToRead)
Description

Read the content of the current file inside the specified memory buffer. 'LengthToRead' hold the number of chars to read.

After executing the command the 'Length' variable will hold the number of really read chars. Useful for validating purposes.
@}--`--,-- A rose by any other name ..
Sunny
User
User
Posts: 16
Joined: Wed Feb 04, 2004 7:46 pm
Location: Germany | Hannover

Post by Sunny »

Oh, sorry, I've never seen that command, so never used... 8O
But better already included than in to-do-list. :wink:
Post Reply