home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / VOGLE.ZIP / EXAMPLES / PGETSTR.P < prev    next >
Text File  |  2000-02-11  |  893b  |  61 lines

  1. program getstr;
  2. (*
  3.  * Test the getting of strings in graphics mode.
  4.  *)
  5. #include 'Vogle.h'
  6.  
  7.  
  8. var
  9.     device: string_t;
  10.     cw, ch: real;
  11.     i, n: integer;
  12.     buf: array [1..10] of string_t;
  13.     line: string_t;
  14.  
  15. begin
  16.  
  17.     write('Enter output device: ');
  18.     readln(device);
  19.  
  20.     Vinit(device);
  21.  
  22.     VgetDev(line);
  23.     writeln('Vgetdev returns: ', line);
  24.  
  25.     Clipping(false);
  26.  
  27.     Window(-1.0, 1.0, -1.0, 1.0, 1.0, -1.0);
  28.     LookAt(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0);
  29.  
  30.     TextSize(0.1, 0.25);
  31.  
  32.  
  33.     Rotate(30.0, 'x');
  34.     Rotate(30.0, 'z');
  35.     Rotate(60.0, 'y');
  36.  
  37.     Color(BLACK);
  38.     Clear;
  39.     Color(YELLOW);
  40.  
  41.     Rect(-0.5, -0.5, 0.5, 0.5);
  42.     Move2(-0.5, 0.0);
  43.  
  44.     Color(GREEN);
  45.  
  46.     n := 1;
  47.  
  48.     repeat
  49.         i := GetString(BLACK, buf[n]);
  50.         if (i > 0) and (n < 10) then 
  51.             n := n + 1
  52.  
  53.     until (i <= 0) or (n > 10);
  54.             
  55.     Vexit;
  56.  
  57.     for i := 1 to n - 1 do
  58.         writeln('Line ', i, ' was: ', buf[i])
  59.  
  60. end.
  61.