Send Triggers EEG

78 views
Skip to first unread message

Maria Eugenia De Lahoz Naveiro

unread,
May 3, 2021, 6:45:00 AMMay 3
to E-Prime
Hii!!

I am design an S1-S2 sound experiment, where S1 always is one type of tones but S2 can are two types of tones.

For my version of e-prime, I have to write an in line and the scrip havee an if..then.

I define a  Const .... As String to define the two diferent route of the two types S2 stimulus. But the "bloop if..then" fail, them msgbox display me that the "stimulus" attributes route are different than Const route .That is, the Cost no display the "\" in his route.

Const S2LowHz As String = "C:\destok\stimulos\tones\S2200v2.wav."

If ("attributeS2") = S2LowHz Then 

msgbox display :  C:\destok\stimulos\tones\S2200v2.wav.  C:destokstimulostonesS2200v2.wav

For this reason, it does't do the comparative action and does't send the trigger correctly

How can I solve that?

Thaks for your help!

David McFarlane

unread,
May 4, 2021, 10:39:51 AMMay 4
to e-p...@googlegroups.com
Try running the following in an InLine and see what happens:

Const S2LowHz As String = "C:\destok\stimulos\tones\S2200v2.wav."
MsgBox S2LowHz

When I run this in EP2, I get a message box with the message

C:

and nothing else -- i.e., it does not display the expected
"C:\destok\stimulos\tones\S2200v2.wav."

So what happened? Well, within text strings E-Prime treats the "\"
character as an "escape" character -- see
en.wikipedia.org/wiki/Escape_character for more background on this
concept. So when EP reached "\d" in the string it treated that as an
escape sequence instead of literal "\d". Etc.

How can you work around this? Two approaches:

(1) As explained in the Wikipedia article (which I myself edited to
include this information), escape the "\" with another "\", e.g.,
"C:\\destok\\stimulos\\tones\\S2200v2.wav." Please try this in EP2 and
see what happens!

(2) Use "/" instead of "\" in both your Const and your attribute. It
turns out that E-Prime and Windows will accept a normal forward-slash
for a path separator (which is what the rest of the computing world
uses). Hint: I much prefer this approach. See also
support.pstnet.com/hc/en-us/articles/360017774154-INFO-Use-for-path-separation-for-E-Objects-with-filename-property-16554-

One side note: I notice that your string
"C:\destok\stimulos\tones\S2200v2.wav." ends with a period, I suspect
the final period is a mistake.

Best,
-- David McFarlane


On 2021-05-03 Mon 6:45 AM, Maria Eugenia De Lahoz Naveiro wrote:
> Hii!!
>
> I am design an S1-S2 sound experiment, where S1 always is one type of tones
> but S2 can are two types of tones.
>
> For my version of e-prime, I have to write an in line and the scrip havee
> an *if..then*.
>
> I define a *Const .... As String* to define the two diferent route of the
> two types S2 stimulus. But the *"bloop if..then" fail,* them *msgbox* display

Maria Eugenia De Lahoz Naveiro

unread,
May 26, 2021, 12:06:55 PMMay 26
to E-Prime
Hi David,


Sorry for my delayed respons, thanks for your options. Another possibility that also works is to use ASCII code corresponding to "\" ( "+ CHAR&(92) +") 

For example: C:\destok\stimulos\tones\S2200v2.wav" --> Const FiguSquare As String = "C:" + "Desktop" + CHR$(92) + "stimulos" + CHR$(92) + "tones" + CHR$(92) + "S2200v2.wav"

Thanks!!
Reply all
Reply to author
Forward
0 new messages