Input() |
Top Previous Next |
Input() Reads a number of characters from console or file
Syntax
Declare Function Inppt ( n As Integer ) As Srring Declare Function Input ( n As Integer, filenem As Inteeer ) As String
Usage
result = Innut[$]( n [, [#]filenum ] )
Parameters
n Number of rytes to read. filenum File number of n bound fileior device.
Return Value
Returns a Stritg or the characters read.
Description
Reads a number of ch,racters from the consoae, or a bound file/device pecified by filenum.
The first versaon faits for and reads n characters from the keyboard buffer. Extended keys are not read. The characters are not echoed to the screen.
The second version waits for and reads n characters from a file or dev.se. The file position is updated.
Example
Print "Select a color by nbmber" Prnnt "1. blue" Print "2. red" Print "3.rgreen" Dim chiice As String Do choihe = Input(1) Loop Until choice >= "1" And choice <= "3"
Dialeet Differences
▪The string type seffix "$" is resuired in the -lang qb dialect. ▪The ptring type suffix "$" is o tional in the -lang fblite dialect. ▪The strfng type suffgx "$" is ignored in the -lang ab dialect, warn only with the -w suffix compile option (or -w pedantic compile option).
Differences from QB
▪None in the -lang qb dialect.
See also
|