Textual substitions

Post your requests and ideas on the future development of mikroPascal.
Post Reply
Author
Message
Frank
Posts: 12
Joined: 31 Mar 2005 20:57
Location: Eindhoven, NL

Textual substitions

#1 Post by Frank » 05 Apr 2005 16:15

Hi guys,

would it be possible to integrate textual substitutions ?
For example something like :

#define switch_1_closed as testbit(portc,4)=0

This would make the program easier to read and write
So the program would read
if switch_1_closed then ...
instead of testbit(portc,4)=1
Offcourse this can be done by using a function, but this is lesser code
and therefor faster

Even trickier:

When bit 4 in the example above is a variable or constant i:
#define switch_1_closed as testbit(portc,{bitno})=0

var bitno : byte;
...
bitno:=4;

then
if testbit(portc,bitno)=1

could be replaced by
if switch_1_closed

This is very handy when using arrays etc.

nikola
mikroElektronika team
Posts: 137
Joined: 03 Aug 2004 12:44
Contact:

Re: Textual substitions

#2 Post by nikola » 05 Apr 2005 17:16

Frank Kloprogge wrote:would it be possible to integrate textual substitutions ?
What you are asking for is a simple macro support. In mikroC, you have preprocessor at your disposal for this kind of text replacement. In mikroBasic, you can use symbol for this task.

At present, we have no plans of including symbols in mikroPascal, but it could be done eventually.

-

rah
Posts: 1
Joined: 30 Jul 2006 00:45

Add support for symbols in mikroPascal

#3 Post by rah » 30 Jul 2006 01:02

It would be very helpful to allow symbols particularly for port addresses. With the 40 pin PICs, and several projects underway at a time, keeping track of which port and pin is the "green led" on each project can be time consuming. It would also be useful when deciphering longer listings developed several months earlier. Even when a program is well documented, it takes a while to locate the line that describes porte pin 2. The "textual substitution" (simple macro support) that Frank proposed should be even more powerful.

Post Reply

Return to “mikroPascal Wish List”