home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / WINER.ZIP / STUFFBUF.BAS < prev    next >
BASIC Source File  |  1992-05-13  |  616b  |  25 lines

  1. '********* STUFFBUF.BAS - shows how to stuff the keyboard buffer
  2.  
  3. 'Copyright (c) 1992 Ethan Winer
  4.  
  5. DEFINT A-Z
  6. DECLARE SUB StuffBuffer (Cmd$)
  7.  
  8. SUB StuffBuffer (Cmd$) STATIC
  9.  
  10.     '----- Limit the string to 14 characters plus Enter
  11.     '      and save the length.
  12.     Work$ = LEFT$(Cmd$, 14) + CHR$(13)
  13.     Length = LEN(Work$)
  14.  
  15.     '----- Set the segment for poking, define the buffer
  16.     '      head and tail, and then poke each character.
  17.     DEF SEG = 0
  18.     POKE 1050, 30
  19.     POKE 1052, 30 + Length * 2
  20.     FOR X = 1 TO Length
  21.         POKE 1052 + X * 2, ASC(MID$(Work$, X))
  22.     NEXT
  23.  
  24. END SUB
  25.