Millisecond Forums

Data types?

https://forums.millisecond.com/Topic26027.aspx

By Laura.Kwako - 11/7/2018

Our IT department asked about which data type (text, integer) each variable is in the different tasks we're using.  Is there a quick place to find that, or should we look at the sample output files for that information?

Thanks!
Laura
By Dave - 11/7/2018

Laura.Kwako - Wednesday, November 7, 2018
Our IT department asked about which data type (text, integer) each variable is in the different tasks we're using.  Is there a quick place to find that, or should we look at the sample output files for that information?

Thanks!
Laura

Variables in Inquisit have no fixed or a-priori declared data type, i.e. whether

<values>
/ example = 1
</values>

is treated as a string, integer, etc. depends on how it's used throughout the code, and the runtime will figure out the proper data type in each context on the fly. Since data output is highly configurable, there is no way to make a blanket statement about the data type of each logged variable either, this would indeed depend entirely on the script / its specific output.
By danaleighton - 11/7/2018

Dave - Wednesday, November 7, 2018
is treated as a string, integer, etc. depends on how it's used throughout the code, and the runtime will figure out the proper data type in each context on the fly. Since data output is highly configurable, there is no way to make a blanket statement about the data type of each logged variable either, this would indeed depend entirely on the script / its specific output.

Interesting. So we could for example, do something like:
<values>
/ number = 1
</values>
<trial sometrial>
(someattributes)
</trial>
<trial someothertrial>
/ values.number = "A"
(someotherattributes)
</trial>

In this case, values.number in the context of sometrial would be an integer, but in the context of someothertrial, it would be a string?

By Dave - 11/7/2018

danaleighton - Wednesday, November 7, 2018
Dave - Wednesday, November 7, 2018
is treated as a string, integer, etc. depends on how it's used throughout the code, and the runtime will figure out the proper data type in each context on the fly. Since data output is highly configurable, there is no way to make a blanket statement about the data type of each logged variable either, this would indeed depend entirely on the script / its specific output.

Interesting. So we could for example, do something like:
<values>
/ number = 1
</values>
<trial sometrial>
(someattributes)
</trial>
<trial someothertrial>
/ values.number = "A"
(someotherattributes)
</trial>

In this case, values.number in the context of sometrial would be an integer, but in the context of someothertrial, it would be a string?


Apart from your example not being valid syntax, yes, it's perfectly possible for a given value to change it's data type on a trial-by-trial basis. E.g.

<values>
/ myvalue = 0
</values>

<list someintegers>
/ items = (10, 100, 1000, 10000)
</list>

<list somestrings>
/ items = ("a cat", "a dog", "a cow", "a bird")
</list>


<trial a>
/ ontrialbegin = [
values.myvalue = list.someintegers.nextvalue;
values.myvalue = values.myvalue / 2;
]
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<trial b>
/ ontrialbegin = [
values.myvalue = list.somestrings.nextvalue;
values.myvalue = concat(values.myvalue, " says...?")
]
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("<%values.myvalue%>")
</text>

<block myblock>
/ trials = [1-4 = sequence(a,b)]
</block>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency values.myvalue)
/ separatefiles = true
</data>




By Laura.Kwako - 11/7/2018

Dave - Wednesday, November 7, 2018
Laura.Kwako - Wednesday, November 7, 2018
Our IT department asked about which data type (text, integer) each variable is in the different tasks we're using.  Is there a quick place to find that, or should we look at the sample output files for that information?

Thanks!
Laura

Variables in Inquisit have no fixed or a-priori declared data type, i.e. whether

<values>
/ example = 1
</values>

is treated as a string, integer, etc. depends on how it's used throughout the code, and the runtime will figure out the proper data type in each context on the fly. Since data output is highly configurable, there is no way to make a blanket statement about the data type of each logged variable either, this would indeed depend entirely on the script / its specific output.

Ah, got it.  Thanks for the reply.  I think we'll have to go through them individually and identify output for our programmer.  Thanks again!