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.
i LIKE CAN TO USE DEFINE ALIKE C
-
- Posts: 272
- Joined: 17 Feb 2009 02:39
- Location: Colombia
- Contact:
Re: i LIKE CAN TO USE DEFINE ALIKE C
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;
-
- Posts: 111
- Joined: 19 Sep 2006 21:21
- Location: Julian NC, US
- Contact:
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,
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
-
- Posts: 272
- Joined: 17 Feb 2009 02:39
- Location: Colombia
- Contact:
About define
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.
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.
Re: About define
No sorry, this is beyond Pascal syntax.