ronny.m.p
2007-04-14 14:13:17
What is ReadLn?
ReadLn is a function used to get information from the user. It is basicly a form that dosen't require any other codeing except one small procedure.
Where could i use ReadLn?
Use it where you need to get information from the user but don't want to have to go to the trouble of makeing a form ;)
What is the syntax?
The syntax is simple:
function Readln(question: string): string;The question is statement is what you want to ask the user.Useing ReadLn.
Just put:
ReadLn({question here});where you want to ask the user your question. A box will pop up with your question and an edit box. The user puts the "answer" in the edit box and ReadLn returns the answer as a string.Useing a variable to define the answer.
We need to use a variable to make the "answer" any use to us. So just make something like this:
var
Answer : string;
Working Example.
Here is a working example of ReadLn;
program ReadLnExample;
var
Answer : String;
procedure GetAnswer;
begin
Answer := ReadLn('What is your username?');
writeln(Answer);
end;
begin
GetAnswer;
end.Feel free to + rep me if you like guide and please give feedback.
-Ronny