Print

Print


On Friday, 19 Dec, I posted a note about using the standard finger-tapping
test used by neurologists to help gauge tha severity of their symptoms.

I included with that note a listing of a very simple program which emulates
this button test: I hope to get plenty of PWPs to run the program on their
PCs and send me the results.

The only problem is that my computer is an Acorn RISC PC (a rather rare
breed which is not IBM compatible), so I am looking for a person who can
take my logic and write a simple program which will run on an IBM PC.  I
attached the program (written in BBC Basic 5) and a flow chart illustrating
the logic.

The response has been totally underwhelming, with not a single reply so far.
I can't believe that there aren't some of you out there who can string a few
lines of code together. I don't mind if it is in C, C+, C++, Basic, Visual
Basic, Fortran, Algol, Cobol or assembler as long as it works !!

I have appended the listing to this Email - If anyone needs the flow chart I
will sedn it diretly to them to avoid loading the system.
=================================================================


10   REM >TapTest
20   CLS
30   ON ERROR REPORT:PRINT " Error line= ";ERL:END
40   DIM results%(50,150)
50   REM TRACE ON
60   goes%=0
70   REPEAT
80      score%=-1 : interval%=0 : duration%=1000
90      PRINT"Start tapping on the Alt Key when you are ready"
100     REPEAT UNTIL INKEY-6 : REM -6 = L/Hand Alt Key
110     starttime%=TIME
120     WHILE interval%< duration%
130        score%+=1
140        PRINT TAB(0,3 ) score%
150        REPEAT UNTIL NOT (INKEY-6)
160        REPEAT UNTIL INKEY-6
170        interval%=TIME - starttime%
180        results%(goes%,score%)=interval%
190     ENDWHILE
200     PRINTTAB(0,5)"PRESS RETURN TO GO AGAIN- 'A' to see analysis"
210     REPEAT UNTIL INKEY-74 OR INKEY-66 OR FALSE
220     IF INKEY-66 PROCanalyse :REPEAT UNTIL NOT (INKEY-66)
230     IF INKEY-74 CLS:
240 UNTIL FALSE
250 END
260
270 DEF PROCanalyse
280 FOR I%=0 TO score%: PRINT TAB(0) I%;"  ";results%(0,I%):NEXT
290 PROCsaveCSV
300 ENDPROC
310
320 DEF PROCsaveCSV
330 name$=""
340 SYS "OS_Byte",21,0
350 INPUT"Enter Filename",name$
360 XB=OPENOUT("ADFS::HardDisc4.$.WIMP.ParkTab.TapData."+name$)
370 FOR I%=0 TO goes%
380    FOR K%=1 TO score%
390       str$=CHR$(&22)+STR$(results%(I%,K%))+CHR$(&22)
400       BPUT#XB,str$
410    NEXT K%
420    CLOSE#XB
430 NEXT I%
440 ENDPROC
450
460 DEF FNnum(n):REM To setup a number for a SAVE in CSV format
470 @%=&01020305
480 =STR$(n)
490 :
500 ===========================================

Notes:  TIME is a 32 bit Integer variable which increments by 1 every
1/100 th of a second.  Thus duration% =1000 is 10 seconds

INKEY -6 returns TRUE when the left-hand Alt key is pressed
INKEY -66 returns TRUE when the 'A' key is pressed
INKEY -74 returns TRUE when the 'RETURN' key is pressed

With a possible cascade of button presses, the only way to retain control is
to use the form REPEAT UNTIL (button is pressed)
          then  REPEAT UNTIL (button is released)

The analysis part is optional - I just like to play with the numbers,  so
once the data are in CSV format (Comma Separated Values) virtually any
spreadsheet will accept it.

Regards,
--
Brian Collins  <[log in to unmask]>