954,123 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Containing numbers - how?

Hello guys and girls.

Any idea how to find containing numbers of one specific number. For example number 10:

10 = 9+1
10 = 8+2
10 = 7+3

I tried to do something like ‘random(10)’ but got nowhere with that.

Cheers to all,
marygreen

marygreen
Newbie Poster
8 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 


10 = 9+1
10 = 8+2
10 = 7+3

Where do you want to search?Where do you store them,in string?

FlamingClaw
Posting Pro
559 posts since Feb 2009
Reputation Points: 132
Solved Threads: 138
 

Hi FalmingClaw.

Need to generate them and print them in a memo.

marygreen
Newbie Poster
8 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

Never mind. I did it this way:

begin
C.value:=10;
while num1.value<c.value do
begin
num1.value:=num1.value+1;
num2.value:=c.value-num1.value;
memo1.lines.add((floattostr(num1.value))+'__'+(floattostr(num2.value)));
end;
if (num1.value=c.Value) then
begin
showmessage('Done');
end;
end;
marygreen
Newbie Poster
8 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You