HomeLecturerSessionsProgrammingContact

Scripts Library

Several useful E-Basic inline scripts are collected as follow, which will make your design more flexible and intelligent.

Random Display Time:

Stimulus.duration=random(500,1000)

Connect Eprime to ERP:

Open Port(write code before stimulus):

Stimulus.OnsetSignalEnabled=Ture

Stimulus.OnsetSignalPort=&H378

Close Port((write code after stimulus)):

Stimulus.OffsetSignalEnabled=Ture

Stimulus.OffsetSignalPort=&H378

Set Mark:

Stimulus.OnsetSignalData=c.GetAttrib("Code")

Multiple Choice:

if Stimulus.resp="1" or Stimulus.resp="3" then

Write Port &H378, c.GetAttrib("Stimulus.resp")

else

Wite Port &H378,2

end if

Exercise again or not:

if Stimulus.resp="A" then

goto Lable1

else

goto Label2

end if

Subject rest or not:

dim a as Integer

a=c.GetAttrib("List1.sample")

if a mod 50=0 then

msgbox("It is time to rest, you have finished "&int(a/50)&"/10"&", Press SPACE to continue")

end if