Force Conversion of String to Integer Topic is solved

Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
Posts: 3
Joined: 25 Sep 2020, 09:49

Force Conversion of String to Integer

08 Oct 2020, 21:43

What is the preferred method to explicitly convert a string to an integer? I have a large predefined Map<int → string> called Lookup. I receive an Input string which contains a valid integer, but it sometimes includes leading zeroes. E.g. AHK looks for Lookup["01"] instead of Lookup[1]. I am currently using Lookup[Round(Input)], but I'm wondering if there is a more elegant solution.
Posts: 4129
Joined: 11 Jan 2017, 17:59

Re: Force Conversion of String to Integer  Topic is solved

09 Oct 2020, 02:48

that would be Integer(). either call it urself or override the map's __Item property to call it, so the client code wouldnt have to

Return to “AutoHotkey v2 Help”

Who is online

Users browsing this forum: No registered users and 2 guests