Hello SRL community. I'm here to tell you about the ReadLn command. Everyone knows the writeln function but very few know the readln and it is quite useful!
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:
The question is statement is what you want to ask the user.SCAR Code:function Readln(question: string): string;
Useing ReadLn.
Just put:
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.SCAR Code:ReadLn({question here});
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:
SCAR Code:var
Answer : string;
Working Example.
Here is a working example of ReadLn;
SCAR Code: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

