Sign in to follow this  
Followers 0
Slingshot

Function Error!

6 posts in this topic

Hi i was wondering if you could tell me where im going wrong for trying to call a function, it says

Func AddAll

Error:Badly formatted "Func" statement.

heres the code:

Func AddAll 
    If WinActive("Outlook Express","") Then
    Send("{APPSKEY}")
    Send("{SHIFTDOWN}b{SHIFTUP}")
    EndIf
EndFunc

Thanks :think:

Share this post


Link to post
Share on other sites



maybe

Func AddAll()

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Then it says

AddAll

^ERROR

Error: Error parsing function call

Share this post


Link to post
Share on other sites

Then it says

AddAll

^ERROR

Error: Error parsing function call

What Valuater is saying is you should make your functions like:
Func AddAll()
    If WinActive("Outlook Express","") Then
    Send("{APPSKEY}")
    Send("{SHIFTDOWN}b{SHIFTUP}")
    EndIf
EndFunc
With the brackets on the end.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

give this a try... there are no apparent errors

Func AddAll()
    If WinActive("Outlook Express", "") Then
        Send("{APPSKEY}")
        Send("{SHIFTDOWN}")
        Send("b")
        Send("{SHIFTUP}")
    EndIf
EndFunc  ;==>AddAll

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

To reinforce the above, function definitions are made like this:

Func MyFunc()
; stuff
EndFunc

Function calls are made like this (using the above example):

MyFunc(); calls MyFunc

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
Sign in to follow this  
Followers 0