Post by rocio on Oct 28, 2021 22:46:38 GMT
Hello!
I'm programming a "digit span task". The task shows strings of numbers sequentially. It starts with 3 numbers and it ends with 10. Each sequence is repeated twice.
I have a table like this:
span 1 2 3 4 5 6 7 8 9 10
3 3 1 9 x x x x x x x
3 7 2 5 x x x x x x x
4 4 2 9 6 x x x x x x
4 9 3 5 1 x x x x x x
So, in order to tell the script which number is needed, I need to call different columns whithin a trial! I keep thinking as a "for loop" solution, but is not possibble since when you call a col, with @ symbol, then you need to provide an integer, so it's not possible to put a variable after the @.
I have coded my task as follows.
task digitspan
keys 0 1 2 3 4 5 6 7 8 9
table My_Table
set &trialcount increase
set $spannum @1 # this sets how many numbers has the sequence
##### loop stim
set $spannum2 $spannum #creates an auxiliar variable
set $colnum 2 #creates a variable indexing where the actual numbers should start (cols 2, 3, 4 ...)
while $spannum2 != 0 ## loop until span is equal to 0
show bitmap @$colnum #I want the number after the @ iterate with each while cycle, so it will be, 2, 3, 4 ... BUT @ requires an integer, so it is not possible to call a variable
delay &stimulus_display_time #define el tiempo estÃmulo
set $spannum2 decrease
set $colnum increase
while-end
Please, help! I will be soooooooooooo grateful to read you guys!
I'm programming a "digit span task". The task shows strings of numbers sequentially. It starts with 3 numbers and it ends with 10. Each sequence is repeated twice.
I have a table like this:
span 1 2 3 4 5 6 7 8 9 10
3 3 1 9 x x x x x x x
3 7 2 5 x x x x x x x
4 4 2 9 6 x x x x x x
4 9 3 5 1 x x x x x x
So, in order to tell the script which number is needed, I need to call different columns whithin a trial! I keep thinking as a "for loop" solution, but is not possibble since when you call a col, with @ symbol, then you need to provide an integer, so it's not possible to put a variable after the @.
I have coded my task as follows.
task digitspan
keys 0 1 2 3 4 5 6 7 8 9
table My_Table
set &trialcount increase
set $spannum @1 # this sets how many numbers has the sequence
##### loop stim
set $spannum2 $spannum #creates an auxiliar variable
set $colnum 2 #creates a variable indexing where the actual numbers should start (cols 2, 3, 4 ...)
while $spannum2 != 0 ## loop until span is equal to 0
show bitmap @$colnum #I want the number after the @ iterate with each while cycle, so it will be, 2, 3, 4 ... BUT @ requires an integer, so it is not possible to call a variable
delay &stimulus_display_time #define el tiempo estÃmulo
set $spannum2 decrease
set $colnum increase
while-end
I had another script with a random numer generator, BUT, it is appearently too heavy, since it takes few seconds between one trial and another. Please, help! I will be soooooooooooo grateful to read you guys!