home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_05 / 2n05076a < prev    next >
Text File  |  1991-03-04  |  359b  |  29 lines

  1.  
  2. Program listing
  3.  
  4. Function ReallyCast9(inputnumber: integer):integer;
  5. var
  6. total:integer;
  7. begin
  8. if inputnumber > 9 then
  9. begin
  10. total:=0;
  11. while (inputnumber >0)do
  12. begin
  13. total:=total+(inputnumber mod 10);
  14. if total >9then
  15. total:=total-9;
  16. inputnumber:=inputnumber div 10;
  17. end;
  18. end
  19. else
  20. total:=inputnumber;
  21. ReallyCast9:=total;
  22. end;
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.