[ERROR] inStr Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
_3D_
Posts: 277
Joined: 29 Jan 2014, 14:40

[ERROR] inStr

17 Oct 2017, 08:57

AutoHotkey_2.0-a081-cad307c

Code: Select all

msgBOX(inStr(     1.34, 34))		; 3 - OK
msgBOX(inStr(    12.34, 34))		; 0 - ERROR
msgBOX(inStr( 12.34 "", 34))		; 0 - ERROR
msgBOX(inStr(  "12.34", 34))		; 4 - OK
msgBOX(inStr(   123.34, 34))		; 5 - OK
msgBOX(inStr(  1256.34, 34))		; 0 - ERROR
msgBOX(inStr("1256.34", 34))		; 6 - OK
msgBOX(inStr( 12567.34, 34))		; 7 - OK
When characteristic even ERROR. Also

Code: Select all

a:= 12.34 ""
msgBOX(inStr(        a, 34))		; 0 - ERROR
Probably problem in float to string converting.
AHKv2.0 alpha forever.
_3D_
Posts: 277
Joined: 29 Jan 2014, 14:40

Re: [ERROR] inStr  Topic is solved

18 Oct 2017, 06:36

[SOLUTION]

Code: Select all

a:= 12.34
msgBOX(inStr(format("{:f}", a), 34))
Float is not just digits and a dot so need real transformation to string.
AHKv2.0 alpha forever.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Draken, omar and 33 guests