Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread dec function bug?
Thu, Sep 15 2016 2:18 AMPermanent Link

Ronald

Hi,

I created this function:

function TForm1.GetClickedTijdvak(ClickedIndex:integer):integer;
begin
ClickedIndex:=dec(ClickedIndex);
Result:=ClickedIndex;
end;

but if I call it with: ShowMessage(IntToStr(GetClickedTijdvak(10))); I get 10 as answer. Only if I change in the function: dec(ClickedIndex,1) then I get 9 as answer.
Don't I use it correct?

Greetings,
Ronald
Thu, Sep 15 2016 7:11 AMPermanent Link

Ronald

Oops, it works fine, I used dec as a function. My mistake, sorry.


Ronald wrote:

Hi,

I created this function:

function TForm1.GetClickedTijdvak(ClickedIndex:integer):integer;
begin
ClickedIndex:=dec(ClickedIndex);
Result:=ClickedIndex;
end;

but if I call it with: ShowMessage(IntToStr(GetClickedTijdvak(10))); I get 10 as answer. Only if I change in the function: dec(ClickedIndex,1) then I get 9 as answer.
Don't I use it correct?

Greetings,
Ronald
Mon, Sep 19 2016 7:21 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ronald,

<< Oops, it works fine, I used dec as a function. My mistake, sorry. >>

Yeah, but the compiler shouldn't allow this, so I'll log it as an incident report. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Image