i LIKE CAN TO USE DEFINE ALIKE C

Post your requests and ideas on the future development of mikroPascal PRO for PIC.
Post Reply
Author
Message
alcidesramos
Posts: 272
Joined: 17 Feb 2009 02:39
Location: Colombia
Contact:

i LIKE CAN TO USE DEFINE ALIKE C

#1 Post by alcidesramos » 02 May 2009 00:05

FOR EXAMPLE
#DEFINE OUT=PORTC;

#DEFINE OUT_OFF=PORTC:=0;

THEN I CAN DO:

OUT:=255;
DELAY_MS(500)
OUT_OFF;

NOW I CAN DO ITS WITH POINTER BUT NO IT THE IDEA.

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: i LIKE CAN TO USE DEFINE ALIKE C

#2 Post by zristic » 04 May 2009 08:48

alcidesramos wrote:FOR EXAMPLE
#DEFINE OUT=PORTC;

#DEFINE OUT_OFF=PORTC:=0;

THEN I CAN DO:

OUT:=255;
DELAY_MS(500)
OUT_OFF;

NOW I CAN DO ITS WITH POINTER BUT NO IT THE IDEA.

This is how you can do it:

Code: Select all

var OUT: byte at PORTC;

John Ferrell
Posts: 111
Joined: 19 Sep 2006 21:21
Location: Julian NC, US
Contact:

#3 Post by John Ferrell » 04 May 2009 13:59

A great solution!
I failed to grasp the "AT" keyword in the manual on the first scan through. It is documented under the "SBIT" keyword on page 117 in the manual as well as in the compiler help file.
It would be nice to include an example or two of its use under the topic "VAR" keyword.

I consider it a fix for my earlier request for a "Define" keyword.
Thanks,
John Ferrell W8CCW

alcidesramos
Posts: 272
Joined: 17 Feb 2009 02:39
Location: Colombia
Contact:

About define

#4 Post by alcidesramos » 04 May 2009 22:29

Thank you,
I try

var ARZ: byte at PORTC;

This work
excelent.

But i like to:

Apado:=portc:=$0f;
prendido:=portc:=$00;

I can use this in my code this no posible.

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: About define

#5 Post by zristic » 05 May 2009 10:58

No sorry, this is beyond Pascal syntax.

Post Reply

Return to “mikroPascal PRO for PIC Wish List”