< Ring < Lessons 
 
 
 
 
        
      Getting Input
We can get input from the keyboard using
- The Give Command
- The GetChar() Function
- The Input() Function
Give Command
Syntax:
	Give VariableNameExample:
	See "Enter the first number : " Give nNum1
	See "Enter the second number : " Give nNum2
	See "Sum : " + ( 0 + nNum1 + nNum2 )Output:
	Enter the first number : 3
	Enter the second number : 4
	Sum : 7GetChar() Function
We can get one character from the standard input using the GetChar() function
Syntax:
	GetChar() ---> CharacterExample:
	While True
		See "
			Main Menu
			(1) Say Hello
			(2) Exit
		    " 
		Option = GetChar()
		GetChar() GetChar()  # End of line
		# the previous two lines can be replaced with the next line
		# Give Option
		if Option = 1
			see "Enter your name : " give cName 
			see "Hello " + cName
		else
			bye
		ok
	EndInput() Function
We can get input from the keyboard using the Input() function
Syntax:
	Input(nCount) ---> stringThe function will wait until nCount characters (at least) are read
Example:
	See "Enter message (30 characters) : " cMsg = input(30)
	See "Message : " + cMsg
    This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.