Search found 299 matches

by vvhitevvizard
23 Jan 2019, 03:33
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2649

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

A pointer to a DWORD variable that contains the size, in TCHARs, you need to do varsetcapacity(bin, buffer * (a_isunicode ? 2 : 1)) . Also "ptr*" :arrow: "uint*" . I knew u would answer like that. But I posted a working alternative solution. :D tho I prefer StrLen() myself. base64 uses vocabulary o...
by vvhitevvizard
23 Jan 2019, 03:27
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 2449

Re: Script crash Topic is solved

ur error is in these lines.

Code: Select all

a := "sdfsdfweg3sdgfhrthrtjrfdsfsdfasferv4g3gdfvfdg"
a := Base64Enc(a)
u rewrite a content with retval.
by vvhitevvizard
23 Jan 2019, 03:07
Forum: Ask For Help
Topic: Script crash Topic is solved
Replies: 27
Views: 2449

Re: Script crash Topic is solved

U may return bin directly, w/o StrGet conversion cuz CryptoAPI DllCall returns a string in required format (ANSI/Unicode) automatically according to ur AHK version. But u need to recalculate its size for AHK inner counter: VarSetCapacity(bin,-1) return bin change DllCall("Crypt32.dll\CryptBinaryToSt...
by vvhitevvizard
23 Jan 2019, 02:47
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2649

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

OK, I may not compile it before testing. I'm sorry to disappoint u, u wont be able to compile ur AHK script. It will remain being a script to be interpreted at load and run time every time. "Compiled" AHK script is just AHK.exe with script text body bound to it statically, ripped of comments: Techn...
by vvhitevvizard
23 Jan 2019, 02:21
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2649

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

But I warn u: it turned out all the Microsoft's "Cryptxxx" routines r slow as hell. I do not know what you compare against, but I can assume you didn't load the library and look up the address. U got me wrong. :D Iam not talking of DllCall here and actually my last posts in Ask for help were addres...
by vvhitevvizard
23 Jan 2019, 02:16
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2649

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

Although I agree with you, my previous tests showed that my code was 2 seconds slower than Microsoft. https://www.autohotkey.com/boards/viewtopic.php?f=76&t=59933 Think of it as an interpreted algorithm is almost as fast as native code (compiled) one. Now imagine there r other compiled versions of ...
by vvhitevvizard
23 Jan 2019, 01:58
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

it requires explicit use of () for function calls inside fat arrow expr. Helgef , u try to explain everything in terms of semantics. I share my expectation as a user of the language - every unexpected quirk adds up to negative experience for a user. I know how expressions r evaluated in general. Tb...
by vvhitevvizard
23 Jan 2019, 01:51
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

AHKs classes are not their own scope - you are in global scope thats why the callback func (defined by a fat arrow) defined in global scope messes with global scope. This is not a keyword - it's a hidden 1st parameter on any method. U r talking of classes. but the question here is scope of methods ...
by vvhitevvizard
23 Jan 2019, 00:48
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

() => expr kk. it requires explicit use of () for function calls inside fat arrow expr. I skipped them in a haste and didn't even realize there is a difference. In a normal method body with 1 line per built-in function it accepts it w.o () . I would prefer expression evaluation tell me about if som...
by vvhitevvizard
22 Jan 2019, 23:59
Forum: Ask For Help
Topic: Base64 encoding problem with CryptBinaryToStringW Topic is solved
Replies: 29
Views: 2649

Re: Base64 encoding problem with CryptBinaryToStringW Topic is solved

One more alternative way to get string's length in bytes is using construction StrPut(string, "UTF-8"). W/o address argument it just returns calculated required buffer size in bytes.
afe wrote:
22 Jan 2019, 11:19
CryptBinaryToString"
But I warn u: it turned out all the Microsoft's "Cryptxxx" routines r slow as hell.
by vvhitevvizard
21 Jan 2019, 21:36
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

u havent called Time.Unix() Oh indeed. :thumbup: yeah. it corrupts t in both cases 2. i thought what if it was called from within another lambda, so as to game the " The function is assume-local if it is nested inside another function" rule, but it doesnt work btw, v2 documentation states (at least...
by vvhitevvizard
21 Jan 2019, 21:27
Forum: Ask For Help
Topic: Monitoring script
Replies: 5
Views: 742

Re: Monitoring script

Instead of using ImageSearch u might need a different approach. use WindowSpy.ahk that comes with AHK to learn what ClassNN has a ListView containing ur required fields and try to access those fields to obtain plain text data immediately. Tho it might not work if that particular ListView is custom (...
by vvhitevvizard
21 Jan 2019, 21:00
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

And concerning warnings: #Warn LocalSameAsGlobal t:="unchanged" func0(){ t.=" changed" ;OK: warning "local var has the same name as a global" } func1()=>t.=" changed" ;BAD: no warning here func2(){ local t t.=" changed" ;OK: we declared it local explicitly } func3(t:=""){ t.=" changed" ;OK: we "allo...
by vvhitevvizard
21 Jan 2019, 20:48
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

but it doesnt work its 5 am here. :D Im afraid I didn't get ur construction. .Call() doesnt call the 2nd nested lambda - it never gets to msgbox("here") inside it. t:="unchanged" global Time := (() => ({Unix: () => (DllCall("GetSystemTimeAsFileTime", 'int64p', t) , msgbox("here"), t // 10000001 - 1...
by vvhitevvizard
21 Jan 2019, 20:11
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

ok. back to the topic. here is what expected from a closure. it allows to change a topvar of the function containing the current closure. it is ok - it affects only the current function. The rationale behind that is we can create CallBacks with Closures - it is understood. but please pay attention t...
by vvhitevvizard
21 Jan 2019, 11:33
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

U have a point. I'm not an advocate of global vars that change language behavior and would like the whole AHK language to have uniformity. It was just brainstorming :) Thou some global settings make sense, e.g. defining: A_FileEncoding:="UTF-8" saves lots of space and relieves from a headache of hav...
by vvhitevvizard
21 Jan 2019, 09:59
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

It is a design choice with both pros and cons. I guess it is assumed that the user more often wants the var in, to be the same variable, and it will be regardless of whether you define the variable and the fat arrow function inside or outside a function. After some thinking, AHK could have a global...
by vvhitevvizard
21 Jan 2019, 09:24
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

AHKs scope system does not work that way. temporary iterators of for or loop having their own scope and which r deleted after the enclosed block is over. classes encapsulation. functions having assume-local by default. u name it. Am I missed something in the paradigm? :D Ah yeah. Static initializat...
by vvhitevvizard
21 Jan 2019, 08:18
Forum: Ask For Help
Topic: How to convert current time to unix timestamp?
Replies: 35
Views: 3923

Re: How to convert current time to unix timestamp?

UnixTimeStamp() { Static UnixStart := 116444736000000000 DllCall("GetSystemTimeAsFileTime", "Int64P", FileTime) Return ((FileTime - UnixStart) // 10000000) - 27 ; currently (2019-01-21) 27 leap seconds have been added } Interesting. But Unix timestamps I can compare it with dont seem to subtract th...
by vvhitevvizard
21 Jan 2019, 07:13
Forum: AutoHotkey v2 Development
Topic: fat function in class method changes var outside itsscope
Replies: 59
Views: 7180

Re: fat function in class method changes var outside itsscope

Your humble opinion is proven wrong by facts - the fat arrow function is not syntax sugar for function definitions - it is used to define quick callbacks and similar things during execution and binding them to the containing scope. Sure. I'm just expressing my experience as a user. :D U r talking o...

Go to advanced search