the "concat" string function


Author
Message
MattO
MattO
Partner Member (821 reputation)Partner Member (821 reputation)Partner Member (821 reputation)Partner Member (821 reputation)Partner Member (821 reputation)Partner Member (821 reputation)Partner Member (821 reputation)Partner Member (821 reputation)Partner Member (821 reputation)
Group: Forum Members
Posts: 15, Visits: 1

Hi,


Suppose I had this....


/ onblockbegin = [text.sometext = (concat("basket", "ball"))]


Then the text "sometext" would appear as basketball, instead of what it used to be. What I'm wondering is this - Is it possible to use 'concat' to add two 'text' phrases together? Example....


/ onblockbegin = [text.sometext = (concat((sometext), (sometext2)))] =  "sometext + sometext2"?


I know this is invalid syntax, but hopefully you can see what i'm trying to do here.


Basically what i'm trying to do is this - below is a sample script......


<block someblock>
/ trials = [1 = sometrial]
/ bgstim = (sometext)
/ onblockbegin = [text.opentext_p = (concat (sometext + sometext2))]??????
</block>


<text sometext>
/items = someitem
</text>


<item someitem>
/1 = "1. You are about to board a plane. The chance of this plane crashing is "
</item>


<text sometext2>
/items = someitem2
/select = noreplace
</text>

<item someitem2>
/1 = "l_w"
/2 = "lo_"
/3 = "_ow"
</item>


So I have sometext as a background stimulus and I want the end of it to include one randomly generated item from sometext 2's list......eg. it might randomly generate it so that it reads -


1. You are about to board a plane. The chance of this plane crashing is l_w.


then the next time the script is run it might generate it to read -


1. You are about to board a plane. The chance of this plane crashing is lo_.


and so on....


can i use "/onblockbegin = [text.sometext = (concat????" to do this? If not, how might I go about doing this? Hope this makes sense.


Thanks


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search