Search found 114 matches
- 03 Sep 2023, 20:08
- Forum: Ask for Help (v2)
- Topic: Linear array of int values
- Replies: 3
- Views: 336
Re: Linear array of int values
Yeah, I got about the same. I guess I don't have much patience if I can't wait 25 seconds. I was hoping for something close to instant, though, since this is just an initialization step, and the actual processing takes even longer. I may need to adjust my strategy. Perhaps I can process a couple tho...
- 03 Sep 2023, 19:34
- Forum: Ask for Help (v2)
- Topic: Linear array of int values
- Replies: 3
- Views: 336
Linear array of int values
If I have a need for a giant array of int values, is there any way to have AHK2 generate these for me? I need the array to be filled with Data[0,1,2,3,4,5,6,7,8,...] where Data[23] == 23 , etc. It's no big deal if the values start at 0 or 1, because I can offset them accordingly. The purpose of the ...
- 03 Sep 2023, 19:27
- Forum: Ask for Help (v2)
- Topic: Clamp / Saturate
- Replies: 2
- Views: 261
Re: Clamp / Saturate
Yeah, I'm not opposed to typing the code out. Just wondering if there was built in support for it, because I'm doing it in a tight loop that iterates thousands of times. Thank you for the help!
- 03 Sep 2023, 18:29
- Forum: Ask for Help (v2)
- Topic: Clamp / Saturate
- Replies: 2
- Views: 261
Clamp / Saturate
Is there any type of simple clamp() or saturate() like function in AHK2? I searched, but cannot find anything related.
Essentially, it would allow you to perform math and keep the value from going outside of the specified range, such as OneThruTen := clamp( x, 1, 10 )
Essentially, it would allow you to perform math and keep the value from going outside of the specified range, such as OneThruTen := clamp( x, 1, 10 )
- 27 Aug 2023, 08:46
- Forum: Ask for Help (v2)
- Topic: Convert string character to ascii value
- Replies: 2
- Views: 344
Re: Convert string character to ascii value
I was hoping such a function existed. I wrote an entire UI-based app around an idea that required this feature without first verifying it existed. Thank you very much!
- 26 Aug 2023, 21:01
- Forum: Ask for Help (v2)
- Topic: Convert string character to ascii value
- Replies: 2
- Views: 344
Convert string character to ascii value
I'm trying to generate a hash from a string. Is it possible to read the character's of a standard string as ascii (or any integer-based value really)? The characters are not all numerical, so AHK throws an error that it expects an integer and receives a string.
Appreciate any help!
Appreciate any help!
- 12 Apr 2021, 08:16
- Forum: Wish List
- Topic: Wait / Pause in Send()
- Replies: 2
- Views: 1528
Re: Wait / Pause in Send()
Sweet, I did not know this! Thanks!
Edit: I did not notice the H suffix until my joy fell onto the keyboard. I haven't tried messing around with that, yet. Thanks for the info, though!
Edit: I did not notice the H suffix until my joy fell onto the keyboard. I haven't tried messing around with that, yet. Thanks for the info, though!
- 12 Apr 2021, 05:16
- Forum: Wish List
- Topic: Wait / Pause in Send()
- Replies: 2
- Views: 1528
Wait / Pause in Send()
I'm not sure how difficult this would be to implement, but I think it would fantastic to have the ability to wait in a Send() command. I believe the best way to handle it would be to allow the user to define a few wait times at startup, then assign those wait times to operators. I actually implement...
- 09 Apr 2021, 07:36
- Forum: Ask for Help (v2)
- Topic: Omit Function Parameter Under Condition?
- Replies: 3
- Views: 623
Omit Function Parameter Under Condition?
How would I do something like the following? SubStr( str, start, (stop==0 ? () : (stop - start)) ) My intention is to access the remainder of the string in cases where stop==0 . As far as I can tell, SubStr() doesn't have any specific value that represents "the rest of the string", other than omitti...
- 08 Apr 2021, 18:43
- Forum: Wish List
- Topic: Default Map Value Topic is solved
- Replies: 2
- Views: 1390
Default Map Value Topic is solved
Last wish for a while, I promise. Something I would really like to see added to maps is a default or fallback value on key->value request: myval := mymap[mykey, my_default_value] ..or.. myval := mymap.Find(mykey, my_default_value) When the key is not found, it would return the default value without ...
- 08 Apr 2021, 16:47
- Forum: Ask for Help (v2)
- Topic: Keyword replace from map?
- Replies: 4
- Views: 741
Re: Keyword replace from map?
Yeah, after thinking about all of the possible methods that could be used to accomplish this, I've started appreciating your first approach a lot more. Any type of parsing system that needs to check for 10+ keywords is not going to be much more efficient than just repeating the process for each keyw...
- 08 Apr 2021, 15:57
- Forum: Wish List
- Topic: Enhanced InStr
- Replies: 1
- Views: 934
Enhanced InStr
I would love to have a InStr() type function for some of these things: Locate the next white-space character / next non-white-space Next alpha-numeric character / non-alpha-numeric Next symbol character / non-symbol etc These routines can be made extremely efficient with an ascii lookup table. Does ...
- 08 Apr 2021, 15:32
- Forum: Ask for Help (v2)
- Topic: Keyword replace from map?
- Replies: 4
- Views: 741
Re: Keyword replace from map?
Thanks for your response! My main concern is that the user string will be an entire HTML page. I probably should have mentioned this. What you suggest would still work, but I was hoping for something where the main string would only need parsed once. I can enforce some type of prefix on variable nam...
- 08 Apr 2021, 14:12
- Forum: Ask for Help (v2)
- Topic: Keyword replace from map?
- Replies: 4
- Views: 741
Keyword replace from map?
What would be the easiest way to set up a replacement process where a user-defined string-map replaces keywords in a string? Here's an example of what I want. I'm throwing this out on the spot, so apologies for syntax mishaps: keys := map() keys["MAXBUF"] := 4000 keys["MINBUF"] := 100 ustring := "My...
- 08 Apr 2021, 14:03
- Forum: Ask for Help (v2)
- Topic: How to interupt KeyWait?
- Replies: 2
- Views: 546
Re: How to interupt KeyWait?
You can set a global variable to 1 when F11 goes down (before KeyWait() , then set that variable to 0 when escape is pressed. Then just check the variable before taking action in your F11 hotkey. Or you can use KeyWait with a timer limit in a loop, and keep checking for Escape every so many millisec...
- 08 Apr 2021, 13:56
- Forum: Ask for Help (v2)
- Topic: Joystick Hotkeys Failing Topic is solved
- Replies: 5
- Views: 1009
Re: Joystick Hotkeys Failing Topic is solved
They don't seem to work in a128, a129, or a130. I can't go any further back without having to change variable referencing syntax. Looks like I'm stuck waiting. Easier to wait than re-write all of that ByRef syntax.
- 08 Apr 2021, 06:56
- Forum: Wish List
- Topic: Different Title or Extension on Major Releases
- Replies: 0
- Views: 700
Different Title or Extension on Major Releases
It currently seems difficult to manage AHK files in Windows when dealing with both versions. Since AHK1 and AHK2 both use the same extension on their script files, there's no way to associate the AHK1 scripts with AHK1. To make it worse, when you use the "open with" command, both AHK versions have i...
- 08 Apr 2021, 06:30
- Forum: Ask for Help (v2)
- Topic: Joystick Hotkeys Failing Topic is solved
- Replies: 5
- Views: 1009
Re: Joystick Hotkeys Failing Topic is solved
Thanks for pointing that out. Does anyone know the latest version that still worked with joystick hotkeys? I changed all of my references to use &syntax, and probably several other things, so hoping I don't have to undo the progress just to redo it later.
- 07 Apr 2021, 18:27
- Forum: Ask for Help (v2)
- Topic: Joystick Hotkeys Failing Topic is solved
- Replies: 5
- Views: 1009
Joystick Hotkeys Failing Topic is solved
Has anyone else had issues with basic joystick hotkeys in the newer updates? I've tested it in several scripts, including the joystick test script. GetKeyState returns the correct state of the joystick buttons, but a Joy1::MsgBox("!") won't ever fire. I've tried adding hotkeys to several joystick in...
- 02 Apr 2021, 19:41
- Forum: Ask for Help (v2)
- Topic: Access a class member as a normal variable? Topic is solved
- Replies: 3
- Views: 891
Re: Access a class member as a normal variable? Topic is solved
I'm never sure how variables are going to be copied in closures. I know temporaries become like static values, and globals become like references, but I'm not sure how class members behave yet. I will give that a try. Yeah, after thinking about it, I'm not sure why I didn't realize this would work. ...