Page 1 of 1
Special Macro for types
Posted: Wed Mar 04, 2015 7:20 pm
by Josh
In many cases a special typedeclaration could make code better understandable. For example:
Code: Select all
TypeMacro bool
w
EndTypeMacro
Test.bool
Could also be useful for better checkable C-Structures
Code: Select all
TypeMacro CLongLong
q
EndTypeMacro
Test.CLongLong
According to the diskussions 1-2 PB releases back, it would make sense, that the TypeMacro could change typedeclarations to nothing
Code: Select all
TypeMacro AnyTerm
EndTypeMacro
*Test.AnyTerm
Re: Special Macro for types
Posted: Wed Mar 04, 2015 8:07 pm
by Little John
Josh wrote:In many cases a special typedeclaration could make code better understandable. For example:
Code: Select all
TypeMacro bool
w
EndTypeMacro
Test.bool
Could also be useful for better checkable C-Structures
Code: Select all
TypeMacro CLongLong
q
EndTypeMacro
Test.CLongLong
This can already be done with normal macros, no special "TypeMacro" needed.
Code: Select all
Macro bool
i
EndMacro
Macro CLongLong
q
EndMacro
a.bool
b.CLongLong
Re: Special Macro for types
Posted: Wed Mar 04, 2015 8:41 pm
by Josh
Little John wrote:
Could also be useful for better checkable C-Structures
Yes, thats clear. But when I fill my project with a lot of standard macros, i will get much trouble and this case of problems are hard to find. I always try to use unique identifier, but its not reasonable in each case.
With special macros i could use short and clear types without problems.
BTW: Changing to nothing is not possible with standard macros
Re: Special Macro for types
Posted: Thu Mar 05, 2015 1:49 am
by Little John
Josh wrote:Little John wrote:
Could also be useful for better checkable C-Structures
No, I didn't write that.
I wrote:
This can already be done with normal macros, no special "TypeMacro" needed.
Josh wrote:Yes, thats clear. But when I fill my project with a lot of standard macros, i will get much trouble and this case of problems are hard to find. I always try to use unique identifier, but its not reasonable in each case.
Sorry, I don't understand what the problem is with just using normal macros that are already available in PB.
Giving unique names to identifiers is possible now, without such a "TypeMacro".
Josh wrote:BTW: Changing to nothing is not possible with standard macros
That's true. And the only purpose of that seems to be re-introducing obsolete syntax that has been abandoned.

Re: Special Macro for types
Posted: Thu Mar 05, 2015 5:04 am
by Josh
Little John wrote:Josh wrote:Little John wrote:
Could also be useful for better checkable C-Structures
No, I didn't write that.
I wrote:
This can already be done with normal macros, no special "TypeMacro" needed.
Ups, sorry. I shorted the quotation wrong.
Little John wrote:Sorry, I don't understand what the problem is with just using normal macros that are already available in PB. Giving unique names to identifiers is possible now, without such a "TypeMacro".
I see in your first post, that you don't understand. I want to give
short and
clear additional informations about the needed parameters shown in the statusbar quickhelp.
For me its better readable:
Code: Select all
Procedure Test (Param1.ui, Param2.bool, Param3.color)
instead of:
Code: Select all
Procedure Test (Param1.AUniqueType_ui, Param2.AUniqueType_bool, Param3.AUniqueType_color)
Re: Special Macro for types
Posted: Thu Mar 05, 2015 9:49 pm
by Little John
Josh wrote:Little John wrote:Sorry, I don't understand what the problem is with just using normal macros that are already available in PB. Giving unique names to identifiers is possible now, without such a "TypeMacro".
I see in your first post, that you don't understand.
Josh wrote:I want to give short and clear additional informations about the needed parameters shown in the statusbar quickhelp.
Yes, this works fine here (with PB 5.31) with normal macros, like the examples that I wrote in my first post.