Forum > Beginners

Examples from fpc.org, first time compile, graph mode

<< < (2/3) > >>

Bart:

--- Quote from: PascalDragon on October 21, 2021, 09:45:41 pm ---Turbo Pascal doesn't seem to have a problem when the index variable of the for is changed, but FPC does.

--- End quote ---
Adding {$mode TP} does however allow this.
This will also make integer=smallint, so that error goes away too.

I also get a RTE, but on a different line:
C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
Runtime error 216 at $770AF583
  $770AF583
  $770900EA
  $7708FF39
  $00412506
  $00401A31  WRITERES,  line 26 of test.pas
  $00401DE8  main,  line 75 of test.pas
  $004097E7

Line 25+26 are:

--- 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";}};} ---  outTextXY((getMaxX - TW) div 2,            (getMaxY - TH) div 2,text);
Even if I change all parameters of outTextXY to fixed safe values (e.g. outTextXY(1,1,'dummy')) or replace outTextXY with outText it will crash.

Bart

Bart:
It crashes when testing
4 bit: low modenr = 1, high modenr = 7
  testing mode nr 1
gd = 13
and it tries to do
outTextXY(179,95, 'Current resolution is 640x200x4 bit');

When I assign outTextXY to a dummy procedure the RTE goes away.

Bart

Bart:
Since I built fpc trunk with debug info I got a potentially better output:

--- Code: ---Runtime error 216 at $770AF583
  $770AF583
  $770900EA
  $7708FF39
  $0041071A  OUTTEXTXYWIN32GUI,  line 364 of ./graph/src/win32/graph.pp
  $00401BC4  WRITERES,  line 40 of test.pas
  $0040244E  main,  line 104 of test.pas
  $00409B77  EXE_ENTRY,  line 171 of system.pp
--- End code ---

Line 364 of ./graph/src/win32/graph.pp reads:
EnterCriticalSection(graphdrawing);

Bart

marcov:

--- Quote from: BobDog on October 23, 2021, 05:57:45 pm ---The graph unit seems a bit restrictive, I cannot retrieve the mouse position and I have to use readkey from wincrt.

--- End quote ---

The fpctris unit does iirc.

PascalDragon:

--- Quote from: Bart on October 23, 2021, 06:46:30 pm ---
--- Quote from: PascalDragon on October 21, 2021, 09:45:41 pm ---Turbo Pascal doesn't seem to have a problem when the index variable of the for is changed, but FPC does.

--- End quote ---
Adding {$mode TP} does however allow this.
This will also make integer=smallint, so that error goes away too.
--- End quote ---

I know that using mode TP solves the problem, but that's not the point: the example should work as is. Also it has no mode declaration thus the mode is FPC and there Integer = SmallInt as well.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version