Codism
Codism

Reputation: 6224

AutoHotKey SetFormat works only at the first time?

I found SetFormat only works at the first time, like the following simplified script:

Var = 0.0

f1::
SetFormat, float,03
Var += 1
msgbox, %Var%
return

I only get 001 at the first time. After that, it only displays 2, 3, ... for each f1. Anything I missed?

Thanks

Upvotes: 0

Views: 416

Answers (1)

James Kolpack
James Kolpack

Reputation: 9382

In...

Var += 1 

Var is getting cast to an integer. Try:

Var += 1.0

Upvotes: 1

Related Questions