Containing numbers - how?

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2009
Posts: 8
Reputation: marygreen is an unknown quantity at this point 
Solved Threads: 0
marygreen marygreen is offline Offline
Newbie Poster

Containing numbers - how?

 
-1
  #1
Oct 2nd, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 456
Reputation: FlamingClaw will become famous soon enough FlamingClaw will become famous soon enough 
Solved Threads: 110
FlamingClaw's Avatar
FlamingClaw FlamingClaw is offline Offline
Posting Pro in Training

Re: Containing numbers - how?

 
0
  #2
Oct 2nd, 2009

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


Where do you want to search?Where do you store them,in string?
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 8
Reputation: marygreen is an unknown quantity at this point 
Solved Threads: 0
marygreen marygreen is offline Offline
Newbie Poster

Re: Containing numbers - how?

 
0
  #3
Oct 2nd, 2009
Hi FalmingClaw.

Need to generate them and print them in a memo.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 8
Reputation: marygreen is an unknown quantity at this point 
Solved Threads: 0
marygreen marygreen is offline Offline
Newbie Poster

Re: Containing numbers - how?

 
0
  #4
Oct 3rd, 2009
Never mind. I did it this way:

Pascal and Delphi Syntax (Toggle Plain Text)
  1. begin
  2. C.value:=10;
  3. while num1.value<c.value do
  4. begin
  5. num1.value:=num1.value+1;
  6. num2.value:=c.value-num1.value;
  7. memo1.lines.add((floattostr(num1.value))+'__'+(floattostr(num2.value)));
  8. end;
  9. if (num1.value=c.Value) then
  10. begin
  11. showmessage('Done');
  12. end;
  13. end;
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC