DMDX Help.


Save Counters Keyword

<SaveCounters [text] [option]>

option:
macrostoo

    Switch to save all defined counters to a file, if the macrostoo option (as of version 5.3.1.8) has been used macros are saved as well.   If text is omitted the name of the item file is used otherwise text is used as a base to form a file name, if you want to use non-ASCII characters then text must be quoted and the Unicode option must be in use.   Any extension is removed and then it gets an underscore added to it along with any subject id and then the extension .txt is added to it and a file then created.  As of version 4.2.1.0 of DMDX this can be in the system or user temporary directory (%temp%) if the item file directory is read only (or otherwise incapable of being written to).   Each counter is then written to a line in it along with it's current value at the time of parsing the <SaveCounter> keyword (not at the item's end or the time that the frame is displayed).   Counters can be loaded with the <RestoreCounters> keyword.

    For example we have a two part experiment where a series of faces are presented and the subject is asked whether they know the face or not.  Some time afterwards (maybe days) another measure is to be done on only the faces the subject knew.  The first item file sets up a counter for each item and sets the counter to a value depending on the response of the subject:

 

<ep> s1 g6 <zil> <zor> <fd 300> <t 4000>

  <id "keyboard"> <umpr> <umnr>

  <vzk +a> <vzk +g> <vzk +l> <mpr +a> <mpr +g> <mpr +l>

  <videomode 1024,768,16,0>

  <nfb> <cr>  </ep>

 

$0 @-1 "PLEASE INDICATE IF YOU CAN NAME THE FACE,", "HAVE A FEELING OF KNOWING,", @1 "OR DON'T KNOW THE NAME", <x 0.24> <y 0.7> "PRESS SPACEBAR TO START"

mR:<mwb +a,1000, +g,2000, +l,3000 binr,4000>:;$

 

+21 <ms% 2000> "KNOW               FEELING OF KNOWING           DON'T KNOW"/ * <jpg -1,48> %0 "2camerondiaz"/! <x 0.08> <y 0.75> "KNOW               FEELING OF KNOWING           DON'T KNOW" ~R ;

~1000 <set c21=1> <bu 5000>;

~2000 <set c21=2> <bu 5000>;

~3000 <set c21=3> <bu 5000>;

~4000<set c21=4>;

~5000; 

 

+14 <ms% 2000> "KNOW               FEELING OF KNOWING           DON'T KNOW"/ * <jpg -1,48> %0 "2mikemyers"/! <x 0.08> <y 0.75> "KNOW               FEELING OF KNOWING           DON'T KNOW" ~R ;

~1000 <set c14=1> <bu 5000>;

~2000 <set c14=2> <bu 5000>;

~3000 <set c14=3> <bu 5000>;

~4000<set c14=4>;

~5000;

  

+67 <ms% 2000> "KNOW               FEELING OF KNOWING           DON'T KNOW"/ * <jpg -1,48> %0 "2katebeck"/! <x 0.08> <y 0.75> "KNOW               FEELING OF KNOWING           DON'T KNOW" ~R ;

~1000 <set c67=1> <bu 5000>;

~2000 <set c67=2> <bu 5000>;

~3000 <set c67=3> <bu 5000>;

~4000<set c67=4>;

~5000; 

 

$0 <savecounters> "The End.  Thank You.";$

 

 

    The second  item file loads those counters and only displays those that the subject knew by responding with the A key earlier:
 

<ep> s210 g3 <zil> <zor> <fd 300> <t 100000>

  <id "keyboard"> <umpr> <umnr> <vzk +c> <vzk +n> <mpr +c> <mnr +n>  

  <videomode 1024,768,16,0>

  <nfb> <cr>  </ep>

 

$0 @-1 "You responded KNOW to the following items.", @1 "Please say ALOUD the name of each face you see.", @3 "Press Spacebar to start."

<restorecounters itemfile1>;$

 

~1000 <bi 4000, c21.ne.1>;

+21 * <jpg -1,48>  "2camerondiaz";

~4000;

 

~1000 <bi 4000, c14.ne.1>;

+14 * <jpg -1,48>  "2mikemyers";

~4000;

 

~1000 <bi 4000, c67.ne.1>;

+67 * <jpg -1,48>  "2katebeck";

~4000;

 

$0  "The End.  Thank You.";$



DMDX Index.