1

Topic: Delphi - Memo

Greetings to all.
I on the form have which what calculation.
The result appears in Memo1.
How to make so that at pushing the button (which on the form), appears the window in which will be written:
If in Memo number from 0 to 10 - it is bad
If in Memo number from 11 to 20 - it is good

2

Re: Delphi - Memo

RTFM ShowMessage ().

3

Re: Delphi - Memo

var
number: Integer;
begin
number: = StrToIntDef (memo1.Text,-1);//-1, when there something left in the field
if (number> = 0) and (number <= 10) then
begin
ShowMessage (' it is bad ');
Exit;
end;
if (number> = 11) and (number <= 20) then
begin
ShowMessage (' it is good ');
Exit;
end;
ShowMessage (' Incorrect result ');
end;

4

Re: Delphi - Memo

JaDi;
Thanks you, tried to make as well it turned out ( only not absolutely how it is necessary ).
For Memo why that is not calculated, writes permanently "incorrect result".
I tried to make for Edit, and all turned out.
But here a question how to make for Memo??

5

Re: Delphi - Memo

Login1233211;
to save result in , and then to cause this code.

memo1.Text: = IntToStr (15);

6

Re: Delphi - Memo

JaDi;
Where it to write, and what such (15)? ;(

7

Re: Delphi - Memo

Login1233211 wrote:

JaDi;
Where it to write, and what such (15)? ;(

Delfi for teapots

8

Re: Delphi - Memo

Login1233211;
Whence in  there is a text with number which should be checked? It is entered manually by the user, registers any calculations, boots from a file?

9

Re: Delphi - Memo

JaDi wrote:

Login1233211;
Whence in  there is a text with number which should be checked? It is entered manually by the user, registers any calculations, boots from a file?

.... It still can  in 1 a line go to the last... Judging by Memo - that there bluntly rowset what of lines is last??? (Can they insertions) are sorted alphabetically right after

10

Re: Delphi - Memo

AndreyTarasov;
Generally an output of results in TMemo - a perversion caused by inability of the author. If result 1 - if you please it to deduce in TEdit/TPanel, and already then something there to compare.
P.S. In the code the author guesses assignment of variables, but value does not give.

11

Re: Delphi - Memo

DarkMaster wrote:

AndreyTarasov;
Generally an output of results in TMemo - a perversion caused by inability of the author. If result 1 - if you please it to deduce in TEdit/TPanel, and already then something there to compare.
P.S. In the code the author guesses assignment of variables, but value does not give.

If the result is deduced in "TEdit/TPanel" - that is the extremely stupid programmer...
Easier to deduce result in a variable)) (without insults, I am simply drunk)))

12

Re: Delphi - Memo

AndreyTarasov wrote:

it is passed...
If the result is deduced in "TEdit/TPanel" - that is the extremely stupid programmer...

Well in a message boxing deduce for an extreme wink