Forum > Beginners

What's Wrong with this?(Solved)

(1/1)

JLWest:
I get an error on line 12. Don't see it;
Help please



--- 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";}};} ---type  procedure ErrorTList(Tag1, Msg: String); implementation     procedure TForm1.ErrorTList(Tag1, Msg: String); Var i: Integer=0;  Conbined: String;  begin   Conbined:= Tag1 + ' ' + MSG;   EList.Add(Combined);   //<=  unit1.pas(2643,4) Error: Identifier not found "EList"  Inc(i);  end; initializationEList := TStringList.create; finalizationEList.free;end.    
I needed something Global Var

Josh:
Hi

Sorry but cant test non compileable code...
what error if any are you getting?


--- 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";}};} ---procedure TForm1.ErrorTList(Tag1, Msg: String);Var i: Integer=0;   Conbined: String;begin  Conbined:= Tag1 + ' ' + MSG;  EList.Add(Combined);   //<=  unit1.pas(2643,4) Error: Identifier not found "EList"  Inc(i);end;
EList.Add(Combined); maybe mispelt as string is defined as Conbined

var i is not global but local to the procedure, so no idea why its used and what you are expecting?

wildfire:

--- Quote from: Josh on July 30, 2022, 12:54:56 am ---Hi

Sorry but cant test non compileable code...
what error if any are you getting?

--- End quote ---

OP has referenced it as a comment in the source.


--- Quote ---
--- 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";}};} ---procedure TForm1.ErrorTList(Tag1, Msg: String);Var i: Integer=0;   Conbined: String;begin  Conbined:= Tag1 + ' ' + MSG;  EList.Add(Combined);   //<=  unit1.pas(2643,4) Error: Identifier not found "EList"  Inc(i);end;
cant see a problem with code...

--- End quote ---

EList not being declared appears to have been the problem and JLWest appears to have acknowledged it, hence marked solved.

JLWest:
@Wildfile - Correct

Navigation

[0] Message Index

Go to full version