Revision history for KeyPgInput


Revision [21495]

Last edited on 2016-05-22 12:07:24 by CountingPine [Clearer first example, particularly the Input prompt]
Additions:
Dim user_name As String, user_age As Integer
Input "Enter your name and age, separated by a comma: ", user_name, user_age
Print "Your name is " & user_name & ", and you are " & user_age & " years old."
Deletions:
Dim n As String, a As Integer
Input "Enter [Name, Age]: ", n, a
Print n
Print a


Revision [20947]

Edited on 2016-03-13 03:44:55 by fxm [Formatting]
Additions:
If more values are read than are listed in the variable list, extra values will be ignored; if fewer values are read (i.e. the user presses enter before inputting all values), the remaining variables will be initialized (numeric variables to zero (##0##), and string variables to the empty string (##"####"##)).
Deletions:
If more values are read than are listed in the variable list, extra values will be ignored; if fewer values are read (i.e. the user presses enter before inputting all values), the remaining variables will be initialized - numeric variables to zero (##0##), and string variables to the empty string (##"####"##).


Revision [20275]

Edited on 2016-02-10 16:01:29 by DkLwikki [Update link format]
Additions:
For inputting to a single string without delimiting, ##[[KeyPgLineinput|Line Input]]## should be used instead.
The optional leading semicolon (##;##) after ##**Input**## is similar to the optional trailing semicolon in a ##[[KeyPgPrint|Print]]## statement: the cursor will remain on the same line after all of the characters have been echoed, otherwise, the cursor will move to the beginning of the next line.
Numeric values are converted using methods similar to the procedures ##[[KeyPgVal|Val]]## and ##[[KeyPgVallng|ValLng]]##, using the most appropriate function for the number format, converting as many numeric characters as possible.
input "Would you like to enter some more numbers"; yn
yn = lcase(yn)
- ##[[KeyPgInputPp|Input #]]##
- ##[[KeyPgInputnum|Input()]]##
- ##[[KeyPgLineinput|Line Input]]##
Deletions:
For inputting to a single string without delimiting, ##[[KeyPgLineinput Line Input]]## should be used instead.
The optional leading semicolon (##;##) after ##**Input**## is similar to the optional trailing semicolon in a ##[[KeyPgPrint Print]]## statement: the cursor will remain on the same line after all of the characters have been echoed, otherwise, the cursor will move to the beginning of the next line.
Numeric values are converted using methods similar to the procedures ##[[KeyPgVal Val]]## and ##[[KeyPgVallng ValLng]]##, using the most appropriate function for the number format, converting as many numeric characters as possible.
input "Would you like to enter some more numbers"; yn
yn = lcase(yn)
- ##[[KeyPgInputPp Input #]]##
- ##[[KeyPgInputnum Input()]]##
- ##[[KeyPgLineinput Line Input]]##


Revision [16143]

Edited on 2012-03-05 11:50:32 by CountingPine [Various changes]
Additions:
**Input** [;] ["//prompt//" ,|; ] //variable_list//
an optional string literal that is written to the screen as a prompt. If it is followed by a semicolon (##;##), a question mark (##"? "##) will be appended to the prompt. If it is followed by a comma, nothing will be appended.
If there is more than one value in the input list, then the input line will be split up by scanning for delimiters - commas (##,##) after strings, or commas and whitespace after numbers. Surrounding whitespace will be trimmed from string values. If an input string has a comma in it, it must be wrapped in quotes (##"..."##) to prevent it being split up.
For inputting to a single string without delimiting, ##[[KeyPgLineinput Line Input]]## should be used instead.
The optional leading semicolon (##;##) after ##**Input**## is similar to the optional trailing semicolon in a ##[[KeyPgPrint Print]]## statement: the cursor will remain on the same line after all of the characters have been echoed, otherwise, the cursor will move to the beginning of the next line.
If more values are read than are listed in the variable list, extra values will be ignored; if fewer values are read (i.e. the user presses enter before inputting all values), the remaining variables will be initialized - numeric variables to zero (##0##), and string variables to the empty string (##"####"##).
Numeric values are converted using methods similar to the procedures ##[[KeyPgVal Val]]## and ##[[KeyPgVallng ValLng]]##, using the most appropriate function for the number format, converting as many numeric characters as possible.
Deletions:
**Input** [;] ["//prompt//" //separator//] //variable_list//
an optional string literal that is written to the screen.
##//separator//##
a semicolon (##;##), which appends ##"? "## to the prompt, or comma (##,##), which appends nothing.
If there is more than one value in the input list, the user must be instructed to type commas or whitespace to separate each value. Surrounding whitespace will be trimmed from string values. If an input string has a comma in it, it must be wrapped in quotes (##"..."##) to prevent it being split up.
Alternatively, ##[[KeyPgLineinput Line Input]]## maybe used to input an entire line to a single string without delimiting.
The optional leading semicolon after ##**Input**## is similar to the optional trailing semicolon in a ##[[KeyPgPrint Print]]## statement: the cursor will remain on the same line after all of the characters have been echoed, otherwise, the cursor will move to the beginning of the next line.
If more values are read than are listed in the variable list, extra values will be ignored; if fewer values are read (i.e. the user presses enter before inputting all values), the remaining variables will be initialized - numeric variables to zero (##0##), and string variables to the null string (##"####"##).
Numeric values are converted similar to the procedures ##[[KeyPgVal Val]]## and ##[[KeyPgVallng ValLng]]##, using the most appropriate function for the number format, converting as many numeric characters as possible.


Revision [16078]

Edited on 2012-02-04 21:45:56 by CountingPine [Formatting]
Additions:
The ##//prompt//## - if any - is written to the screen at the current cursor location, and characters read are echoed to the screen immediately following the prompt. If no prompt is specified, characters are echoed at the current cursor location.
Deletions:
The prompt - if any - is written to the screen at the current cursor location, and characters read are echoed to the screen immediately following the prompt. If no prompt is specified, characters are echoed at the current cursor location.


Revision [14781]

Edited on 2010-08-20 13:01:16 by CountingPine [Remove apparent erroneous difference]
Deletions:
- If no prompt is given, QBASIC will prompt with "? ", while FreeBASIC will not give any prompt.


Revision [13605]

Edited on 2008-07-21 18:48:21 by JeffMarshall [spelling]
Additions:
If there is more than one value in the input list, the user must be instructed to type commas or whitespace to separate each value. Surrounding whitespace will be trimmed from string values. If an input string has a comma in it, it must be wrapped in quotes (##"..."##) to prevent it being split up.
Deletions:
If there are more than one value in the Input list, the user must be instructed to commas or whitespaces to separe them. Surrounding whitespace will be trimmed from string values. If an input string has a comma in it, it must be wrapped in quotes (##"..."##) to prevent it being split up.


Revision [13484]

The oldest known version of this page was created on 2008-07-10 10:17:32 by AntoniGual [spelling]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode