VAS Speed..........

Daniel.J.Bates at wheaton.edu Daniel.J.Bates at wheaton.edu
Mon Jun 9 17:14:19 UTC 2003


Hi everyone...

I am in the process of programming a Visual-Analog Scale using e-basic, but I
am having trouble getting the computer to read the code fast enough.  Even
though I am using a Pentium 4 desktop computer and the code itself is quite
short, it is necessary to wait for .6-1.0 seconds between slider movements.
The VAS procedure consists of a label; a slideobject (which contains a piece
of text obtained from VASList and two pictures superimposed on each other); a
WaitObject (which is designed to wait an infinite amount of time for the
subject to press button 1-5); and some inline code.   The two pictures are
named Slider and Button; Slider is the scale along which the button moves.
When the subject presses "3", the program records the final position of the
button and moves to the next task in the paradigm.  The inline code is shown
below.  Is there a way of improving the speed so that it looks like a free
moving button (or at least stops looking jerky)?

E-basic Code for  VAS...

 Dim FinalSelection As Integer
 Dim ScreenWidth As Integer
 Dim NewButtonPosn As Integer
 Dim ButtonPosn As Integer
 Dim RealSliderWidth As Integer
 Dim slrLeft As Integer
 Dim slrRight As Integer
 Dim KeyAscii As Integer

 ScreenWidth = 640
 slrLeft = CSlideImage(Slide1.States.Item("Default").Objects(3)).X
 RealSliderWidth = CSlideImage(Slide1.States.Item("Default").Objects(3)).width
* ScreenWidth / 100
 slrRight = slrLeft + RealSliderWidth
 ButtonPosn = CSlideImage(Slide1.States.Item("Default").Objects(1)).X
 NewButtonPosn = ButtonPosn

 FinalSelection = 0

 KeyAscii = Wait1.Resp

 Select Case KeyAscii
   Case 1
     If ButtonPosn >= slrLeft + 10 Then
       NewButtonPosn = ButtonPosn - 10
     Else
       NewButtonPosn = slrLeft
     End If
   Case 2
     If ButtonPosn >= slrLeft + 1 Then
       NewButtonPosn = ButtonPosn - 1
     End If
   Case 3
       FinalSelection = 1
       MsgBox Str((ButtonPosn - slrLeft) * 100 / (slrRight - slrLeft)) + "
percent"
   Case 4
     If ButtonPosn <= slrRight - 1 Then
       NewButtonPosn = ButtonPosn + 1
     End If
   Case 5
     If ButtonPosn <= slrRight - 10 Then
       NewButtonPosn = ButtonPosn + 10
     Else
       NewButtonPosn = slrRight
	End If
 End Select

  CSlideImage(Slide1.States.Item("Default").Objects(1)).X = NewButtonPosn
  If FinalSelection = 0 Then
  	Goto Label1
  End If

Thank you in advance for your help.

Sincerely,
Daniel Bates



More information about the Eprime mailing list