home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Examples / StdLib / STD1.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  1.5 KB  |  49 lines

  1. //----------------------------------------------------------------------------
  2. //Standard Template Library Examples
  3. //     Adapted from console demos.
  4. //
  5. //Borland C++Builder
  6. //Copyright (c) 1987, 1998 Borland International Inc. All Rights Reserved.
  7. //----------------------------------------------------------------------------
  8. //---------------------------------------------------------------------------
  9. #include <vcl.h>
  10. #pragma hdrstop
  11.  
  12. #include "std1.h"
  13. //---------------------------------------------------------------------------
  14. #pragma resource "*.dfm"
  15. int ct;
  16. TForm1 *Form1;
  17. extern int accum_ex();
  18. //---------------------------------------------------------------------------
  19. __fastcall TForm1::TForm1(TComponent* Owner)
  20.     : TForm(Owner)
  21. {
  22. }
  23. //---------------------------------------------------------------------------
  24. void build_all()
  25. {
  26.      accum_ex();
  27. }
  28.  
  29. //---------------------------------------------------------------------------
  30. void __fastcall TForm1::ComboBox1Change(TObject *Sender)
  31. {
  32.     for (int j = 0; j < 200; j++)
  33.         if (Memo1->Lines->Strings[j] != "")
  34.             Memo1->Lines->Strings[j] = " "; // make space in Memo
  35.     ct = 0;
  36.     switch (ComboBox1->ItemIndex)
  37.     {
  38.        case 0:
  39.         build_all();
  40.         break;
  41.        case 1:
  42.         accum_ex();
  43.            break;
  44.        default:
  45.         ShowMessage ("Sorry, not implemented yet");
  46.         break;
  47.     }
  48. }
  49. //---------------------------------------------------------------------------