Using strings larger than 64K

Share your advanced PureBasic knowledge/code with the community.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: Using strings larger than 64K

Post by GPI »

PB wrote:> I have never problem with the size of the string-buffer

If you ever use the GetClipboardText command, you run the risk of your
app crashing if the clipboard holds >64K.
This is a bug in GetClipboardText().
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Using strings larger than 64K

Post by PB »

> This is a bug in GetClipboardText().

Are you sure? The command works fine with all strings <64K, so I just
assumed it was overflowing when longer strings were used. What about
ReadString (for long lines in files) ? I can't check it at the moment, but
I seem to remember it crashing with long lines...
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: Using strings larger than 64K

Post by GPI »

>Are you sure? The command works fine with all strings <64K,

When a string is limited to 64000 (not 64K!), the commands should check, if the string is longer than 64k. But the don't do this.

-> Bug.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Using strings larger than 64K

Post by PB »

> the commands should check, if the string is longer than 64k

Oops, I understand -- I've even reported this as a bug in the past too!
I thought you meant it was some other type of bug. :oops:
Opcode
Enthusiast
Enthusiast
Posts: 138
Joined: Thu Jul 18, 2013 4:58 am

Re: Using strings larger than 64K

Post by Opcode »

According to PureBasic v4.00 documentation.
Added: Unlimited length strings in both ascii and unicode mode
So this is kinda pointless to update to 5.20 I think? :oops:
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Using strings larger than 64K

Post by Little John »

Opcode wrote:According to PureBasic v4.00 documentation.
Added: Unlimited length strings in both ascii and unicode mode
So this is kinda pointless to update to 5.20 I think? :oops:
We have a museum for old PB versions.
Perhaps we could/should also have a museum for old Tips and Tricks? :-)
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Re: Using strings larger than 64K

Post by sec »

Opcode wrote:According to PureBasic v4.00 documentation.
Added: Unlimited length strings in both ascii and unicode mode
So this is kinda pointless to update to 5.20 I think? :oops:
The topic is updated :D

Thanks,
Opcode
Enthusiast
Enthusiast
Posts: 138
Joined: Thu Jul 18, 2013 4:58 am

Re: Using strings larger than 64K

Post by Opcode »

Little John wrote:
Opcode wrote:According to PureBasic v4.00 documentation.
Added: Unlimited length strings in both ascii and unicode mode
So this is kinda pointless to update to 5.20 I think? :oops:
We have a museum for old PB versions.
Perhaps we could/should also have a museum for old Tips and Tricks? :-)
Every Tip and Trick thread is being updated by a select few people for PB 5.20. It seems older versions of PureBasic will have no support what so ever. As all of these threads being updated erases their compatibility with older versions. :|
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Using strings larger than 64K

Post by Fred »

Opcode wrote:
Little John wrote:
Opcode wrote:According to PureBasic v4.00 documentation.
Added: Unlimited length strings in both ascii and unicode mode
So this is kinda pointless to update to 5.20 I think? :oops:
We have a museum for old PB versions.
Perhaps we could/should also have a museum for old Tips and Tricks? :-)
Every Tip and Trick thread is being updated by a select few people for PB 5.20. It seems older versions of PureBasic will have no support what so ever. As all of these threads being updated erases their compatibility with older versions. :|
That's unbelievable, you can do what ever you want, there is always someone who has to complain any changes we do. Do you really use old versions or do you complain for the sake of complaining ? That's really boring, especially when a lot of work is done to makes things better for most of you.
Opcode
Enthusiast
Enthusiast
Posts: 138
Joined: Thu Jul 18, 2013 4:58 am

Re: Using strings larger than 64K

Post by Opcode »

Fred wrote:
Opcode wrote:
Little John wrote:
Opcode wrote:According to PureBasic v4.00 documentation.
Added: Unlimited length strings in both ascii and unicode mode
So this is kinda pointless to update to 5.20 I think? :oops:
We have a museum for old PB versions.
Perhaps we could/should also have a museum for old Tips and Tricks? :-)
Every Tip and Trick thread is being updated by a select few people for PB 5.20. It seems older versions of PureBasic will have no support what so ever. As all of these threads being updated erases their compatibility with older versions. :|
That's unbelievable, you can do what ever you want, there is always someone who has to complain any changes we do. Do you really use old versions or do you complain for the sake of complaining ? That's really boring, especially when a lot of work is done to makes things better for most of you.
No ones complaining Fred, I think maybe your english isn't that great and you're not understanding me. I am only stating that all previous versions for legacy reasons will have no support at all once these threads are updated. Do I care about them being updated? No. I rather have the latest version of everything. I was merely suggesting that this thread should possibly be deleted? because PureBasic already supports strings in unlimited lengths. Why update old code to get around a limit that PureBasic doesn't have?
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Using strings larger than 64K

Post by Fred »

I do understand english, thank you. And when you write "As all of these threads being updated erases their compatibility with older versions. :|"

it means "man, you're erasing old info which seems very important to me". I won't discuss this further with you, locked.
Locked