home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP_ADV.ZIP / LIST0410.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-07-31  |  895 b   |  28 lines

  1. /* This C Module has its main procedure StartUpC called from */
  2. /* the Turbo Pascal program that links this in.  This will   */
  3. /* then make a call to a procedure within the pascal code.   */
  4. /* Additionally, this module modifies a variable in the      */
  5. /* Pascal code.  This variable is actually contained within  */
  6. /* Turbo Pascal's CRT unit.                                  */
  7.  
  8. #include "savesidi.h" /* include header for reg save routine */
  9.  
  10. extern WORD TPTextAttr;
  11.                      /* variable defined in pascal code.     */
  12.  
  13. extern int I;        /* second variable defined in pascal    */
  14.  
  15. extern void CallFromC (int I);
  16. /* Pascal procedure we will call from this C module          */
  17.  
  18. void StartUpC (void)
  19. {
  20.   register int count;
  21.   for (count = 1; count <= 10; count++) {
  22.     save_sidi;
  23.     CallFromC(I++);
  24.     rest_sidi;
  25.     TPTextAttr = count;
  26.   }
  27. }
  28.