I develope with Delphi and from here I have a wish, maybe easely to realise. I can define some FLAG for a hole programm.
I shout define a Flag in the main programm and check it in all linked units.
Is that possible to implement?
best regards
$DEFINE over the hole programm
Re: $DEFINE over the hole programm
Yeah, thats an good Idea!! At this moment I try LunaAVR, that have this feature and I like it,
but I want to USe Mikropascal too, because I hope it will be more better in the Future,so I want this feature too!
but I want to USe Mikropascal too, because I hope it will be more better in the Future,so I want this feature too!
Re: $DEFINE over the hole programm
Hi,
You may do something similar with the Project Level Defines, please check this topic in the Help file.
Regards,
Filip.
You may do something similar with the Project Level Defines, please check this topic in the Help file.
Regards,
Filip.
Re: $DEFINE over the hole programm
oh, I'm not shure, If this is what I mean....
In C there is #define led1 as PortB.5;
led1:=1; //switch led on...
In C there is #define led1 as PortB.5;
led1:=1; //switch led on...
Re: $DEFINE over the hole programm
Hi,
You cannot do this in Pascal, you can just define a flag which you will test in the code :
Regards,
Filip.
You cannot do this in Pascal, you can just define a flag which you will test in the code :
Code: Select all
program Example;
{$DEFINE flag}
begin
{$IFDEF flag}
DDRC := 0xFF
PORTC := 0xAA
{$ENDIF}
end;
Filip.
Re: $DEFINE over the hole programm
oh, ok...that is not realy easier to read if I have long code an maybe 16LEDs..and 16 Idefs...
Re: $DEFINE over the hole programm
hi,
You can do this :
I think it's what you want to do.
Regards
Stéf
You can do this :
Code: Select all
{$DEFINE flag_1}
var
{$IFDEF flag_1}
PortR_ : sbit at PORTB.0;
PortV_ : sbit at PORTB.1;
PortB_ : sbit at PORTB.2;
{$ENDIF}
{$IFDEF flag_2}
PortR_ : sbit at PORTC.0;
PortV_ : sbit at PORTC.1;
PortB_ : sbit at PORTC.2;
{$ENDIF}
Begin
PortR_ := 1;
PortV_ := 0;
PortB_ := 1;
end;
Regards
Stéf