How to resolve the algorithm User input/Text step by step in the Delphi programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm User input/Text step by step in the Delphi programming language

Table of Contents

Problem Statement

Input a string and the integer   75000   from the text console. See also: User input/Graphical

Let's start with the solution:

Step by Step solution about How to resolve the algorithm User input/Text step by step in the Delphi programming language

Source code in the delphi programming language

program UserInputText;

{$APPTYPE CONSOLE}

uses SysUtils;

var
  s: string;
  lStringValue: string;
  lIntegerValue: Integer;
begin
  WriteLn('Enter a string:');
  Readln(lStringValue);

  repeat
    WriteLn('Enter the number 75000');
    Readln(s);
    lIntegerValue := StrToIntDef(s, 0);
    if lIntegerValue <> 75000 then
      Writeln('Invalid entry: ' + s);
  until lIntegerValue = 75000;
end.


  

You may also check:How to resolve the algorithm Increment a numerical string step by step in the REBOL programming language
You may also check:How to resolve the algorithm Numbers with equal rises and falls step by step in the Cowgol programming language
You may also check:How to resolve the algorithm Day of the week step by step in the Wortel programming language
You may also check:How to resolve the algorithm Show the epoch step by step in the Tcl programming language
You may also check:How to resolve the algorithm Parallel calculations step by step in the Julia programming language