Recent

Author Topic: Pie - run error 201  (Read 5289 times)

Mando

  • Full Member
  • ***
  • Posts: 181
Pie - run error 201
« on: May 11, 2012, 02:05:06 pm »
Hi.

When i draw a pie with Pie(x1,y1,x2,y2,DegStar,DegRun),
I get Run error 201 with this values:


StarDeg16=0, LengthDeg16=0  (only in XP, works in w7)
StarDeg16=(Any), LengthDeg16>=270*16
StarDeg16>=270*16,  LengthDeg16=(Any)
StarDeg16<0,  LengthDeg16=(Any)

BGRABitmap v5.5




Any suggestion?


regards
« Last Edit: May 11, 2012, 05:17:57 pm by Mando »

Mando

  • Full Member
  • ***
  • Posts: 181
Re: Pie - run error 201
« Reply #1 on: May 14, 2012, 11:50:00 am »
Hi...

Nobody knows the answer.....


regards

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5795
    • wiki
Re: Pie - run error 201
« Reply #2 on: May 14, 2012, 01:18:30 pm »
http://www.freepascal.org/docs-html/user/userap4.html#x188-195000D

Quote
201 Range check error
    If you compiled your program with range checking on, then you can get this error in the following cases:

        An array was accessed with an index outside its declared range.
        Trying to assign a value to a variable outside its range (for instance an enumerated type).

To say more about your example, it needs more code + type declarations....


Mando

  • Full Member
  • ***
  • Posts: 181
Re: Pie - run error 201
« Reply #3 on: May 14, 2012, 02:03:40 pm »
Thanks for your interest:

My code only does a call to a function of BGRABitmap.canvasBGRA.

The called function is "Pie".


Code: [Select]
uses bgrabitmap, BGRABitmapTypes, bgraCanvas; 
My code:
Code: [Select]
var bmp: TBGRABitmap;

begin

bmp := TBGRABitmap.Create(clientwidth, clientHeight);     
 
bmp.canvasBGRA.Pie(100, 300, 200, 400,tbAngulo.position*16,30*16);   

bmp.Draw(canvas,0,0,true);
  bmp.free;     
end;
 



Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5795
    • wiki
Re: Pie - run error 201
« Reply #4 on: May 14, 2012, 05:41:05 pm »
I haven't got that installed, so I can't answer this any further.

From the exception, I see it actually happens inside the BGRA code. Maybe it even is a bug there.

Sorry you need to find someone who knows more on BGRA...

Laksen

  • Hero Member
  • *****
  • Posts: 624
    • J-Software
Re: Pie - run error 201
« Reply #5 on: May 14, 2012, 06:00:23 pm »
I think we need some information about your system? Which platform, which compiler version, and lazarus version?

I cannot reproduce any of the cases with the SVN version on win32.

Mando

  • Full Member
  • ***
  • Posts: 181
Re: Pie - run error 201
« Reply #6 on: May 14, 2012, 07:32:38 pm »
Hi.
lazarus 0.9.31
fpc 2.6.
win xp/ win7 32bits

BGRA 5.5

Rails

  • Guest
Re: Pie - run error 201
« Reply #7 on: May 14, 2012, 09:09:39 pm »
I suggest you upgrade to the latest BGRABitMap, which AFAIK is 5.7.

If you still get the error, you should already have BGRAPath in your editor. If not, left click on the source(bmp.canvasBGRA.Pie), then right click (Find Declaration) your way back to the BGRAPath unit. It will come up in your source editor. Put your cursor on line 349 and set a breakpoint there. You can then run the program to the breakpoint and step (F7) into the function watching the local variables. That should give you a clue to what is happening.

Mando

  • Full Member
  • ***
  • Posts: 181
Re: Pie - run error 201
« Reply #8 on: May 15, 2012, 10:13:37 am »
Hello!!!

Thanks Rails: It works!!!



Regards.