Jump to content

Sub-Routines?


Roman
 Share

Recommended Posts

  • Moderators

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

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.

Link to comment
Share on other sites

  • Moderators

: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).

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.

Link to comment
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
Link to comment
Share on other sites

  • Moderators

@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

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.

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...