home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / cobol / library / cwindow / ufc015.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-28  |  1.4 KB  |  50 lines

  1. /* MS C, MS Quick C
  2.   ufc015.c example for dynamic attribute modification
  3.  
  4. attribut file <testfmt.att>
  5. ---------------------------
  6. Format-Textattribut:    8
  7. Format-Rahmenattribut: 10
  8. unsigned char fld0[12];
  9.  Distanzen in Bereich <Daten>:   Feldattribut: 500    Feldtyp: 502   
  10. long fld1;
  11.  Distanzen in Bereich <Daten>:   Feldattribut: 507    Feldtyp: 509   
  12. unsigned char fld2[40];
  13.  Distanzen in Bereich <Daten>:   Feldattribut: 514    Feldtyp: 516   
  14. */
  15.  
  16. #include "_ufc01.h"
  17. #include "testfmt.h"
  18. main()
  19. {
  20. MOUSEON();
  21. /* normal output */
  22. #include "testfmt.i"
  23. memcpy(testfmt.fld2," output with generated attributes !    ",40);
  24. memcpy(FMT,"testfmt ",8);
  25. FKZ = 2; SM = 0; RET=55;
  26. UNIF(&FKZ, FMT, testfmt.fld0, &RET, &SM, Daten);
  27.  
  28. /* change colour of field fld0 and fld1 */
  29. Daten[500]=(char)15;
  30. Daten[507]=(char)7;
  31. memcpy(testfmt.fld2," new colour for fld0 and fld1 !         ",40);
  32. FKZ = 3; RET=55;
  33. UNIF(&FKZ, FMT, testfmt.fld0, &RET, &SM, Daten);
  34.  
  35. /* change access of field fld0 and fld1 */
  36. Daten[502]='a';
  37. Daten[509]='a';
  38. memcpy(testfmt.fld2," fld0 and fld1 as output fields !       ",40);
  39. FKZ = 3; RET=55;
  40. UNIF(&FKZ, FMT, testfmt.fld0, &RET, &SM, Daten);
  41.  
  42. /* change colour of text and frame */
  43. Daten[8]=(char)112;
  44. Daten[10]=(char)44;
  45. memcpy(testfmt.fld2," new colour for text and frame !       ",40);
  46. FKZ=2; RET=55;
  47. UNIF(&FKZ, FMT, testfmt.fld0, &RET, &SM, Daten);
  48. MOUSEOFF();
  49. }
  50.