Compilation error for negative constant on right side of an operation
Hi GPC crew, The following sample code does not compile properly with GPC (20050331). Program Real; Var R1, R2 : Real; Begin R1 := 4.21; R2 := R1 * -1.0; WriteLn(R2); End. GPC output: real.pas:6: error: syntax error before `-' The problem occurs with negative integer constants and any operator (+-*/) as well. Strange enough, if I modify the code for: R1 := 4.21; R2 := -1.0; R2 := R1 * R2; Or even for: R2 := -1.0 * R1; The code compiles and the output is as expected. It looks like one can assign a negative constant to a variable but cannot use it as an operand if it is on the right side. This is not a problem for multiplying but for the other operators... Could this be a bug? Thanks Pascal Viandier pascal@accovia.com
participants (3)
-
Adriaan van Os -
Frank Heckenbach -
Pascal Viandier