Jump to content

Function thingy's INSIDE "Send" commands


Recommended Posts

Ok, hard to explain it really, basically I've used;

$Test1 = InputBox("Tester1", "Type in something")
$Test2 = InputBox("Tester1", "Type in something else")

Now, later on in the script, I want to be able to mix those, with text. For instance if I typed in "LOLZ" into the first input box, and "HAHA" into the second, I want to be able to do something like this:

MsgBox(64, "Tester1", "You're right that's $Test1 not $Test2")

But if I do that, it comes out with "You're right that's $Test1 not $Test2", rather than "You're right that's LOLZ not HAHA", which is what I want.

Any idea how I could do it? All help is welcome.

Link to comment
Share on other sites

MsgBox(64, "Tester1", "You're right that's $Test1 not $Test2")

Syntax rules all. When including variables in your output, you don't want them inside your quotes. This basically means you'll have a concatenated set of data passed to msgbox (using "&").

MsgBox(64, "Tester1", "You're right that's " &$Test1 &" not " &$Test2)

Edit for spacing :whistle:

Edited by Monamo

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

Ok, hard to explain it really, basically I've used;

$Test1 = InputBox("Tester1", "Type in something")
$Test2 = InputBox("Tester1", "Type in something else")

Now, later on in the script, I want to be able to mix those, with text. For instance if I typed in "LOLZ" into the first input box, and "HAHA" into the second, I want to be able to do something like this:

MsgBox(64, "Tester1", "You're right that's $Test1 not $Test2")

But if I do that, it comes out with "You're right that's $Test1 not $Test2", rather than "You're right that's LOLZ not HAHA", which is what I want.

Any idea how I could do it? All help is welcome.

Look in the help file for variables and operators, and you'll find the '&' ampersand for appending strings:

MsgBox(64, "Tester1", "You're right that's " & $Test1 & " not " & $Test2)

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

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