Sign in to follow this  
Followers 0
vrocco

MsgBox with variable

3 posts in this topic

#1 ·  Posted (edited)

I know I am missing something simple here. Please help me out with why the code below won't work correctly.

$profile = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles", "DefaultProfile")
MsgBox(4096, "test", "default profile is:"+$profile)

When I do that, the message box just says "0" (without quotes)

When I do:

$profile = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles", "DefaultProfile")
MsgBox(4096, "test", "default profile is:", $profile)

I get "default profile is:" and nothing else.

What am I doing wrong?

Edited by vrocco

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I know I am missing something simple here. Please help me out with why the code below won't work correctly.

$profile = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles", "DefaultProfile")
MsgBox(4096, "test", "default profile is:"+$profile)

When I do that, the message box just says "0" (without quotes)

MsgBox(4096, "test", "default profile is:" & $profile)

& is the string concantenator in AutoIt.

+ is the mathematical addition and AutoIt performs a conversion to numbers when trying to use +; so a string converts to zero, and 0+0 = 0.

EDIT: see "Operators" under "Language Reference" in the Help File

Edited by ResNullius

Share this post


Link to post
Share on other sites

thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0