Msgbox & Variables Problem Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
vSky
Posts: 80
Joined: 30 May 2022, 10:13

Msgbox & Variables Problem

Post by vSky » 29 Jun 2022, 11:14

Code: Select all

MsgBox, % LocalC(127.0.0.1, "Admin", "1234")
This way I can get the data I want, but

Code: Select all

MsgBox, 4,, % LocalC(127.0.0.1, "Admin", "1234")
The variable doesn't work correctly when I do it this way. What do I need to do to use the "YesNo" query with the variable?

User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Msgbox & Variables Problem

Post by Xtra » 29 Jun 2022, 11:27

Code: Select all

MsgBox, 4, example, choose yes or no
IfMsgBox, Yes
    MsgBox you chose Yes
else
    MsgBox you chose No

User avatar
vSky
Posts: 80
Joined: 30 May 2022, 10:13

Re: Msgbox & Variables Problem

Post by vSky » 29 Jun 2022, 13:11

Xtra wrote:
29 Jun 2022, 11:27

Code: Select all

MsgBox, 4, example, choose yes or no
IfMsgBox, Yes
    MsgBox you chose Yes
else
    MsgBox you chose No
Yes it works that way, but can you try adding a variable? My problem starts after adding variable.

RussF
Posts: 1264
Joined: 05 Aug 2021, 06:36

Re: Msgbox & Variables Problem

Post by RussF » 29 Jun 2022, 13:50

This worked perfectly fine for me:

Code: Select all

MsgBox, 4, example, % SubStr("xxxxxShow Thisxxxxx",6,9)
Could it be your LocalC() function?

Russ

gregster
Posts: 9000
Joined: 30 Sep 2013, 06:48

Re: Msgbox & Variables Problem

Post by gregster » 29 Jun 2022, 13:53

The IP 127.0.0.1 should be handled as a string, I imagine:

Code: Select all

LocalC("127.0.0.1", "Admin", "1234")
Because in an expression, it probably doesn't mean anything: compare msgbox % 127.0.0.1

User avatar
vSky
Posts: 80
Joined: 30 May 2022, 10:13

Re: Msgbox & Variables Problem

Post by vSky » 29 Jun 2022, 15:51

RussF wrote:
29 Jun 2022, 13:50
This worked perfectly fine for me:

Code: Select all

MsgBox, 4, example, % SubStr("xxxxxShow Thisxxxxx",6,9)
Could it be your LocalC() function?

Russ
I think there is something wrong with LocalC Function I don't understand. I am sharing 2 different msgbox contents below. Strangely enough it doesn't read the variable.


Image
Image


gregster wrote:
29 Jun 2022, 13:53
The IP 127.0.0.1 should be handled as a string, I imagine:

Code: Select all

LocalC("127.0.0.1", "Admin", "1234")
Because in an expression, it probably doesn't mean anything: compare msgbox % 127.0.0.1
I fixed it. I wish that was the only issue, thanks for the info though.

gregster
Posts: 9000
Joined: 30 Sep 2013, 06:48

Re: Msgbox & Variables Problem

Post by gregster » 29 Jun 2022, 21:34

Well, which code are you actually running?
What are the contents of that function?
Without seeing code, we can just resort to unproductive guessing...

User avatar
vSky
Posts: 80
Joined: 30 May 2022, 10:13

Re: Msgbox & Variables Problem  Topic is solved

Post by vSky » 30 Jun 2022, 14:12

gregster wrote:
29 Jun 2022, 21:34
Well, which code are you actually running?
What are the contents of that function?
Without seeing code, we can just resort to unproductive guessing...
I deleted the whole ahk files and after installing the 64 bit version the problem went away by itself. I still don't understand the connection between 64 bit installation and this problem. Anyway, thanks for your interest.

gregster
Posts: 9000
Joined: 30 Sep 2013, 06:48

Re: Msgbox & Variables Problem

Post by gregster » 30 Jun 2022, 18:50

Without seeing the code, I don't know either.
But if it works, it works :)

Post Reply

Return to “Ask for Help (v1)”