Forum > General

Internal error 2011010304, a rare one

(1/3) > >>

Fibonacci:
I guess this one is a rare one


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$modeswitch arrayoperators} var  bools: array of boolean;  bool: boolean; begin  bools += [bool or bool]; // project1.lpr(8,26) Error: Internal error 2011010304end.

speter:
I don't have an answer, but I tweaked your code (to make sure everything was initialised); and still got the same error.

Not sure if that's helpful though. :)


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  bools : array of boolean = (false,true,false,false);  boola: boolean = false;  boolb: boolean = true;begin  bools += [boola or boolb];  . . .
I was trying to work out whether the problem was because you were comparing the same data...

I should also comment that I haven't encountered
 {$modeswitch arrayoperators}
before! It sounds cool though. :)

If i replace the "bools +="  line with:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  n := length(bools);  setlength(bools,n+1);  bools[n] := boola or boola;(where n:integer;)
It runs correctly.

cheers
S.

Fibonacci:
Another example, closer to what my code looked like when I first encountered this internal error.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$modeswitch arrayoperators} var  bools: array of boolean;  s: string; begin  bools := []; // init  bools += [(s <> '') and (s[1] = 'x')]; // project1.lpr(9,40) Error: Internal error 2011010304end.
Inserting a new value that is expression of 2 bools (or more) accessing variables or functions = internal error.

I created an issue on gitlab, and have feeling it will be fixed soon.

speter:
The manual (https://www.freepascal.org/docs-html/ref/refsu48.html) example for Dynamic array operators is:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var    a,b, c : array of byte;   begin    a:=[0,1,2];    b:=[3,4,5];    c:=a+b;
So your code (I tihnk) has 2 possible issues:
  + you aren't adding 2 dynamic arrays; and
  + you are using the short-cut syntax +=

Having said all that, I agree with you!
This is a strange response. :o

cheers
S.

speter:
Interestingly, this works fine:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  bools : array of boolean = (false,true,false,false);  boolb : array of boolean = ();  s : string = 'foo';begin  boolb := [s[1]='f'];  bools += bools + boolb;
EDIT: changing the last line to

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  bools += boolb;also worked fine!

cheers
S.

Navigation

[0] Message Index

[#] Next page

Go to full version