Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub cinput(byref C as string,byref Proposed_X as integer,byref Proposed_Y as integer,byref Prior_X as integer,byref Prior_Y as integer)
- dim as string XM,YM
- C = INKEY
- XM = SPACE(0)
- YM = SPACE(0)
- IF LEN(C) = 0 THEN
- C = SPACE(1)
- END IF
- IF C = CHR(27) THEN
- SCREEN 0, 0, 0, 0
- WIDTH 80
- COLOR 15, 9 ', 1
- CLS
- END
- END IF
- Prior_X = Proposed_X
- Prior_Y = Proposed_Y
- key_routines keymap(), Proposed_X, Proposed_Y, c
- end sub
- sub key_routines(keymap() as keymap_type, byref Proposed_X as integer, byref Proposed_Y as integer, c as string)
- Proposed_X=Prior_X
- Proposed_Y=Prior_Y
- dim as integer i=0,k=0
- for i=lbound(keymap,1) to ubound(keymap,1) step 1
- if instr(ucase(keymap(i).key),ucase(c))>0 then
- for k=lbound(keymap(i).instruct,1) to ubound(keymap(i).instruct,1) step 1
- select case k
- case 0
- Proposed_X+=keymap(i).instruct(k)
- case 1
- Proposed_Y+=keymap(i).instruct(k)
- end select
- next k
- end if
- next i
- end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement