home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / Evatac Software / Preditor 3.0 / Tools / Extension Module Builder / Examples / Alphabetical Index / Index.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-28  |  924 b   |  52 lines  |  [TEXT/TCEd]

  1. /************************************************************
  2.  
  3.     Index.c
  4.     
  5.     Preditor 3.0 extension.
  6.     
  7.     Create a new alphabetical index for using as an address
  8.     book, phone book, recipies, etc.
  9.     
  10.     © Copyright Evatac Software  1988-1995
  11.     All rights reserved
  12.  
  13. ************************************************************/
  14.  
  15. #include "PreditorExtension.h"
  16.  
  17. #include <SetupA4.h>
  18. #ifndef THINKC
  19. #include <A4Stuff.h>
  20. #else
  21. #define SetCurrentA4()    0; RememberA4()
  22. #define SetA4(x)        SetUpA4()
  23. #endif
  24.  
  25. #ifdef powerc
  26. ProcInfoType __procinfo = ExtensionUPPInfo;
  27. #endif
  28.  
  29. void main(
  30.     ExternalCallbackBlock        *callbacks,
  31.     WindowRef                    window
  32.     )
  33. {
  34.     long             saved_a4;
  35.     unsigned char    name[10], ch;
  36.     
  37.     saved_a4 = SetCurrentA4();
  38.     
  39.     extNewDocument(callbacks, kIndexDouble);
  40.     
  41.     name[0] = 1;
  42.     
  43.     for (ch = 'A'; ch <= 'Z'; ch++) {
  44.         
  45.         name[1] = ch;
  46.         
  47.         extIndexEntry(callbacks, name, false, kAddEntry);
  48.     }
  49.     
  50.     SetA4(saved_a4);
  51. }
  52.