Jump to content
Sign in to follow this  
Slingshot

Function Error!

Recommended Posts

Slingshot

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
Slingshot

Then it says

AddAll

^ERROR

Error: Error parsing function call

Share this post


Link to post
Share on other sites
SmOke_N

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.

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.

Share this post


Link to post
Share on other sites
Valuater

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
greenmachine

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.