Jump to content

Recommended Posts

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
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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...