Avoid literal string 8192 limit

Just starting out? Need help? Post your questions and find answers here.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Avoid literal string 8192 limit

Post by minimy »

We can now have a literal string larger than 8192 characters. The example shows one from 24576.
I was looking in the forum and didn't see any solution.

Code: Select all

; Test how to avoid the 8192 character limit in literal string in the editor
; mytext="8192 characters is maximun here"

; Follow the instructions

;------ PART 1
; Run part 1 and copy debbuger output text
dummy8192.s
For n=1 To 8192
  dummy8192+Chr(Random(96,40))
Next n
Debug dummy8192
End


;------ PART 2
; Now comment part 1 and paste the text in de a(n)
Dim a.s(2)
a(0)= "Paste copied text here"
a(1)= "Paste copied text here"
a(2)= "Paste copied text here"

a$= a(0)+a(1)+a(2)
freeArray(a())
; Now the size of the literal string is 24576 
Debug Len(a$)
If translation=Error: reply="Sorry, Im Spanish": Endif
Quin
Addict
Addict
Posts: 1155
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Avoid literal string 8192 limit

Post by Quin »

Neat trick! Thanks for sharing 8)
Reminds me why I love this place
User avatar
useful
Enthusiast
Enthusiast
Posts: 404
Joined: Fri Jul 19, 2013 7:36 am

Re: Avoid literal string 8192 limit

Post by useful »

Define SS.s = Space(1000000)
SS = SS + "_"
Debug Mid(SS,1000001,1)
Dawn will come inevitably.
pjay
Enthusiast
Enthusiast
Posts: 281
Joined: Thu Mar 30, 2006 11:14 am

Re: Avoid literal string 8192 limit

Post by pjay »

minimy wrote: Thu Oct 30, 2025 1:40 am We can now have a literal string larger than 8192 characters. The example shows one from 24576.
Not quite; You are concatenating literal strings here & the concatenated string is no longer a 'literal string' by definition.
BarryG
Addict
Addict
Posts: 4239
Joined: Thu Apr 18, 2019 8:17 am

Re: Avoid literal string 8192 limit

Post by BarryG »

pjay wrote: Thu Oct 30, 2025 10:42 amNot quite; You are concatenating literal strings here & the concatenated string is no longer a 'literal string' by definition.
Correct. There's no literal strings shown above anywhere (even with pasting). Part 2 in the first example is just 3 lines of separate 8192-sized literal texts. It's not bypassing any limit.

The Space() example isn't literal text, either.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Avoid literal string 8192 limit

Post by minimy »

pjay wrote: Thu Oct 30, 2025 10:42 am Not quite; You are concatenating literal strings here & the concatenated string is no longer a 'literal string' by definition.
BarryG wrote: Thu Oct 30, 2025 11:32 am Correct. There's no literal strings shown above anywhere (even with pasting). Part 2 in the first example is just 3 lines of separate 8192-sized literal texts. It's not bypassing any limit.

The Space() example isn't literal text, either.
Yes, i know, but the result is can hack the ide to get a long string (concatenated) but work for me.
If you have better idea, post here please.
Thanks for comments.
If translation=Error: reply="Sorry, Im Spanish": Endif
BarryG
Addict
Addict
Posts: 4239
Joined: Thu Apr 18, 2019 8:17 am

Re: Avoid literal string 8192 limit

Post by BarryG »

minimy wrote: Thu Oct 30, 2025 12:28 pmIf you have better idea, post here please.
I don't need to, because you're 100% misunderstanding what a literal string is. I tried it with the IDE and still get the "too long" error when I try with >8192 characters. What you've posted is nothing to do with the limit and isn't a solution for it.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Avoid literal string 8192 limit

Post by minimy »

BarryG wrote: Thu Oct 30, 2025 1:31 pm
minimy wrote: Thu Oct 30, 2025 12:28 pmIf you have better idea, post here please.
I don't need to, because you're 100% misunderstanding what a literal string is. I tried it with the IDE and still get the "too long" error when I try with >8192 characters. What you've posted is nothing to do with the limit and isn't a solution for it.
Hello, doesn't it work? I have strings of more than 38000 in the IDE directly with this method.
This is what happens when brilliant minds do not provide solutions. The rest of us give them. :lol:
That it is poorly done? maybe so. I didn't know this was a competition. :lol:
No work for you, I don't know why. I some body can test and tell if work or not. In all my computers work.
Which is not really a 'literal chain'?, NO. You are right!
But it works for me and that's enough for me. And is a solution, not the right?. May be, but is a solution.
I just wanted to share it in case anyone needs it.
I think in these cases the intention is what counts... It is not necessary to let go of the dogs. :shock:

Although I can't suppress saying that I notice some negativity on your part. :mrgreen:
I invite you to publish a solution, not just a criticism. Ok,ok... you no need. :wink:
In any case, thanks for your comments. I appreciate them anyway because I am a happy grateful person. :mrgreen:
Sorry for my bad english too and have a nice day!
BarryG wrote: Thu Oct 30, 2025 11:32 am
pjay wrote: Thu Oct 30, 2025 10:42 amNot quite; You are concatenating literal strings here & the concatenated string is no longer a 'literal string' by definition.
Correct. There's no literal strings shown above anywhere (even with pasting). Part 2 in the first example is just 3 lines of separate 8192-sized literal texts. It's not bypassing any limit.

The Space() example isn't literal text, either.
Thank you pjay for your comments. I know, i know..., The most important thing i think is the result, A long string in the ide.
For now I'm just trying to escape from the dogs that have been released. Just kidding, don't be mad... :wink:

Tha.. Thats all folks!! :mrgreen:
If translation=Error: reply="Sorry, Im Spanish": Endif
Little John
Addict
Addict
Posts: 4810
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Avoid literal string 8192 limit

Post by Little John »

@minimy:

Sorry, but you are missing the point. As others already mentioned, obviously you don't understand what a literal string (or string literal) is:
  • E.g. "foo" is a literal string.
  • E.g. a$ or b$(0) (as an array element) are string variables.
  • E.g. Space(n) is a string function.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Avoid literal string 8192 limit

Post by minimy »

Thanks little John.
Im refer to the limit in the ide, i know my error was call literal string. :oops:
Thanks a lot for correction and examples.
Have a nice day! :D
If translation=Error: reply="Sorry, Im Spanish": Endif
Post Reply