Sign in to follow this  
Followers 0
roman

Sub-Routines?

8 posts in this topic

Hi

I'm new with AutoIt 3. Compared with "Autohotkey" (that i know a bit), i miss some things, e.g. the subroutine. How do i script a subroutine with AutoIt - should i use the function-command?

:o

Thanks, Roman.

Share this post


Link to post
Share on other sites



yes sub-routines is implemented thru Func.

See doc "Language Reference -> Functions"

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi

I'm new with AutoIt 3. Compared with "Autohotkey" (that i know a bit), i miss some things, e.g. the subroutine. How do i script a subroutine with AutoIt - should i use the function-command?

:o

Thanks, Roman.

What's AutoHotKey? (Wow, what a dirty word to bring up here!! (it's been a long time), can't wait for Larry to read that word :geek:)

Edit:

If your looking for MultiThreading, as far as I know we don't have it available at the moment. If you are, you could look at options like AdlibEnable() to call a function with a given parameter of time, or use another script to communicate back and forth to each other.

Edited by SmOke_N

[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

What's AutoHotKey? (Wow, what a dirty word to bring up here!! (it's been a long time), can't wait for Larry to read that word :o)

;)

uuups... are there some words that i :geek: never should use here?

Share this post


Link to post
Share on other sites

:geek:

uuups... are there some words that i :o never should use here?

To make a long story short (because I wasn't around when it happened) but from what I read... AutoHotKey would not exists if they didn't steal the source from AutoIt (Jon) to create it. Maybe others would like to elaborate more (I'm no expert on the subject).

[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

@SmOke_N

An old AutoIt subroutine with no multithreading...

; Example Script
; ==============
;
; OS:    Windows 9x/NT
; Author: Jonathan Bennett (jbennett@hidden.demon.co.uk)
;
; Script to show how the Gosub and Return commands work
;

MsgBox, 4, AutoIt Example, Script to demonstrate subroutines. Run?
IfMsgBox, NO, Goto, denied

SetEnv, MyMessage, This is the first message!
Gosub, mysubroutine
SetEnv, MyMessage, This is the second message!
Gosub, mysubroutine
SetEnv, MyMessage, This is the third message!
Gosub, mysubroutine
Exit

mysubroutine:
MsgBox, 0, Example, %MyMessage%
Return

denied:
Exit

Share this post


Link to post
Share on other sites

@SmOke_N

An old AutoIt subroutine with no multithreading...

; Example Script
; ==============
;
; OS:    Windows 9x/NT
; Author: Jonathan Bennett (jbennett@hidden.demon.co.uk)
;
; Script to show how the Gosub and Return commands work
;

MsgBox, 4, AutoIt Example, Script to demonstrate subroutines. Run?
IfMsgBox, NO, Goto, denied

SetEnv, MyMessage, This is the first message!
Gosub, mysubroutine
SetEnv, MyMessage, This is the second message!
Gosub, mysubroutine
SetEnv, MyMessage, This is the third message!
Gosub, mysubroutine
Exit

mysubroutine:
MsgBox, 0, Example, %MyMessage%
Return

denied:
Exit
You ain't kidding old... I don't even know the syntax for AutoIt2... lmao.... I understood the concept of the sub routines, I was just wondering if he/she was actually trying to multithread, but thanks for that... kind of makes me feel :o

[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

#8 ·  Posted (edited)

Stupid *******key

Edited by rambo3889

My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

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