Page 1 of 1

Number of characters limited in scripts?

Posted: 12 Feb 2013 01:22
by alexbausw
Hello all,

I have the problem, that i could not enter more than about 4015 characters (incl. space and tab) in the editors script window. Is this a limitation in Lemur 4 itself or in the editor for windows 7?

best regards
Alex

Re: Number of characters limited in scripts?

Posted: 12 Feb 2013 06:42
by Macciza
Hi
Pretty sure the official limit for scripts is 4096, see Changelog in manual, so yes . . .
Time to refactor / encapsulate some of it I think . . .

Cheers
MM

Re: Number of characters limited in scripts?

Posted: 13 Feb 2013 08:30
by alexbausw
Hello Macciza

Thank you for your answer.
So a workaround could be to split code into two scripts and call the second from the first one. :)

greetings
Alex

Re: Number of characters limited in scripts?

Posted: 13 Feb 2013 11:27
by Macciza
Yes

Look for sections of code that are repeated in different places and move them to a separate script that gets called and fed the necessary parameters . . .
Think more object-oriented / classes etc separating responsibility for different things etc

What are you doing that requires such a large monolithic script?

MM

Re: Number of characters limited in scripts?

Posted: 15 Feb 2013 02:31
by Traxus
alexbausw wrote:Hello Macciza

Thank you for your answer.
So a workaround could be to split code into two scripts and call the second from the first one. :)

greetings
Alex
Yes, that would work, but every time you say that, god makes a programmer commit suicide. Please think of the other programmers!

You'll do yourself a much bigger favor by taking Macciza's advice and looking for duplicate blocks of code, and breaking them out into functions and so forth.