Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - input place keyboard input to variable http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 input               Place keyboard input to variable
------------------------------------------------------------------------------
 Syntax
   input [cPrompt] to xVar

 Arguments
   cPrompt is an optional message to display.
   xVar is a variable that receives user input.

 Description
   The input command displays an optional prompt and then allows for
   keyboard input which will be assigned to the variable xVar.

   input prints a carriage return before the prompt and/or keyboard input.
   Display of the carriage return and optional prompt is through the same
   I/O system as the ? command. If the __cr_first flag is set to .f. then
   the preceding carriage return is not displayed.

   xVar cannot be a field variable. If there is an error with the user
   input value, or the user presses the escape key, the original value of
   xVar will be maintained. The last key entered by the user may be
   checked through the lastkey() function.

   The accept and input commands share a line-based keyboard input routine.
   The processed keys are listed in the Accept/input key table.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc Test_input
   vardef
      char cName
      uint nAge
   enddef
   clear
   __cr_first := .f.
   @ 10, 10
   input "Input name " to cName
   @ 12, 10
   input "Input age  " to nAge
   @ 14, 10
   ? cName, istr( nAge )
   __cr_first := .t.
   wait
   endproc

   proc main
   Test_input()
   endproc

See Also: Accept/input key table accept

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson