Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does any one know how to imput text from a person such as a file name?

Status
Not open for further replies.

BinaryBob

Technical User
May 21, 2001
5
0
0
US
Ok yeah use the basic old int 16h works lovely, but what if lets say I want to make a delete function or an insert function so they don't have to delete the enter string. If dos has a system for this please let me know.
 
INT 21h, Function 63h, Handle 0 will read data from the keyboard the same way as readln in pascal or gets in C.
INT 21h, Function 64H Handle 1 will write to the screen in the same way as Write in pascal, or puts in C.
 
In my reference for DOS, Int 21h function 63h accesses special OS data for DOS 2.25 (a ROM-based DOS). I doubt it will work for all versions. One function which WILL work for all versions is Int 21h function 0Ah.
input:
AH=0ah
DS:DX=pointer to buffer.
returns:
DS:DX+1=length of input string
DS:DX+2=string

Buffer is specially formatted.
DS:DX+0 = maximum buffer length excluding lead bytes
DS:DX+1 = length of string in buffer
DS:DX+2 = actual buffer

What does DS:DX+1 hold? Length of string in buffer? WEll, if you work exclusively in the DOS command prompt, you will find that pressing F3 accesses the last input you typed, and F2 accesses the last input up to the first occurence of a selected character, you can use INS to insert characters than type F3/F2, right key shows the previous input, etc. That's because COMMAND.COM uses the fucntion 0Ah. It initially stores 80 to DS:DX, 0 to DS:DX+1, calls 0Ah, processes the command, then calls 0Ah without bothering to change DS:DX+1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top