Search found 299 matches

by vvhitevvizard
24 Jan 2019, 03:20
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 2728

Re: Obj.Count() using Numget??

Interesting thing is: key name can be a floating point, but it is stored as a string actually {0.5:"0.6"} -> {"0.5":"0.6"} {0.5:0.6} -> {"0.5":0.5999999999999998} and 2nd: I didn't know that key's _name_ can be an object: ["obj_key"]:["obj_val"] . I thought such a construction is illegal. Someone mi...
by vvhitevvizard
24 Jan 2019, 00:36
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 2728

Re: Obj.Count() using Numget??

@ vvhitevvizard , more (useless) explorations One more thought. They r definitely NOT useless. For example, if one writes in C++ language and studies how C++ compiler turns his lines into resulting machine assembly code, he can find ways/styles of writing more effective C++ algorithms with increase...
by vvhitevvizard
23 Jan 2019, 10:59
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 2728

Re: Obj.Count() using Numget??

@ vvhitevvizard , more (useless) explorations :arrow: here , see the spoiler. thank u, Helgef! very interesting In any case, you cannot rely on the implementation not changing, thus breaking your script. No doubt. All that r bad practices. :D But a script can be "statically-linked" ("compiled" into...
by vvhitevvizard
23 Jan 2019, 10:10
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 2728

Re: Obj.Count() using Numget??

great, now i wanna know how whoever came up with this came up with this "lemme check the source. oh look, ill just access this pointer here" how? well, for a few years AHK missed a bullet-proof (reliable, convenient, performance-wise decent) way to count pairs key-value in the associative arrays an...
by vvhitevvizard
23 Jan 2019, 09:46
Forum: Ask For Help
Topic: Obj.Count() using Numget??
Replies: 34
Views: 2728

Re: Obj.Count() using Numget??

I recently figured out myself how to do more advanced stuff for AHK v2 (its inner object's format is different from AHK v1) U might be interested: https://www.autohotkey.com/boards/viewtopic.php?p=258935#p258935 In the proof of concept implementation I do direct string's length manipulations w/o cop...
by vvhitevvizard
23 Jan 2019, 08:42
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 2470

Re: Script crash Topic is solved

After some thinking, StrLen doesnt calculate string size on the spot but just retrieves its field size which was previously saved by AHK internally. So it works in case it was a real string or was properly initiated with VarSetCapacity for binary fields by the caller. But once we skip ByRef keyword ...
by vvhitevvizard
23 Jan 2019, 08:19
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 2470

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. U r right here. its stored. It couldn't work other way. :) But the point is I see many (including OP)...
by vvhitevvizard
23 Jan 2019, 08:04
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 2470

Re: Script crash Topic is solved

AHK doesnt have a function to count binary array's length. Please tell me, what does that mean? AHK unlike Python and some other languages, doesnt have a "binary array" data type. there is no way to count and store size of an arbitrary binary buffer that we declared earlier. StrLen / StrPut try to ...
by vvhitevvizard
23 Jan 2019, 07:57
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2681

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

Good addition. :thumbup: ur 0x40000000 in DllCall params supresses CR/LF addition.
by vvhitevvizard
23 Jan 2019, 07:51
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 2470

Re: Script crash Topic is solved

I still can't understand why strLength := StrLen(str) must be multiplied by 2. If ur AHK version is Unicode, all strings r stored in 2 bytes per character (widechar) format U store a binary data as a string and use StrLen to count number of 2-byte tokens in it: strLength := StrLen(str) * 2 it might...
by vvhitevvizard
23 Jan 2019, 07:07
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2681

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

nnnik wrote:
23 Jan 2019, 07:02
The function is used to encode binary data to base64 not strings to base64.
oops. my bad. I guess I gotta go to sleep again. :D
Anyways, VarSetCapacity(buf,-1) is agnostic to string format in case we skip "A" or "W" for called WinApi function.
by vvhitevvizard
23 Jan 2019, 06:58
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2681

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

However if you encode the string as UTF-8 and then encode it with my function the results will be the same. However encoding the string as UTF-8 is not task of the function - its the task of the function that calls it. just replace "ptr", ptr to "str",ptr (u might want to rename that argument to st...
by vvhitevvizard
23 Jan 2019, 06:38
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2681

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

OK there has been a lot of confusion going on here. I dont understand what vvhitevvizard is talking about and I don't see how his comment relate to the problem at hand. Mostly of unrelated stuff. I'm sorry I didnt intend to complicate things. I just warned that if someone needs big base64 files (e....
by vvhitevvizard
23 Jan 2019, 06:20
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 2470

Re: Script crash Topic is solved

Denied. Pay attention yourself, the original construct is valid. *acknowledges defeat* The original construct is of bad style but is valid indeed. the key is output buffer size. And I made a typo here offering an alternative for return StrGet(&bin) . & was out of place. Correct one is: VarSetCapaci...
by vvhitevvizard
23 Jan 2019, 05:03
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7221

Re: fat function in class method changes var outside itsscope

No but the possibility of using that style requires no work. The style is completely removed from anything which has any value as a style. I don't understand. Could u rephrase please. I wouldn't want anyone to waste their time even thinking about how to add it to AHK much less I want to discuss it....
by vvhitevvizard
23 Jan 2019, 04:43
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7221

Re: fat function in class method changes var outside itsscope

Which does not make any difference in the slightest. yes. I just answered Helgef post where he broke down fat-arrow logic. we dont return right after first sub-expression there. You referenced a variable - do you want a #Warn mode that tells you when you used a variable that has the same name as a ...
by vvhitevvizard
23 Jan 2019, 04:28
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7221

Re: fat function in class method changes var outside itsscope

1 line stuff like that is so disgusting. Well, it doesn't imply everyone HAS to use that style. its like OTB brackets, a matter of choice. I, for one, would like to combine bracket enclosement commands ( if , loop , try , etc) especially if they dont have a bracketed body. e.g.: if(a) b++ else cont...
by vvhitevvizard
23 Jan 2019, 03:47
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7221

Re: fat function in class method changes var outside itsscope

basically, remove command syntax Yuppers! We want a revolution! :D If that requires adding some parenthesis all over the script body cuz the design becomes more strict I'm ready. But the interpeter should signal all the related errors. The majority of v2 issues branches from the efforts to remain v...
by vvhitevvizard
23 Jan 2019, 03:35
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 2470

Re: Script crash Topic is solved

Helgef wrote:
23 Jan 2019, 03:28
no that is not the error
I beg to differ. it is. :D Pay attention the issue was it gave a correct result once and failed next time.

Code: Select all

a := "sdfsdfweg3sdgfhrthrtjrfdsfsdfasferv4g3gdfvfdg"
b := Base64Enc(a)
MsgBox % b

b := Base64Enc(a)
MsgBox % b

Go to advanced search