home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / SCRPTEXM.PAK / LIST.SPP < prev    next >
Encoding:
Text File  |  1997-05-06  |  821 b   |  36 lines

  1. //--------------------------------------------------------------------------
  2. // Object Scripting
  3. // Copyright (c) 1996, 1997 by Borland International, All Rights Reserved
  4. //
  5. // LIST.SPP: List Window. Demonstrates a simple sorted list window.
  6. //--------------------------------------------------------------------------
  7. print typeid(module());
  8.  
  9. Count;
  10. Items = {"Hopes", "Dreams", "Fantasies", "Expectations"};
  11.  
  12. List = new ListWindow(50, 5, 100, 300, "Script Controlled Lists are cool",
  13.                       FALSE, TRUE, Items);
  14.  
  15. on List:>Move()
  16. {
  17.   .Caption = .GetString(.CurrentIndex);
  18. }
  19.  
  20. on List:>Insert()
  21. {
  22.   Count++;
  23.   .Add(Count);
  24.   .Caption = .GetString(.CurrentIndex);
  25. }
  26.  
  27. on List:>Delete()
  28. {
  29.   .Remove(.CurrentIndex);
  30.   .Caption = .GetString(.CurrentIndex);
  31. }
  32.  
  33. List.Execute();
  34.  
  35.  
  36.