Code: Select all
N := 7775
MsgBox(LTrim(7775, "7")) ; number -> 7775
MsgBox(LTrim("7775", "7")) ; string -> 5
MsgBox(LTrim(N, "7")) ; variable -> 5
Code: Select all
N := 7775
MsgBox(LTrim(7775, "7")) ; number -> 7775
MsgBox(LTrim("7775", "7")) ; string -> 5
MsgBox(LTrim(N, "7")) ; variable -> 5
Finally I got what u mean!
Neither can I. But the case leads me personally to the state of cognitive dissonance.(I cannot imagine any 'real world example' passing a pure number or a literal string to the function).
Brilliant solution! consistent and logical.Changed IsSet(var) to check var itself and added IsSetRef(ref).
@Lexicos Good to see u've decided to start addressing these #directives' mess! I hope all the remaining irrelevant ones for preprocessor stage will be replaced with built-in functions/variables.Replaced #Persistent, #InstallKeybdHook, #HotkeyInterval etc
In my opinion, that's somewhat unusual and requires to pay much more attention when upgrading from previous AHK versions and converting from other languages. But it remains to be seen for real case scenarios like upgrading 40k lines code base from v129 to v132 in my case.New uses for Else
yeah, many ppl have reported this bug. Its fixed in the upcoming update:
That's ironic, considering you seem to be a fan of Python, which is where I got the idea.
haha. I meant its not usual to conventional syntax like in C/Pascal/etc. But main concern was that it would render some code fragments to behave differently w/o flagging an error - the same caveat as with the brief moment between updates when u let methods to be rewritten as properties in an ordinary way. But anyways in practice I didn't bump into any issues while converting to v2-a131.That's ironic, considering you seem to be a fan of Python, which is where I got the idea.
@lexikos thank u for this!Removed BufferAlloc() and added constructor for Buffer().
There are many such cases throughout the changes from v1 to v2. This particular change is easy to detect through static analysis. I'm not even remotely bothered by issues updating from one alpha to the next.But main concern was that it would render some code fragments to behave differently w/o flagging an error
Return to “AutoHotkey Development”
Users browsing this forum: No registered users and 33 guests