adam51

my basic script wont work

8 posts in this topic

#1 ·  Posted

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted

adam51,

If you are not using SciTE ownload and install the FULL version.  Run your script in SciTE and it will help you with these errors.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#3 ·  Posted

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

 

1 person likes this

Share this post


Link to post
Share on other sites

#4 ·  Posted

thanks guys. out of interest, why the "s" after "$" as in the help files on msgbox, I could not find it in there?

Share this post


Link to post
Share on other sites

#5 ·  Posted

this is where I got this coding from. so does his work because he has the full version?

1 person likes this

Share this post


Link to post
Share on other sites

#7 ·  Posted

I get it, thanks, I hope I will get better quickly :)

Share this post


Link to post
Share on other sites

#8 ·  Posted

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)

 

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