• Jueves 28 de Marzo de 2024, 15:16

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - alex1

Páginas: [1]
1
Visual Basic 6.0 e inferiores / timer
« en: Lunes 19 de Diciembre de 2011, 13:56 »
hola a todos

Agradeceria que me ayudarais, ya que lo que estoy haciendo es una presentación para un trabajo de máster.
Estoy utilizando un programa basado en en basic. Lo que permite realizar algunas mofificaciones en el codigo.

El caso es el siguiente. Debo tener una pantalla que me dure 30 segundos. Dentro de la pantalla hay una scala del 0 al 100.  Donde la persona antes de los 30 segundos debe escoger un valor. Pero al escoger el valor debe aparecer un mensaje de que se ha procesado el dato y que debe esperar a que terminen los 30 segundos, lo cual  no puede pasar a la siguiente pantalla hasta que no se acaben los 30 segundos.  Si no ha respondido ningun numero de la escala  la pantalla deja correr los 30 sg y pasa a la siguiente pantalla......

Gran parte del programa funciona. Pero tengo el problema de que cuando la persona indicar el valor, aparece el mensaje, la pantalla se queda en pause, y no sucede del acabar los 30 segundos.

Espero que me hayáis entendido os agradezco inmensamente vuestra ayuda, ya que tengo que presentar este trabajo cuantos antes para defendedlo

Os dejo el codigo.  De las cosas  que intentado



'Designate "theState" as the Default Slide State, which is the
'current ActiveState on the Slide object "Stimulus".
Dim theState As SlideState
Set theState = Stimulus.States("Default")

Dim theSlideText As SlideText

Dim strHit As String
Dim intRating As Integer
Dim theMouseResponseData As MouseResponseData
Dim strMessage As String
Dim start As Long
Dim click As Long
Dim diferencia As boolean

start = timer


'Was there a response?
If Stimulus.InputMasks.Responses.Count > 0 Then

   'Get the mouse response.
   Set theMouseResponseData = CMouseResponseData(Stimulus.InputMasks.Responses(1))

   'Determine string name of SlideText object at
   'mouse click coordinates. Assign that value to strHit
   strHit = theState.HitTest(theMouseResponseData.CursorX, theMouseResponseData.CursorY)

   'Did the subject click one of the SlideText sub-objects?
   If strHit <> "" And strHit <> "Question" Then
      
      'Gain access to the SlideText sub-object selected
      'Change appearance of selected sub-object to provide feedback to the subject.
      Set theSlideText = CSlideText(Stimulus.States.Item("Default").Objects(strHit))
      theSlideText.BackColor = CColor("red")

      'Redraw the Slide to present changes
      Stimulus.Draw

      'Each SlideText is named "Text" followed by a single digit. The Mid function is
      'instructed to return the 5th character (i.e. the digit) of strHit for logging purposes.
      intRating = CInt(Mid(strHit, 5, 1))
      
      'L og rating in the data file under the attribute "Rating"
      c.SetAttrib "Rating", intRating


      Sleep 1000
      theSlideText.BackColor = CColor("green")


if    intRating  then
click = timer
diferencia = start-click
if  diferencia < 3.0  then
strMessage = "Espere un  moemnto por favor"
   MsgBox strMessage

end if
end if



   'The subject did not click a valid sub-object.
   Else
      c.SetAttrib "Rating", "nothing"
  goTo label1
 End If



'The subject did not respond.
Else

   c.SetAttrib "Rating", "nothing"

End If



Set theMouseResponseData = Nothing
Mouse.ShowCursor FALSE

Páginas: [1]