Got an idea for enhancing PureBasic? New command(s) you'd like to see?
-
Leonhard
- User

- Posts: 55
- Joined: Fri Jun 16, 2006 7:43 am
Post
by Leonhard »
I need Macro-Parameters with ',' and would make Keywords with Macros.
So I wrote there examples:
Code: Select all
Macro Call(ProcedureName, Header)
ProcedureName(Header)
EndMacro
Debug Call(RGB, {255, 255, 255})
Code: Select all
Macro ConsoleColor CharacterColor, BackgroundColor = 0
ConsoleColor(CharacterColor, BackgroundColor)
EndMacro
ConsoleColor 7
-
freak
- PureBasic Team

- Posts: 5940
- Joined: Fri Apr 25, 2003 5:21 pm
- Location: Germany
Post
by freak »
Code: Select all
Macro Call(ProcedureName, Header)
ProcedureName#Header
EndMacro
Debug Call(RGB, (255, 255, 255))
this works.
quidquid Latine dictum sit altum videtur
-
Leonhard
- User

- Posts: 55
- Joined: Fri Jun 16, 2006 7:43 am
Post
by Leonhard »
yes, but i would have Macros for Keywords
-
freak
- PureBasic Team

- Posts: 5940
- Joined: Fri Apr 25, 2003 5:21 pm
- Location: Germany
Post
by freak »
your second example is just ugly syntax imho

quidquid Latine dictum sit altum videtur
-
Leonhard
- User

- Posts: 55
- Joined: Fri Jun 16, 2006 7:43 am
Post
by Leonhard »
How can it have a better syntax?
-
Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Post
by Kaeru Gaman »
arguments for procedures/functions in PB are always included in brackets.
if you want no brackets, write a complete parser...
oh... and have a nice day.
-
Leonhard
- User

- Posts: 55
- Joined: Fri Jun 16, 2006 7:43 am
Post
by Leonhard »
freak wrote:your second example is just ugly syntax imho

is this better?
Code: Select all
Macro Call(ProcedureName, Header)
ProcedureName(Header)
EndMacro
Debug Call(RGB, ´255, 255, 255´)
-
Michael Vogel
- Addict

- Posts: 2797
- Joined: Thu Feb 09, 2006 11:27 pm
-
Contact:
Post
by Michael Vogel »
Leonhard, what's about your third (or fourth?) example?
-
Leonhard
- User

- Posts: 55
- Joined: Fri Jun 16, 2006 7:43 am
Post
by Leonhard »
Michael Vogel wrote:Leonhard, what's about your third (or fourth?) example?
Is a other syntax-unsing to the first example.
I use ´ in place of { and } .