home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / amiga / programm / 13259 < prev    next >
Encoding:
Text File  |  1992-09-11  |  3.4 KB  |  172 lines

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!tulane!uflorida!max.fiu.edu!serss0!xnybpf01
  2. From: xnybpf01@serss0 (Brian P Feeny)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: lc error
  5. Message-ID: <BuDF0z.8vv@fiu.edu>
  6. Date: 10 Sep 92 16:26:58 GMT
  7. Sender: news@fiu.edu (Usenet Administrator)
  8. Organization: Florida International University, Miami
  9. Lines: 161
  10.  
  11. Newsgroups: comp.sys.amiga.programmer
  12. Subject: Problem
  13. Summary: 
  14. Expires: 
  15. Sender: 
  16. Followup-To: 
  17. Distribution: 
  18. Organization: Florida International University, Miami
  19. Keywords: 
  20.  
  21.  
  22.     I am having trouble compiling some source with  Lattice 5.10, and would
  23. like some help.  I am getting a "Error: 107 Too Many Initializers" right after
  24. IntuiText Text structure.  I am simply compiling with the -L option and no others
  25. .  Here is the source:
  26.  
  27. /* Calc_Border.c
  28.  */
  29.  
  30. #include<exec/types.h>
  31. #include<intuition/intuition.h>
  32.  
  33. struct IntuitionBase *IntuitionBase;
  34. struct Window        *FirstWindow;
  35.  
  36.  
  37. struct NewWindow FirstNewWindow =
  38. {
  39.    160,50,     /* LeftEdge, TopEdge */
  40.    320,150,    /* Width, Height */
  41.    0,1,        /* DetailPen, BlockPen */
  42.    CLOSEWINDOW, /* IDCMP Flags */
  43.    WINDOWDEPTH | /* Flags */
  44.    WINDOWSIZING |
  45.    WINDOWDRAG |
  46.    WINDOWCLOSE |
  47.    SMART_REFRESH,
  48.    NULL,       /* First Gadget */
  49.    NULL,       /* CheckMark */
  50.    (UBYTE *)"System programming test", /* Title */
  51.    NULL,       /* Screen */
  52.    NULL,       /* BitMap */
  53.    100,50,     /* Min Width, Height */
  54.    640,200,    /* Max Width, Height */
  55.    WBENCHSCREEN /* Type */
  56. };
  57.  
  58. SHORT Values[] =
  59. {
  60.    0,0,
  61.    999,0,
  62.    999,10,
  63.    0,10,
  64.    0,0
  65. };
  66.  
  67. struct Border Bord =
  68. {
  69.    0,0,
  70.    1,0,
  71.    JAM1,
  72.    5,
  73.    Values,
  74.    NULL
  75. };
  76.  
  77. struct IntuiText Text =
  78. {
  79.    1,0,    /* FrontPen, BackPen */
  80.    JAM2,   /* DrawMode */
  81.    2,2,    /* LeftEdge, TopEdge */
  82.    NULL,   /* Font */
  83.    (UBYTE *)"Test",    /* TextPointer */
  84.    NULL                 /* NextText */
  85.    );
  86.    
  87.    
  88. void Open_All(), Close_All();
  89.  
  90. main()
  91. {
  92.    struct RastPort *RP;
  93.    
  94.    Open_All();
  95.    
  96.    RP = FirstWindow->RPort;
  97.    
  98.    Calc_Border(&Text);
  99.    
  100.    DrawBorder(RP,&Bord,10L,30L);
  101.    PrintIText(RP,&Text,10L,30L);
  102.    
  103.    Delay(180L);
  104.    
  105.    Close_All();
  106.    
  107. }
  108.  
  109.  
  110. /* Open All */
  111.  
  112. void Open_All()
  113. {
  114.    void  *OpenLibrary();
  115.    struct Window *OpenWindow();
  116.    
  117.    
  118.    if(!(IntuitionBase =(struct IntuitionBase *)
  119.       OpenLibrary("intuition.library",0L)))
  120.       {
  121.          printf("Unable to open Intuition Library!!!\n");
  122.          Close_All();
  123.          exit(FALSE);
  124.       }
  125.       
  126.  
  127.    if(!(FirstWindow = (struct Window *)
  128.       OpenWindow(&FirstNewWindow)))
  129.       {
  130.          printf("Window cannot be opened!!!\n");
  131.          Close_All();
  132.          exit(FALSE);
  133.       }
  134.    }
  135.    
  136. /* Close Everything */
  137.  
  138. void Close_All()
  139. {
  140.    if(FirstWindow) CloseWindow(FirstWindow);
  141.    if(IntuitionBase) CloseLibrary(IntuitionBase);
  142.    }
  143.       
  144. /* Calc_Border */
  145.  
  146. Calc_Border(Text)
  147. struct IntuiText *Text;
  148. {
  149.    int Width =0;
  150.    
  151.    Width = IntuiTextLength(Text);
  152.    
  153.    Values[2]=Width+4; 
  154.    Values[4]=Width+4;
  155.    }
  156.        
  157.               
  158.    
  159.                                   
  160.                                          
  161.    
  162.  
  163.     This program is listed verbatum in Amiga C for Advanced Programmers by
  164. Abacus Page 173.  Thanks.
  165.  
  166.                         Brian
  167. -- 
  168. Brian Feeny - Systems Programmer - UNIX System Security Specialist
  169.    __
  170. __///          Internet: signal@phantom.com       "Grep me no patterns and
  171. \XX/ AMIGA!              xnybpf01@serss0.fiu.edu   I'll tell you no lines"
  172.