More script commands (3) [Eye and Pen v2] 10. Looping 11. List LoopIfLabelIsBelow LoadList RandomizeList RandomizeListRange ResetList 12. keywords %L%

Slides:



Advertisements
Similar presentations
Eye and Pen currently support: EyelinkII, Eyelink 1000 (S.R. research, Ltd.) i-ViewX HED (SensoMotoric Instruments GmbH, S.M.I.) ASL 504 (Applied Science.
Advertisements

Arrays A list is an ordered collection of scalars. An array is a variable that holds a list. Arrays have a minimum size of 0 and a very large maximum size.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
3. Playing a stimulus 4. Waiting for an event2. Start / stop recording DisplayPic / HidePicture PlaySound / StopSound DisplayMsg / HideMessage WaitForKeyPress.
VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Matlab Intro Simple introduction to some basic Matlab syntax. Declaration of a variable [ ] Matrices or vectors Some special (useful) syntax. Control statements.
Chapter 10 Linking and Loading. Separate assembly creates “.mob” files.
A script: what’s that thing ? A sort of language to tell Eye and Pen what he has to do, like a recipe: now do this, then do that, etc.  It allows to use.
Introducing C++ Elements. CSCE 1062 Outline Main algorithms’ constructs General form of a C++ program {section 2.5} C++ language elements {section 2.1}
Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]
Automate tasks: EPKeys April 2012, Mshs, University of Poitiers, France EPKeys is a keyboard key presses simulator designed to have Eye and Pen repeat.
Programming with Microsoft Visual Basic th Edition
NumericStepper Component You can use the numeric stepper anywhere you want a user to select a numeric value. You can use the numeric stepper anywhere you.
JavaScript Part for Repetition Statement for statement Cpecifies each of the items needed for counter-controlled repetition with a control variable.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Objectives In this chapter, you will learn about:
Tutorial 12 Working with Arrays, Loops, and Conditional Statements
1. Menu File | Acquisition | Simple 2. Type in a name for the participant 3. Click on the ”Go” button to start recording Ticking this box will prevent.
11 Chapter 4 LOOPS AND FILES. 22 THE INCREMENT AND DECREMENT OPERATORS To increment a variable means to increase its value by one. To decrement a variable.
Pre-workshop session Poitiers, july 1 st 2015 Pre-workshop session Poitiers, july 1 st 2015.
NetSync: script-based acquistion managed in a network environment NetSync was devised to solve a simple problem: how to manage an experiment with two or.
Lilian Blot CORE ELEMENTS COLLECTIONS & REPETITION Lecture 4 Autumn 2014 TPOP 1.
Chapter 4 MATLAB Programming Combining Loops and Logic Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
THE BIG PICTURE. How does JavaScript interact with the browser?
Builtins, namespaces, functions. There are objects that are predefined in Python Python built-ins When you use something without defining it, it means.
Handling Lists F. Duveau 16/12/11 Chapter 9.2. Objectives of the session: Tools: Everything will be done with the Python interpreter in the Terminal Learning.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
1 Session 3: Flow Control & Functions iNET Academy Open Source Web Programming.
Project 1 Due Date: September 25 th Quiz 4 is due September 28 th Quiz 5 is due October2th 1.
4 1 Array and Hash Variables CGI/Perl Programming By Diane Zak.
CIS 234: LOOPS Adapted from materials by Dr. Donald Bell, 2000 (updated April 2007)
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Chapter 6: The Repetition Structure
Chapter 2 Functions and Control Structures PHP Programming with MySQL 2 nd Edition.
Chapter 2 Pseudocode. Objectives To introduce common words, keywords and meaningful names when writing pseudocode To define the three basic control structures.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
PHP Constructs Advance Database Management Systems Lab no.3.
Design of Bio-Medical Virtual Instrumentation Tutorial 2.
I Power Higher Computing Software Development High Level Language Constructs.
More about Strings. String Formatting  So far we have used comma separators to print messages  This is fine until our messages become quite complex:
JavaScript, Fourth Edition
ITERATIVE STATEMENTS. Definition Iterative statements (loops) allow a set of instruction to be executed or performed several until condition are met.
Shell Scripting – Putting it All Together. Agenda Escaping Characters Wildcards Redirecting Output Chaining and Conditional Chaining Unnamed and Named.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Repetition Statements (Loops). 2 Introduction to Loops We all know that much of the work a computer does is repeated many times. When a program repeats.
Sorry, the pen lost control. Anyway, you need to download both the.vbp and the.frm for each project. I looked at PrCalc, I did not look at inventory.
In a number of script commands, you will have to mention filenames (pictures, etc.). For a picture, Eye and Pen will search in the “stimuli” folder. This.
To gain an overview of the session, the session log file (.LOG) contains the time when each event occurs. The session has its own timer, where “hour zero"
Fourth Quarter.  Involves loops or cycles ◦ Loops: means that a process may be repeated as long as certain condition remains true or remains false. ◦
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Script commands by category 1. Files and directories Start and stop data recording, set script default directories for pictures and data. A quick preview…
 2008 Pearson Education, Inc. All rights reserved JavaScript: Arrays.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
