U
U
uzi_no_uzi2018-09-24 22:37:59
Pascal
uzi_no_uzi, 2018-09-24 22:37:59

Can't convert real to integer?

What am I doing wrong? I also tried to set the integer type for these variables at once, but it did not help.
5ba93d15ac23e167247230.jpeg

Program asdasdas;
uses GraphABC;
begin;

  var wWidth, wHeight: integer;
  writeln('Введите размер окна');
  writeln('Ширину:');
    readln(wWidth);
  writeln('Высоту:');
    readln(wHeight);
  SetWindowSize(wWidth, wHeight);

  var figureWidth, figureHeight: integer;
  writeln('Введите размер фигуры');
  writeln('Ширину:');
    readln(figureWidth);
  writeln('Высоту:');
    readln(figureHeight);

  //Options

  SetPenWidth(3);

  //Write center lines

  var centerLineWidth, centerLineStartPoint: real;

  centerLineWidth:= int(wWidth/100 * 57.14);
  centerLineStartPoint:= int(wWidth/100 * 21.43);
  Line(centerLineStartPoint, 0, centerLineStartPoint + centerLineWidth, 0);

end.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2018-09-24
@uzi_no_uzi

var
  i: integer;
...
  i := round(floatVar);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question