home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol9n04.zip / PASSCOMM.FNC < prev    next >
Text File  |  1990-01-22  |  605b  |  22 lines

  1. pass command function
  2.  
  3.  
  4. CALL PassCommand("CHKDSK" + CHR$(13)) 'the 13 simulates pressing Enter
  5. END
  6.  
  7.  
  8. SUB PassCommand (Cmd$) STATIC
  9.  
  10.     Work$ = LEFT$(Cmd$, 15)     'restrict the string to 15 characters
  11.     Length = LEN(Work$)         'now get the actual length
  12.  
  13.     DEF SEG = 0                 'set the segment for poking to low memory
  14.     POKE 1050, 30               'define the buffer head
  15.     POKE 1052, 30 + Length * 2  'and then the buffer tail
  16.     FOR X = 1 TO Length         'poke each character one by one
  17.         POKE 1052 + X * 2, ASC(MID$(Work$, X))
  18.     NEXT
  19.  
  20. END SUB
  21.  
  22.