pause function

liwenna liwenna at gmail.com
Wed Nov 11 15:36:01 UTC 2009


Hey Yan,

I don't really have a solution (as I never used this parallelport
config thing and I have no idea what the function of 'userbreakstate'
is for...) but that is probably where your problem lies. As you can
see in line three (If (GetUserBreakState <> 0) Then ) all the script
between 'Then' and 'End If' will only be executed if userbreakstate is
NOT (<>) 0. In the forelast line of the piece of code you posted
(SetUserBreakState 0) userbreakstate is set to 0 and therefore this
code cannot run twice (seeing as "If (GetUserBreakState <> 0)" will no
longer be valid after it ran once).

I think that that's the source of your problem, but I unfortunately
don't have a solution (other than simply removing both lines but that
probably doesn't do the trick) and it also does not explain why e-
prime quits altogether when you try it twice...


So for what it's worth: I hope the above is somewhat helpful.
Hopefully others can shine some light on the whole userbreakstate-
thing... what and why and all that.

Best,

liwenna

On Nov 11, 4:09 pm, Yan Yu <yan... at gmail.com> wrote:
> Hi Eprimers,
>
> I used a script to excute the pause function, however, during the
> experiment, whenever I pause it a second time, eprime will quit the task.
> My knowledge on scripting is minimal. I am wondering if anybody can help me
> out.
>
> Here is the inline script that I placed at the beginning of each block.
>
> 'Check for UserBreakState
> 'Pause2 is run only if Ctrl+Shift is pressed
> If (GetUserBreakState <> 0) Then
>  'Incorrect CLng Object reference Pause2.InputMasks.Add
> Keyboard.CreateInputMask("{SPACE}", "", CLng(Pause.Duration), CLng("1"),
> ebEndResponseActionTerminate, CLogical("Yes"), "", "", "ResponseMode:All
> ProcessBackspace:Yes")
>  NetStation_SendTrialEvent c, Pause2
>     NetStation_SendTRSPEvent c, Pause2
>  Pause2.InputMasks.Add Keyboard.CreateInputMask("{SPACE}", "",
> CLng(Pause2.Duration), CLng("1"), ebEndResponseActionTerminate,
> CLogical("Yes"), "", "", "ResponseMode:All ProcessBackspace:Yes")
>  Pause2.Run
>  'Added code
>  SetUserBreakState 0
> End If
>
> Thanks a lot,
>
> Yan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the Eprime mailing list