>> Fundamental Concepts in PHP
Control Flow Constructs: Conditional Logic
Scripts & Functions Scripts and functions are contained in .m-files
File Handling Programming Guides.
T. Jumana Abu Shmais – AOU - Riyadh
Introduction to TouchDevelop
CHAPTER 6: Control Flow Tools (for and while loops)
The structure of programming
Introduction to Computer Science
CPS120: Introduction to Computer Science
Introduction to Computer Science
Presentation transcript:

More script commands (3) [Eye and Pen v2] 10. Looping 11. List LoopIfLabelIsBelow LoadList RandomizeList RandomizeListRange ResetList 12. keywords %L% %M% April 2012, Mshs, University of Poitiers, France 13. Counting with labels SetLabelCounter AddToLabelCounter SubtractFromLabelCounter Hands on scripts 12. Keywords (continued) %R value % % Keyword : Label %

10. Looping Definition: a sequence of commands that is executed repeatedly. Following are basic scripts elements used to create a loop LoopIfLabelIsBelow (Label,Iterations,MustCloseRec) [ Eye and Pen 2 ] This command has the script interpretor to go to a label, until a condition is met: this labels counter value should be lower than a limit April 2012, Mshs, University of Poitiers, France Replace Label with the name of the label to check. Replace iterations with the maximum number of loops you require. Replace MustCloseRec with TRUE if an acquisition data file should be closed before jumping to the label. Example: LoopIfLabelIsBelow(Start,6,FALSE) Translation: While the counters value of the label named Start is lower than 6, then go to this label.

11. List [ Eye and Pen 2 ] LoadList (FileName) Loads items for the list from a text file. Replace FileName with the name of the file containing the items. Items are added at the end of the list, they do not replace the list content. Ex: LoadList(MyList.txt) RandomizeList Shuffle items in the list ResetList Empties the list. The list is an unique collection of items in which you can put words, numbers, sentences, filenames, etc., anything that can be written with letters and numbers. Any element in list can be set or retrieved April 2012, Mshs, University of Poitiers, France RandomizeListRange (Begin,End) Shuffle items in part of the list. Replace Begin and End with the number of the first and last item of the set to randomize. This command can be used to subdivide the list into sub-blocks separately randomized.

12. Keywords Keywords are special symbols, replaced with values computed when script is run. Keywords are mainly used in command parameters. Within the whole set of keywords, %L% and %M% are particularly devoted to list %L% [ Eye and Pen 2 ] Retrieves the Nth item in the list. N is the value of the last label counters value read by the script interpretor (remember: script interpretor has a memory for this) %M% [ Eye and Pen 2 ] When script is executed, %M% is replaced with the current number of items in the list April 2012, Mshs, University of Poitiers, France Example: :Loop DisplayMsg(%L%,1000,-1,-1,TRUE) Jumpto(Loop) List contains: Hello world On first pass, Loop will count 1 and thus DisplayMsg will display item n°1 in list: Hello On second pass, Loop will count 2 and DisplayMsg will display item n°2 in list: World

Exercise 5 Write a script such that a list of word is displayed, one word at a time, each second. (list of word is in the file WordsList.txt in the Stimuli folder) LoadList(WordsList.txt) :Start DisplayMsg(%L%,1000,-1,-1,TRUE) LoopIfLabelIsBelow(Start,%M%,FALSE) DisplayMsg(Thats all !,3000,-1,-1,TRUE) Hands on scripts ! April 2012, Mshs, University of Poitiers, France

Exercise 6 Write a script such that a participant copies a list of words presented in a random order, one by one. LoadList(WordsList.txt) RandomizeList :Start DisplayMsg(%L%,-1,-1,-1,TRUE) OpenRec(_%L%_%I%) WaitForTabZoneAt(35725,20987,44697,27932,FALSE,TRUE) CloseRec LoopIfLabelIsBelow(Start,%M%,FALSE) DisplayMsg(Thats all,3000,-1,-1,TRUE) With pictures containing each a single word, named from the word: D isplayPic(%L%.bmp,-1,-1,-1) give a full file name April 2012, Mshs, University of Poitiers, France Hands on scripts !

10-12 April 2012, Mshs, University of Poitiers, France %R value % [ Eye and Pen 2 ] When script is executed, %R value % is replaced with a random number between 0 and Value (excluded). Ex: Wait(%R500%) The script will be paused for a random duration between 0 and 500 milliseconds % Keyword : Label % [ Eye and Pen 2 ] Use a label counters value with a keyword. Keyword should be replaced with a keyword, either I, L or R, and Label with the name of an existing script label. Example: :BigLoop :SmallLoop DisplayMsg(%L:BigLoop%,1000,-1,-1,TRUE) %L:BigLoop% specifies a labels counter ( BigLoop ) instead of the default label counters value (the last label encounter by script interpretor, here SmallLoop).

13. Couting with Labels [ Eye and Pen 2 ] SetLabelCounter (Label,Value) Assign a value to a labels counter. Replace Label with the name of label you wish to set and Value with… the value. Ex: SetLabelCounter(MyCounter,6) AddToLabelCounter (Label,Value) Add a number to a label counters value. Replace Label with the name of the label you wish to modify and Value with the number to sum. The value of a labels counter can be modified April 2012, Mshs, University of Poitiers, France SubtractFromToLabelCounter (Label,Value) Add a number to a label counters value. Replace Label with the name of the label you wish to modify and Value with the number to subtract. Hint: instead of setting numbers as value, why not use keywords ?