Error in help: "$UNDEFINE" should be "$UNDEF" - confirmed

Beta Testing discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Error in help: "$UNDEFINE" should be "$UNDEF" - confirmed

#1 Post by Dany » 18 Jun 2011 19:01

v4.80 bèta: "{$UNDEFINE ...} does not work, {$UNDEF ...} does.

According to the helpfile:
Use $UNDEFINE to undefine (“clear”) previously defined flag.
This directive does not seem to work, but $UNDEF does work as intended, see code below:

Code: Select all

program Undefinetest;
var str: string[10];
begin
{$DEFINE abc}
{$IFDEF abc}
  Str := 'abc';  // <--- executed, OK
{$ELSE}
  Str := 'def';
{$ENDIF}

{$UNDEFINE abc}
{$IFDEF abc}
  Str := 'abc';  // <--- executed, NOT OK
{$ELSE}
  Str := 'def';
{$ENDIF}

{$UNDEF abc}
{$IFDEF abc}
  Str := 'abc';
{$ELSE}
  Str := 'def';// <--- executed, OK, apparently $UNDEF does undefine
{$ENDIF}

{$DEFINE abc}
{$IFDEF abc}
  Str := 'abc';// <--- executed, OK
{$ELSE}
  Str := 'def';
{$ENDIF}

end.
Thanks in advance!
Last edited by Dany on 02 Aug 2011 12:13, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: v4.80 bèta: "{$UNDEFINE ...} does not work {$UNDEF ...}

#2 Post by filip » 20 Jun 2011 10:36

Hi,

This is an error in the help file, which we will correct.
Thank you for the report and I apologize for the inconvenience.

Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 Beta Testing”