Jump to content

my basic script wont work


Recommended Posts

hi, im fairly new to autoit, ive been watching youtube videos to learn, I have successfully been able to do some basic commands but 2 of the codes that I have tried to do have not worked. I have checked and checked again but there seems to be nothing different from my code to the persons on the youtube video and theirs is working fine for them, 

Global $message $name
$ name = "adam"
$ message = "hello"
MsgBox(0,"title", "my name is, "$ name")

this is one of the scripts, any ideas please?

Link to comment
Share on other sites

@adam51 Welcome to AutoIt forums, highly recommend looking at AutoIt help file as it has examples for almost every function, it will also show you the correct syntax/format for coding in Autoit.  For example this is how your code should look, note:

  • No spaces between $ and variable name
  • Use & to join/concatenate two or more strings together

Anyway I hope that helps get you started, happy coding.

Global $sName = "adam"
Global $sMessage = "hello"
MsgBox(0,"title", $sMessage & " my name is, " & $sName)

 

Link to comment
Share on other sites

Regards the video, no his information is correct, you probably want to watch the video in fullscreen so you can actually see the code being written, this is his output from the video:

Global $message, $name

$name = "Wesley"
$message = "Hello and welcome"

MsgBox(0,"My title", "My name is " & $name)

 

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