Extremely irritating MsgBox (bored ...)

Post your working scripts, libraries and tools
burque505
Posts: 492
Joined: 22 Jan 2017, 19:37

Extremely irritating MsgBox (bored ...)

07 Jul 2018, 10:54

Idle hands, et cetera :twisted:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



stop.gif
stop.gif (51.14 KiB) Viewed 232 times
User avatar
TheDewd
Posts: 959
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 11:40

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

LC := 1

Loop {
LC := (LC > 26 ? 1 : LC)
L := Chr(64 + LC)
I := (Mod(LC, 2) ? 48 : 524320)
MsgBox, % I, % LC, % L, 1
IfMsgBox, OK
return
LC++
}
User avatar
TheDewd
Posts: 959
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 14:37

GeekDude wrote:MsgBox,% *&L&1?48:524320,% *&L-64,% L,0.25


Will you explain this to me? It appears to be ternary still, but I haven't seen it written like that.
GeekDude
Posts: 827
Joined: 02 Oct 2013, 22:13

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 14:45

*&L gets the address of variable L using & then the value of the byte at that address (which is the character code) using *.

So, replacing that with Asc(L) for clarity, Asc(L) & 1 is checking whether the last binary digit is 1 or 0. Even numbers end in binary 0 while odd numbers end in binary 1. It's similar to your Mod(LC, 2) check.

Then the next parameter *&L-64 is just more of the same. Get the character code of L and subtract 64.
burque505
Posts: 492
Joined: 22 Jan 2017, 19:37

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 14:54

Very nice, guys :bravo:

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 14 guests