Thursday, October 29, 2015

READ, Readln, READKEY as input Statement for learning PASCAL


READ, Readln, READKEY as input Statement for learning PASCAL

Maybe much of student now wanna know about the information of PASCAL but don’t have full access of good article. In this article, again I show you about what some of input statement in PASCAL.
Today let’s talk about Input stement in PASCAL.
Theoretically, there are several types of input commands for PASCALprogrammer:
1. READ
2. Readln
3. READKEY
The use of READ and Readln indistinguishable almost, but different method that occur together with the WRITE and writeln. well for me this advice you should use only Readln.
READKEY use, to enter the data manifold 1 Character. The difference Readln and READKEY:
1. READKEY requires USES CRT while For Readln not requires
2. Readln input more than one character, while READKEY only 1 char
3. Readln use ENTER to end inputting while READKEY not.
4. Variable placeholders for Readln types can Char / STRING but if using READKEY mandatory Char
For example:
USES CRT;
Var
Your Name: String [16];
NH: Char;

BEGIN
Textcolor (16); TextBackGround (3)
Clrscr;
Write ('Your name:'); Readln (Amin Setiawan Lahagu);
Write ('Value Letter:'); NH: = Readkey;
Writeln;
Writeln ('Is', your name, 'Worthy to get the value:', NH, '?');

Readln;
END.

Explanation!
1. Assumtion for writing
Write ('Your Name:'); Readln (your Name);
WHY NOT
Writeln ('Your Name:'); Readln (Name);
(the  display monitor result is as I described in the previous WRITE command and writeln). Hope you all understand okey…………..
If we use: writeln ('Yor Name:');
Readln (your name); then the output becomes
Student name :
 See the cursor under the ypur name. BUT if we use
Write ('Your Name:'); Readln (Your Name); Then Output
Name: cursor to input the name will be located on the right side, not down.
NOW do youUNDERSTAND right? Don,t you

2. Assumtion  writing
Write ('Value Letter:'); NH: = Readkey;
will generate
Value Letter:
cursor is located on the right side and IF you press a keyboard button then inputting end without end with ENTER.
If the program is on the run
Name: Amin Setiawan Lahagu WAWAN

The letter grades: A
Is Amin Setiawan Lahagu WAWAN to get Output: A?

What is your opinion?

The end of this article....................look me here

No comments:

Post a Comment