<div>Hi liwenna & Daniela,</div>
<div> </div>
<div>Thanks for your reply. I tried the suggestion from both of you. </div>
<div>Daniela's script generated the following error message</div>
<div> "Encountered: '*' </div>
<div>expecting: <consonant>, <identifier>, <function>, system.</div>
<div> </div>
<div>Then my colleague suggested me delete the two lines about netstation, it works fine now. </div>
<div> </div>
<div>I appreciate your input!</div>
<div> </div>
<div>Yan</div>
<div> </div>
<div> </div>
<div> </div>
<div class="gmail_quote">On Wed, Nov 11, 2009 at 11:11 AM, Daniela Pfabigan <span dir="ltr"><<a href="mailto:daniela.pfabigan@univie.ac.at" target="_blank">daniela.pfabigan@univie.ac.at</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>hi!<br><br>you could try the following script lines which we modified a little bit<br>after downloading them from PST website or from an user forum and insert<br>
any lines to send information via the parallel port<br><br>If (Get*UserBreakState* <> 0) Then<br> Display.Canvas.Clear<br> Display.Canvas.Text 150, 150, "Unexpected break!"<br> Sleep 1000<br>
<br> Mouse.ShowCursor True<br>Dim r As Integer<br><br><br>r = AnswerBox( "Please select if you are ready:" & chr(10)+chr(13), "Continue")<br> Set*UserBreakState* 0<br><br>End If<br><br>
<br>Cheers,<br>Daniela<br><br>liwenna schrieb:<br>
<div>
<div></div>
<div>> Hey Yan,<br>><br>> I don't really have a solution (as I never used this parallelport<br>> config thing and I have no idea what the function of 'userbreakstate'<br>> is for...) but that is probably where your problem lies. As you can<br>
> see in line three (If (GetUserBreakState <> 0) Then ) all the script<br>> between 'Then' and 'End If' will only be executed if userbreakstate is<br>> NOT (<>) 0. In the forelast line of the piece of code you posted<br>
> (SetUserBreakState 0) userbreakstate is set to 0 and therefore this<br>> code cannot run twice (seeing as "If (GetUserBreakState <> 0)" will no<br>> longer be valid after it ran once).<br>><br>
> I think that that's the source of your problem, but I unfortunately<br>> don't have a solution (other than simply removing both lines but that<br>> probably doesn't do the trick) and it also does not explain why e-<br>
> prime quits altogether when you try it twice...<br>><br>><br>> So for what it's worth: I hope the above is somewhat helpful.<br>> Hopefully others can shine some light on the whole userbreakstate-<br>
> thing... what and why and all that.<br>><br>> Best,<br>><br>> liwenna<br>><br>> On Nov 11, 4:09 pm, Yan Yu <<a href="mailto:yan...@gmail.com" target="_blank">yan...@gmail.com</a>> wrote:<br>><br>
>> Hi Eprimers,<br>>><br>>> I used a script to excute the pause function, however, during the<br>>> experiment, whenever I pause it a second time, eprime will quit the task.<br>>> My knowledge on scripting is minimal. I am wondering if anybody can help me<br>
>> out.<br>>><br>>> Here is the inline script that I placed at the beginning of each block.<br>>><br>>> 'Check for UserBreakState<br>>> 'Pause2 is run only if Ctrl+Shift is pressed<br>
>> If (GetUserBreakState <> 0) Then<br>>> 'Incorrect CLng Object reference Pause2.InputMasks.Add<br>>> Keyboard.CreateInputMask("{SPACE}", "", CLng(Pause.Duration), CLng("1"),<br>
>> ebEndResponseActionTerminate, CLogical("Yes"), "", "", "ResponseMode:All<br>>> ProcessBackspace:Yes")<br>>> NetStation_SendTrialEvent c, Pause2<br>>> NetStation_SendTRSPEvent c, Pause2<br>
>> Pause2.InputMasks.Add Keyboard.CreateInputMask("{SPACE}", "",<br>>> CLng(Pause2.Duration), CLng("1"), ebEndResponseActionTerminate,<br>>> CLogical("Yes"), "", "", "ResponseMode:All ProcessBackspace:Yes")<br>
>> Pause2.Run<br>>> 'Added code<br>>> SetUserBreakState 0<br>>> End If<br>>><br>>> Thanks a lot,<br>>><br>>> Yan<br>>><br>> ><br>><br>><br><br><br><br>
<br>
--~--~---------~--~----~------------~-------~--~----~<br>
You received this message because you are subscribed to the Google Groups "E-Prime" group. <br> To post to this group, send email to e-prime@googlegroups.com <br> To unsubscribe from this group, send email to e-prime+unsubscribe@googlegroups.com <br> For more options, visit this group at http://groups.google.com/group/e-prime?hl=en<br>
-~----------~----~----~----~------~----~------~--~---<br>
<br>