Jump to content

GUI with Buttons / Functions and an Error.


Recommended Posts

Hi,

By posting this code i'm sure you already know what i'm looking for, but if not i am basically making a program which will move forward, backward, left and right etc (yes, i know you can that anyway but this is just for my learning purposes only in AutoIT)

I, for some reason seem to keep getting the error;

Line -1:

Error: Error parsing function call

I looked around the forums and i think it has something to do with the way something is set out (the format/structure of the code).

Anyway, here is the code i have made and hoping to get some help as to why this error is occuring so that i can fix it and continue to move onto the functions for the buttons (i.e when click forward it will then read from the function which contains a variable to send a key to move forward).

P.S please do not flame me, i'm new to AutoIT programming language.

nothing.au3

#include <Variables.au3>
;; Defining variables with Global
Global $WalkFd
Global $WalkBk
Global $WalkLft
Global $WalkRgt
;; GUI Time
GUICreate("nothing", 600, 400, -1, -1, -1, -1)
GUICtrlCreateButton("Forward", 200, 800, 100, 150, -1, -1)
GUICtrlCreateButton("Backward", 210, 800, 100, 150, -1, -1)
GUICtrlCreateButton("Left", 220, 800, 100, 150, -1, -1)
GUICtrlCreateButton("Right", 230, 800, 100, 150, -1, -1)
;; Creating functions for the buttons

(This positioning might not be accurate, but ofc i will see that when i load it up, hopefully).

Variables.au3

$WalkFd = Send(W)
$WalkBk = Send(S)
$WalkLft = Send(A)
$WalkRgt = Send(D)
Edited by Learning1
Link to comment
Share on other sites

Hi,

By posting this code i'm sure you already know what i'm looking for, but if not i am basically making a program which will move forward, backward, left and right etc (yes, i know you can that anyway but this is just for my learning purposes only in AutoIT)

I, for some reason seem to keep getting the error;

Line -1:

Error: Error parsing function call

<snip>

You didn't quote your literal strings:
$WalkFd = Send("W")
$WalkBk = Send("S")
$WalkLft = Send("A")
$WalkRgt = Send("D")

:P

Edited by PsaltyDS
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...