Option Explicit
'word array variables
Dim IntFirstArray As Integer 'the varibles used to keep track of position in the two buttons
Dim IntSecondArray As Integer
Dim StrWordStore As String
Dim StrStartWordArray(0 To 9) As String 'array for first list, easy scroll through
Dim StrSecondWordArray(0 To 20) As String 'array for second button with timing involved
'timer variables
Private tFreq As Currency
Private tStart As Currency
Private tStop As Currency
Private gTC As Boolean
Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
'these above are functions that are used in calculating the time using an API function for maximum accuracy
Public Property Get RetTime() As Double
RetTime = in_RetTime 'Returns Seconds
End Property
Public Sub Init()
QueryPerformanceFrequency tFreq
If tFreq = 1000 Then
gTC = True
Else
gTC = False
End If
End Sub
Public Sub StopTime()
If gTC Then
tStop = CCur(GetTickCount)
Else
QueryPerformanceCounter tStop
End If
in_RetTime = (tStop - tStart) / tFreq
End Sub
Public Sub StartTime()
If gTC Then
tStart = CCur(GetTickCount)
Else
QueryPerformanceCounter tStart
End If
End Sub
Private Sub cmdFirst_Click()
'this is the coding for the button that merely displays the words one after another in a loop
If IntFirstArray > 9 Then
MsgBox "End of List, restarting"
IntFirstArray = 0
End If
StrStartWordArray(0) = "Slight"
StrStartWordArray(1) = "Benign"
StrStartWordArray(2) = "Yacht"
StrStartWordArray(3) = "Climb"
StrStartWordArray(4) = "Ballet"
StrStartWordArray(5) = "Bind"
StrStartWordArray(6) = "Although"
StrStartWordArray(7) = "Psyche"
StrStartWordArray(8) = "Might"
StrStartWordArray(9) = "Fetus"
lblword.Caption = StrStartWordArray(IntFirstArray)
IntFirstArray = IntFirstArray + 1
End Sub
Private Sub Form1_Load()
IntFirstArray = 0
IntSecondArray = 0
CmdNext.SetFocus
lblword.Caption = StrStartWordArray(IntArray)
End Sub
Private Sub cmdSecond_Click()
Dim q As New sTime 'this is the variable used to call the time subs
'clicking the button that does the real testing
'setting array value appropriately
If IntSecondArray > 19 Then
IntSecondArray = 0
End If
'assigning array values to the second array for the words in the timed list
If StrSecondWordArray(0) = "" Then
StrSecondWordArray(0) = "Climb"
StrSecondWordArray(1) = "Ballet"
StrSecondWordArray(2) = "Sight"
StrSecondWordArray(3) = "Cat"
StrSecondWordArray(4) = "Might"
StrSecondWordArray(5) = "With"
StrSecondWordArray(6) = "Valid"
StrSecondWordArray(7) = "Doll"
StrSecondWordArray(8) = "Consent"
StrSecondWordArray(9) = "Time"
StrSecondWordArray(10) = "Sew"
StrSecondWordArray(11) = "Smite"
StrSecondWordArray(12) = "Dog"
StrSecondWordArray(13) = "Scripts"
StrSecondWordArray(14) = "Yacht"
StrSecondWordArray(15) = "Conscience"
StrSecondWordArray(16) = "Chic"
StrSecondWordArray(17) = "Chalet"
StrSecondWordArray(18) = "Limb"
StrSecondWordArray(19) = "Hat"
End If
'setting variables to zero prior to measurement of time and loop
q.Init
'taking starting time then starting the timer
'coding the fixation point
lblword.Caption = "*"
q.StartTime
Do Until q.RetTime >= 4
q.StopTime
Loop
Select Case IntSecondArray 'coding for the 4 millisecond displays
Case 1, 3, 5, 6, 8, 10, 11, 12, 14, 15
lblword.Caption = StrSecondWordArray(IntSecondArray)
q.StartTime
Do Until q.RetTime >= 0.02
q.StopTime
Loop
Case Else 'coding for the 5 second displays
lblword.Caption = StrSecondWordArray(IntSecondArray)
q.StartTime
Do Until q.RetTime >= 5
q.StopTime
Loop
End Select
IntSecondArray = IntSecondArray + 1
lblword.Caption = "XXXXXXXXXXXXXXX"
End Sub