Recent

Author Topic: Why this code doesn't compile?  (Read 1141 times)

1q5xaaqz

  • New Member
  • *
  • Posts: 30
Why this code doesn't compile?
« on: February 28, 2022, 05:55:30 pm »
{$macro on}

{$define TIMEOUT_INFINITE:= dword(-1)}

The error is fatal syntax error: "identifier" expected but found "-"

Thaddy

  • Hero Member
  • *****
  • Posts: 19262
  • Glad to be alive.
Re: Why this code doesn't compile?
« Reply #1 on: February 28, 2022, 06:08:50 pm »
Code: Pascal  [Select][+][-]
  1. {$macro on}
  2. {$define TIMEOUT_INFINITE:= high(dword)}
  3. begin
  4.   writeln(longint(TIMEOUT_INFINITE)); // -1 if you back cast it and proof the macro is now correct.
  5. end.
« Last Edit: February 28, 2022, 06:28:27 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

1q5xaaqz

  • New Member
  • *
  • Posts: 30
Re: Why this code doesn't compile?
« Reply #2 on: February 28, 2022, 06:22:52 pm »
Thank you.

 

TinyPortal © 2005-2018