Search found 3519 matches

by Helgef
26 Jan 2019, 02:52
Forum: Ask For Help
Topic: Is it necessary to use VarSetCapacity to free memory that uses variables frequently? Topic is solved
Replies: 4
Views: 217

Re: Is it necessary to use VarSetCapacity to free memory that uses variables frequently? Topic is solved

You cannot use varsetcapacity with built-in variables. You should free variables if you are done with them and they take up more space than you want. Generally, if you use functions you don't need to be concerned unless you create an unknown (large) number of dynamic variables, aka pseudo arrays.
by Helgef
25 Jan 2019, 14:21
Forum: Offtopic
Topic: Code Puzzle Thread
Replies: 102
Views: 17598

Re: Code Puzzle Thread

Hello :wave: . Did someone attempt to solve puzzle 11? Please comment if something is unclear. I will give a hint, the solution does not need to involve very much code, actually, quite few lines are needed. I came up with a (quite simple) puzzle, it requires some basic knowledge of C so this just a ...
by Helgef
25 Jan 2019, 09:38
Forum: Ask For Help
Topic: One line if statement Topic is solved
Replies: 7
Views: 282

Re: One line if statement Topic is solved

You can use ifequal, although it is recommend you do not.
by Helgef
24 Jan 2019, 10:27
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 593

Re: Obj.Count() using Numget??

This pointless, if you want to associate an object with some value, what we got is the most natural and convenient way, without any downside.
by Helgef
24 Jan 2019, 09:47
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 593

Re: Obj.Count() using Numget??

Not objects themselves. their pointers. Effectively simple integers. What stops u from using integer as a key name? Ofc you can store an object's address as an integer key, it is very inconvenient though, since you have to call object / objaddref / objrelease as appropriate. Strings may be unique f...
by Helgef
24 Jan 2019, 06:22
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 593

Re: Obj.Count() using Numget??

I wonder, whats the desperate need to use ["obj_key"]:["obj_val"] syntax instead of "obj_key":["obj_val"]. This has nothing to do with syntax. ["obj_key"] is an array containing one string, "obj_key" . That array is associated with the array containing the string "obj_val" , it is not a syntax vers...
by Helgef
24 Jan 2019, 04:03
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 593

Re: Obj.Count() using Numget??

Doesn't it look like making a key _name_ as an object makes no sense. I do not know what you mean by key _name_ . The key's value is preserved, So the key doesn't have a _name_ , it has a _value_ , (and is associated with another value) for k, v in { func('msgbox') : 'hello world' } %k%(v)
by Helgef
24 Jan 2019, 03:33
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 593

Re: Obj.Count() using Numget??

Integer keys would be faster to find mainly due to numeric comparison being faster than case insensitive string comparison, not due to their internal placement. These are assumptions.

Cheers.
by Helgef
24 Jan 2019, 03:30
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 593

Re: Obj.Count() using Numget??

:arrow: doc.
by Helgef
23 Jan 2019, 10:54
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 593

Re: Obj.Count() using Numget??

Simply put, It works because the instance of the (c++) class is basically a stuct, where members (non-static at least) appear in the order they are defined. According to msdn , the location of the vtable is guaranteed. I'm not sure if the layout of the object is otherwise guaranteed by the c++ stand...
by Helgef
23 Jan 2019, 10:40
Forum: Wish List
Topic: Callable Func, BoundFunc, lambdas, custom user objs(ie no %%)
Replies: 10
Views: 427

Re: Callable Func, BoundFunc, lambdas, custom user objs(ie no %%)

; too percenty
:lol: I agree, it stings in my eyes, but I can not give any other reason why we need a change.

Cheers.
by Helgef
23 Jan 2019, 09:31
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 529

Re: Script crash Topic is solved

Sorry I'm lost, you should probably start a new thread if you have any questions. This seems off topic
by Helgef
23 Jan 2019, 08:14
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 529

Re: Script crash Topic is solved

We use VarSetCapacity to set binary array size but its up to us to store its size to re-use it later.
No, you call varsetcapacity(var), as documented. The length of the buffer is stored internally.
by Helgef
23 Jan 2019, 07:57
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 529

Re: Script crash Topic is solved

AHK doesnt have a function to count binary array's length.
Please tell me, what does that mean?
by Helgef
23 Jan 2019, 07:49
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 668

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

if we omit line breaks in the output, we can use Specifically, given an input of n bytes, the output will be 4 * ceil(n / 3) bytes long, including padding characters. (my bold) so we can skip the first dllcall, and calculate, b64Encode(ptr, input_size) { output_size := ceil(input_size / 3) * 4 + 1 V...
by Helgef
23 Jan 2019, 07:48
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 529

Re: Script crash Topic is solved

the input length is in bytes, if you run your script on unicode build, it is 2 bytes per character.
by Helgef
23 Jan 2019, 06:56
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 529

Re: Script crash Topic is solved

because varsetcapacity sets the capacity in bytes and CryptBinaryToStringW outputs size in characters, each one being 2 bytes.
by Helgef
23 Jan 2019, 06:36
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 529

Re: Script crash Topic is solved

varsetcapacity(bin, buffer * (a_isunicode ? 2 : 1))
by Helgef
23 Jan 2019, 06:33
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 668

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

What is the reason to use strput? Seems like unnecessary conversions and allocations.
Edit: nnnik, I see you edited your post.

Go to advanced search