ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > FARR Plugins and Aliases

[FCalc] Variable increment bug

(1/1)

d4ni:
Hi mouser,

I believe I have identified a (pretty obvious) bug while incrementing a variable which has been created using FCalc. If I want to add 1 to a variable x, is there any other way than using fc x = x+1 or fc x = (x+1)? The += operator is not supported I noticed, so I figured this was the way to go. However, the variable x actually gets the value x+2.

To reproduce:
1. Launch FCalc using its regex
2. Type 'x = 0'
3. Type 'x = (x+1)'
4. Type 'x' to see the result.

The result is supposed to be 1, but instead is 2. This happens all the time.

I think part of the bug is the fact you can alter variables *without* pressing the enter key. For example, I can type:
1. 'x = 0' [ENTER]
2. 'x = 5' // But then remove the line using backspace, perhaps I made an error. I *did not* press [ENTER] here.

Now, however, x *did* in fact change to 5. Which, imho, it should *not* do.

::important edit

It seems if I want to increment integer x with the constant n using the notation x = (x+n), it is somehow parsed to x = x + 2n. In the case of incrementing by 1, this results in an increment by 2. If I increment by 10, however, x will be incremented by 20 instead.

mouser:
you are right! wow that's weird. i'll fix.
however i might point you to jscalc by czb which is a newer calculator plugin for farr with some additional very cool features.

d4ni:
Ofcourse I'm right ;) j/k

I just checked jscalc out for a bit and it certainly is nice, thanks for the tip. It actually does support +=, *= and /=, sweet!

d4ni:
Just a heads up, I noticed the bug is still around ;)

Navigation

[0] Message Index

Go to full version