The ability to use substitute names for command names

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

The ability to use substitute names for command names

Post by Amiga5k »

So I can use 'Function/EndFunction' instead of 'Procedure/EndProcedure'. But also, so very long command names such as 'CountTreeGadgetNodeItems' could be shortened to something easier to remember and quicker to type.

Russell

p.s. An advanced macro facility would make this a snap ;) (I know macros have been requested at least 1,327 times...)
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: The ability to use substitute names for command names

Post by PB »

> So I can use 'Function/EndFunction' instead of 'Procedure/EndProcedure'.

This has been asked for before and I don't think it's easily done. Also, it
raised the important issue of asking for help: if you have your own set of
commands, then you can no longer use these forums to ask for help...
because nobody will know what your commands are for, and they can't
just cut/paste your snippets to compile. Is that worth it? :?:
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: The ability to use substitute names for command names

Post by GPI »

As i know, Macros are planed for PB and then such things are very easy to do.

You must only include always the definition-file in each project.

GPI
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Re: The ability to use substitute names for command names

Post by Amiga5k »

PB wrote:> So I can use 'Function/EndFunction' instead of 'Procedure/EndProcedure'.

This has been asked for before and I don't think it's easily done. Also, it
raised the important issue of asking for help: if you have your own set of
commands, then you can no longer use these forums to ask for help...
because nobody will know what your commands are for, and they can't
just cut/paste your snippets to compile. Is that worth it? :?:
Basically 'all' that would need to be done is, in the editor (the compiler would not need to be altered) a special version of the syntax highlighting list which is already used, would have an alternate name to look for. If this alternate name is found, it is highlighted just like the others and then when it's time to compile the editor looks through the code and replaces the new with the old before sending the file to the compiler.

As far as your last point, a simple 'show original keywords' menu item or button would search the document and un-replace the keywords and then the code could be easily copy\pasted to this forum. :)

Essentially, the whole purpose would be to make the commands that are already there shorter or, ahem, more sensibly named: The actual use of the commands would not be affected in any way.

I ask for this feature because this is one of the few things that bug me about PB: The keyword naming conventions - usually just way too long or sometimes misspelled :) (sorry, Fred ;) )

(The other is the manual, but that is being worked on as we speak...)

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
Post Reply