This test references beta build help file 3.1.1.128. In some cases in the remarks, Quotes will be taken from the Forum. I will do my best to quote the author.
1. AutoIt v3 is a freeware ______-like scripting language designed for automating the Windows GUI.
a. C+
b. C++
c. Python
d. BASIC
Answer: d
2. Which one of these can AutoIt NOT do?
a. Execute Windows and DOS executables
b. Simulate key strokes (supports most keyboards layouts)
c. Simulate mouse movements and clicks
d. Move, resize and manipulate windows
e. Excacute programs at the assembly level.
f. Interact directly with "controls" on a window (set/get text, move, disable, etc.)
g. Work with the clipboard to cut/paste text items
h. Work with the registry
Answer: e
3. AutoIt v3 standalone requires registry entries.
A. True
b. False
Answer: b
More information: As with previous versions, AutoIt has been designed to be as small as possible (~115KB) and stand-alone with no external .dll files or registry entries required. Scripts can also be compiled into stand-alone executables with Aut2Exe.
4. The DLL version of AutoIt is called
a. AutoIt X3
b. AutoIt DLL
c. AutoItX
d. AutoDll
Answer: c
More Information: There have also been updates to the ActiveX and DLL versions of AutoIt called AutoItX - unlike v2 this will be a combined control (COM and standard DLL functions in the same DLL). AutoItX will allow you to add the unique features of AutoIt to your own favourite scripting or programming languages! See the AutoItX Help file (Start \ AutoIt v3 \ Extras \ AutoItX \ AutoItX Help File) for more information and examples.
5. V3 and V2.64 have compatable syntax.
a. True
b. False
Answer: b
More Information: v3 has a completely different syntax to v2.64 so old scripts are not compatible. However, v2.64 will continue to be supported and downloadable. Both AutoIt v3 and v2.64 can be installed on the same machine together without any problems and you can keep your old scripts intact. v2 uses the .aut extension and v3 uses .au3. There is rarely a need to rewrite a working v2.64 script for v3.
6. Directly get information on and interact with edit boxes, check boxes, list boxes, combos, buttons, status bars without the risk of keystrokes getting lost is called working with
a. interacts
b. controls
c. functions
d. bases
Answer: b
More Information: You can use the AU3Info to gather information on the control you wish to interact with. Even work with controls in windows that aren't active!
7. With AutoIt v3, you can use: (select 4)
a. limited lenth strings
b. Goto statements
c. if statements
d. while loops
e. functions
f. if arrays
g. do loops
Answer: c, d, e, g
More Information: "Proper" numbers, unlimited-length strings, complex expressions, if statements, select, while loops, for loops, do loops, functions, arrays, excellent string handling (over 25 functions!) - the list goes on. Everything you need to make your automation routines as painless as possible. Yes, this is a GUI automation language but the syntax in v3 is powerful enough for general purpose scripting. Old versions of AutoIt were often referred to as "not a proper language". Not any more.
AutoIt v3 doesn't use Goto statements. From the help file:
Gone. It's evil. No, you can't ask why - it just is. It's like that lump of rock they find in the microwave at the end of the film Time Bandits :)
AutoIt v3 features most of the common "loops" in use today and with these Goto is no longer required. Look up While, Do, For, ExitLoop, ContinueLoop and Functions for the modern way of doing things :) And while you are looking at help file sections check out these on loops, conditional statements and functions. I promise you, once you have got the hang of such things you will be able to script in virtually any other language within a couple of minutes.
Just to get you started, the most basic use of Goto in version 2.64 was an infinite loop like:
:mylabel
...do something...
...and something else...
goto, mylabel
A simple v3 version of that is a While loop that is always "true".
While 1 = 1
...do something...
...do something else...
Wend
If there is a massive outcry about this after the launch of v3 then I may add it back in, but only to help people convert scripts.
8. You can access windows by: (select 3) a. "title/text" b. string names c. class names d. string handles e. handles f. pixel color point Answer: a, c, e More Information: From the help file:Window Management
In addition to the "title/text" v2 way of accessing windows you can also access windows by their class names and handles. As usual you can expect to move, hide, show, resize, activate, close and pretty much do what you want with windows.
9. What is required to run a AutoIt v3 Script? a. You must have installed the AutoIt 3.1.1 installation package b. You must have AutoIt 3.1.1, the latest AutoIt beta, and a script editor such as SciTE c. You need only to run AutoIt3.exe d. You need AutoItv3.exe, and a script editor. Answer: c More Information: AutoIt3.exe is the AutoIt main program and only file required to run scripts. 10. The AutoIt information tool is called: a. AutoIt.chm b. AU3Info.exe c. AUtInfo.exe d. AutoIt3.exe Answer: b More Information: AU3Info.exe is the AutoIt Window Info Tool. 11. Aut2Exe.exe is used for: a. Executable stub for compiled scripts b. The script compiler c. The script decompiler d. Process...() function helper DLL - used under Windows NT 4 only (Microsoft redistributable file) Answer: B More Information:A word in "this" sentence has quotes around it!
How would you code this so the quotes appear when the msgbox is displayed?
a. Msgbox(0, "", "A word in "this" sentence has quotes around it!")
b. Msgbox(0, "", "A word in """this""" sentence has quotes around it!")
c. Msgbox(0, "", 'A word in 'this' sentence has quotes around it!')
d. Msgbox(0, "", "A word in ""this"" sentence has quotes around it!")
Answer: D
More Information:
Using double quotes
16. Will the following code work so the sentence "I love a bagel" will show in a msgbox?
$msg="a bagel"
msgbox(0, "", "I love $MSG")
a. yes
b. no
Answer: b
More Information:
Why can't I print a variable using "My var is $variable"?
17. What is the file extension for a AutoIt v3 Script?
a. aut
b. au3
c. at3
d. ats
Answer: b
18. How do you comment out a line?
a. rem
b. #
c. ;
d. ;-
Answer: c
19. Where is the best place to locate a function?
a. The start of a script
b. Before the loop statement
c. AutoIt doesn't use functions
d. The end of the script
Answer: D
20. The special array ___________ is initialized with the command line parameters passed in to your AutoIt script.
a. $command
b. $CmdLine
c. $commandline
d. $cmdln
Answer: b
More Information:
Command Line Parameters
21. What will WinWaitActive("", "", 10) do? (note: WinTitleMatchMode is not being used)
a. The script will halt, for no window will match.
b. The currently active window will be used.
c. Error for the syntax is incorrect.
d. Wait 10 seconds, then the script will continue
Answer: B
More Information:
Window Titles and Text (Basic)
22. In this example: WinWaitActive ( "title", ["text"], [timeout] ), which parameter(s) are required?
a. Title, text
b. Title, text, timeout
c. Title
d. Title, timeout
Answer: C
More Information:
title is the only required parameter for this
function, both the text and timeout
are optional. In some functions the text parameter is
not optional, if you do not wish to specify any text then just use ""
(a blank string). A blank string, or nothing at all, in the text
tells AutoIt that any text is valid.
23. How many "Windows matching" modes does AutoIt use?
a. 1
b. 2
c. 3
d. 4
e. 5
Answer: d
More Information:
Window Titles and Text (Advanced)
24. AutoIt only works with
a. Standard Microsoft controls
b. WIndows, Linix, and novell
c. WinBatch functions
d. Sun Java controls
Answer: A
More Information:
Controls
25. What is a control ID?
a. A edit, lable, button, or banner.
b. A varaible assigned to a control.
c. The internal numeric identifier that windows gives to each control.
D. Choice not listed.
Answer: c
More Information:
The Control ID is the internal numeric identifier that windows gives to each control. It is generally the best method of identifying controls. In addition to the AutoIt Window Info Tool, other applications such as screenreaders for the blind and Microsoft tools/APIs may allow you to get this Control ID.
26. What three methods can be used to interact with a control?
a. ClassNameNN
b. NameClassNN
c. Classname
d. text
e. HWND
f. HNWD
Answer: a, d, e
More Information:
Controls
27. What is the perfered editor for AutoIt v3?
a. notepad
b. wordpad
c. notetext
d. SciTE
Answer: d
More Information:
Editors
28. In this example: MsgBox(0, "SRE Example 1 Result", StringRegExp("text", 'test')), what will be the result in the msgbox?
a. 0
b. 1
c. Result
d. error
Answer: a
More Information:
Tutorial - Regular expression
29. In this example: MsgBox(0, "SRE Example 2 Result", StringRegExp("text", 'te[sx]t')), what will be the result in the msgbox?
a. 0
b. 1
c. Result
d. error
Answer: 1
More Information:
Tutorial - Regular expression
30. when using StringRegExp, you can specifying a pattern using a
a. group
b. set
c. bunch
d. string
Answer: b
More Information:
Tutorial - Regular expression
31. Review the following example.
$asResult
= StringRegExp("Gnarly
Monster hits you for 18 damage.", _
'([0-9]{1,3})',
1)
If @error
== 0 Then
MsgBox(0,
"SRE Example 5 Result",
$asResult[0])
EndIf
$Boolean1
= true
$Boolean2 = false
$Boolean3 =
$Boolean1 AND
$Boolean2
$Number1
= 0
$Boolean1 = true
$Boolean2 =
$Number1 AND
$Boolean1
Dim $var1 |
Or you can declare multiple variables at once:
Dim $var1, $myvariable |
You can also assign a variable without declaring it first, but many prefer explicit declarations.
$var1 = "create and assign" |
$Array[1]="A" $Array[2]="U" ..etc.. $Array[7]="3" |
To access a specific value in an Array, you only have to know the index number:
$MyChar=$Array[3] |
This results in $MyChar containing the letter "T" (See also: 'operators').
The index number can also be substituted by another variable or an expression, so you can build complex ways to assign or access elements in an array.
Arrays can also be multi dimensional, when you use multiple series of index numbers, like:
$Array[1][1]="Upper-Left" $Array[2][1]="Lower-Left" $Array[1][2]="Upper-Right" $Array[2][2]="Lower-Right" |
(These values are just examples)
You can use up to 64 dimensions in an Array.
Before you can start using Arrays in your script, you must define their bounds using the 'Dim'keyword
48. Is the following statement true or false:
It is ok to mix different datatypes in an Array.
A. True
B. False
Answer: b
More Information:
It was said that an Array contains only one datatype of the same type. But technically speaking, a Variant in AutoIt can contain anything from a number to a boolean value. So an AutoIt-Array could also contain different types, even other Arrays:
$Array[1]=1 |
This has not been strictly forbidden in AutoIt. However, it is NOT ADVISABLE to mix different datatypes in an Array. Especially the use of an Array inside another Array will severely affect the execution speed of your script.
49. What can you do to a macro?
a. Assign a value to them
b. Use in a expression
c. choice not listed
d. make it read - write
Answer: b
More Information:
Language Reference - Macros
50. Which one of these are NOT a operator?
a. @
b. =
c. /
d. &
Answer: a
More Information:
Language Reference - Operators
51. What is NOT a type of operator?
a. assignment
b. mathematical
c. comparison
d. Logical
e. dynamic
Answer: e
More Information:
Language Reference - Operators
52. Examine the following code:
$var = 20
If $var > 10 Then
MsgBox(0, "Example", "$var was greater than 10!")
Else
MsgBox(0, "Example", "$var was less than 10")
EndIf
What would be the outcome of the example?
a. True
b. False
C. Error
d. 0
Answer: A
More Information:
Conditional Statements
53. User functions are declared using the
a. Function......EndFunction
b. Func....EndFunc
c. Function....Fend
d. Func...Fend
Answer: b
More Information:
Language Reference - User Functions
54. Review the following code.
$val = 10
For $i = 1 To 10
$doubled = MyDouble($val)
MsgBox(0, "", $val & " doubled is " & $doubled)
$val = $doubled
Next
Exit
Func MyDouble($value)
$value = $value * 2
Return $value
EndFunc
How many times will the the number be doubled?
a. 5
b. 10
c. 20
d. 100
Answer: a
More Information:
Language Reference - User Functions
55. How can you make a comment and span multiple lines?
a. Add the macro @Returnline to the end of the line
b. Add an underscore " _" preceded by a blank is placed at the end of a "broken" line.
c. Add a carriage return to the end of the line
d. Add "&_Return" to the end of the line. You must use double quotes when doing this.
Answer: b
More Information:
Language Reference - Comments
56. What is the best method to comment large blocks of script? (Pick 2)
a. Use ";;;;;" then the macro @Returnline to start, to stop use ";;;;;" then the macro @ReturnStop.
b. use #CS to start, and to stop use #CE
c. Use #Comment-start and #Comment-end
d. Use @Comment-start and @Comment-end
e. Use @CS to start, and @CE to stop
Answer: b, c
More Information:
Language Reference - Comments
57. A GUI consist of what?
a. The start button, taskbar, and desktop icons
b. The start button, taskbar, mouse pointer, and desktop icons
c. One or more windows and each window contains one or more controls.
D. A DOS window to enter commands
Answer: c
More Information:
GUI Reference
58. Before writing any GUI scripts you must include the file
a. GUIConstants.aut
b. GUIConstants.au3
c. GUICtrlConstants.aut
d. GUICtrlConstants.au3
Answer: b
More Information:
GUI Reference
59. Review the following script:
#include
GUICreate("Hello World", 200, 100)
GUISetState(@SW_SHOW)
Sleep(2000)
Sleep(2000) is 2 seconds.
GUI Reference
60. Review the following script:
#include
GUICreate("Hello World", 200, 100)
GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
GUICtrlCreateButton("OK", 70, 50, 60)
GUISetState(@SW_SHOW)
Sleep(20000)
What will happen when you run this script, and click on the "OK" button?
a. The window will close in 20 seconds, and the OK button will blink.
b. Nothing. The script is missing a loop statement
c. The OK button will not react when clicked. The window will close in 20 seconds.
d. The window will close in 2 seconds.
Answer: c
More Information:
GUI Reference
61. What are the two basic GUI modes? (Pick 2)
a. MessageEvent
b. OnMessage
c. MessageLoop
d. EventLoop
e. OnEvent
f. OnMessageEvent
Answer: C, E
More Information:
GUI Reference - MessageLoop Mode
GUI Reference - OnEvent Mode
As mentioned above there are two basic GUI modes: MessageLoop
mode and OnEvent mode. The modes are simply two different ways of reacting to GUI events. The mode you choose will depend on personal preference, and to some extent the type of GUI you wish to create. Both modes are equally capable of creating any GUI you wish but sometimes one mode is more suited to a task than the other.
The default mode is the MessageLoop mode. To switch to OnEvent mode use
Opt("GUIOnEventMode", 1).
Message-loop Mode (default)
In the Message-loop mode your script will spend the majority of its time in a tight loop. This loop will simply poll the GUI using the GUIGetMsg function. When an event has occurred the return value of the
GUIGetMsg function will show the details (a button is clicked, the GUI has been
closed, etc.).
In this mode you will only receive events while you are actively polling the GUIGetMsg function so you must ensure that you call it many times a second
otherwise your GUI will be unresponsive.
This mode is best for GUIs where the GUI is "king" and all you care about is waiting for user events.
See this page for a more detailed explanation of the MessageLoop mode.
OnEvent Mode
In the OnEvent mode instead of constantly polling the GUI to find out if anything has happened you make the GUI temporarily pause your script and call a
pre-defined function to handle the event. For example, if the user clicks Button1 the GUI halts your main script and calls a previously defined user function that deals with Button1. When the function call is completed the main script is resumed. This mode is similar to the Visual Basic forms method.
This mode is best for GUIs where the GUI is of secondary importance and your script has other tasks to perform in addition to looking after the GUI.
See
this page for a more detailed explanation of the
OnEvent mode
62. What are the three event messages that GUIGetMsg will return?
a. No Event
b. Dynamic Event
c. Array Event
d. Control Event
e. System Event
Answer: a, d, e
More Information:
GUI Reference - MessageLoop Mode
63. Review the following script:
#include <GUIConstants.au3>
GUICreate("Hello World", 200, 100)
GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
$okbutton = GUICtrlCreateButton("OK", 70, 50, 60)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $okbutton
MsgBox(0, "GUI Event", "You pressed OK!")
Case $msg = $GUI_EVENT_CLOSE
MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
ExitLoop
EndSelect
WEnd
What will happen when you click the "OK" button when you run the script?
a. Nothing
b. THe GUI will close
c. A message box will appear
d. error message
Answer: c
More Information:
#include <GUIConstants.au3>
GUICreate("Hello World", 200, 100) ;makes a GIU
GUICtrlCreateLabel("Hello world! How are you?", 30, 10) ;makes a
lable
$okbutton = GUICtrlCreateButton("OK", 70, 50, 60) ;makes a
button
GUISetState(@SW_SHOW) ;
While 1
$msg = GUIGetMsg() ;checks the state of the GUI
Select
Case $msg = $okbutton ;When this happens, a
msgbox will be displayed
MsgBox(0, "GUI Event", "You pressed OK!")
;message box with ok button
Case $msg = $GUI_EVENT_CLOSE ;When this happens,
a msgbox will be displayed
MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
;message box with ok button
ExitLoop
EndSelect
WEnd