home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DELPHI / LEADZR / READ_ME.TXT < prev   
Text File  |  1995-04-27  |  2KB  |  46 lines

  1. ===============================================================================
  2. Leading Zero Component
  3.  
  4. This is my first pass at a component, so bear with me. The component
  5. was designed to take an integer value and convert it to a string value
  6. with leading or trailing zeros. I created for use with fixed length
  7. text flat files where I had to calculate running totals. 
  8.  
  9. Here are the published properties:
  10.  
  11.     {The input value - must be of type LongInt}
  12.     property InputVal : LongInt read FInputVal write FInputVal;
  13.  
  14.     {The width of the string to return}
  15.     property Width    : Integer read FWidth    write FWidth;
  16.  
  17.     {Justification - must be 'Right' or 'Left'}
  18.     property Align    : String  read FAlign    write FAlign;
  19.  
  20. To use it you call the public function:
  21.  
  22.     function FillZeroes(rstSize, inVal : LongInt; aAlign : String ) : String;
  23.  
  24.     where: rstSize = The returned string size that you want (string width)
  25.            inVal   = input value
  26.                aAlign  = 'Right' or 'Left' justification
  27.  
  28. For example, FillZeroes(8, 312, 'Right') would return:
  29.  
  30.         '00000312'
  31.  
  32. ===============================================================================
  33. Installation
  34.  
  35. Just add the LeadZero.dcu to your library, or add the PAS file, whichever is of
  36. use to you.
  37.  
  38. ===============================================================================
  39. Note
  40.  
  41. Since this is my first pass at a component, and this is really a simple one, 
  42. I'd really appreciate any pointers or tips on how I could improve my code.
  43. Thanks!!!
  44.  
  45. Brendan Delumpa 72410,520
  46.