Max. literal string length

Just starting out? Need help? Post your questions and find answers here.
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Max. literal string length

Post by kpeters58 »

Purebasic just handed me a message saying that "A literal string can't be bigger than 8192 characters".

Is there a way to increase this limit or do I need to handle my long string in chunks?
PB 5.73 on Windows 10 & OS X High Sierra
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Max. literal string length

Post by RSBasic »

The length is not limited. This restriction is only in the PB editor.
You can write like this:

Code: Select all

MyString$ = "...8000 characters..."
MyString$ + "...other characters..."
Image
Image
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Max. literal string length

Post by wilbert »

kpeters58 wrote:Purebasic just handed me a message saying that "A literal string can't be bigger than 8192 characters".

Is there a way to increase this limit or do I need to handle my long string in chunks?
For such a long string, you might consider to include it in the DataSection using IncludeBinary and use PeekS to assign it to a string variable.
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply