Procedure/EndProcedure -> Proc/EndProc

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Procedure/EndProcedure -> Proc/EndProc

Post by Keya »

I dont want to go about requesting shorter aliases for every function - I can deal with MessageRequester, but I feel this one really would be a good efficiency boost for all PB developers, and hopefully take Fred only a minute to implement:
- having native support for something like "Proc/EndProc" instead of "Procedure/EndProcedure"

It might even sound like a petty request, maybe it is - it's only a few keystrokes afterall... but the amount of times we have to type them, it really adds up, and so does the frustration of having to type what are essentially useless keystrokes

Thankyou for considering my 1st-world request :)
User avatar
TI-994A
Addict
Addict
Posts: 2704
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Procedure/EndProcedure -> Proc/EndProc

Post by TI-994A »

Keya wrote:...requesting shorter aliases for every function... like "Proc/EndProc" instead of "Procedure/EndProcedure"
You could simply implement macros for that. Just six lines, and your wish come true. :wink:

Code: Select all

Macro Proc
  Procedure
EndMacro

Macro EndProc
  EndProcedure
EndMacro
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Procedure/EndProcedure -> Proc/EndProc

Post by Keya »

yes of course, but as that's not native support you still have to type or include them every time
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Procedure/EndProcedure -> Proc/EndProc

Post by IdeasVacuum »

I run a one-click macro in UltraEdit which inserts Procedure-EndProcedure, including an underline. That can also be done for functions such as message requester where you simply "fill-in the blanks".
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Procedure/EndProcedure -> Proc/EndProc

Post by Marc56us »

I type only pro followed by [Tab][Tab]
IDE reply: Procedure EndProcedure


Faster: With some other macro external tool, I have done some macro like

Code: Select all

pep=Procedure{return}EndProcedure{up}{space}
msb=MessageRequester("", ""){left}{left}{left}{left}{left}{left}
sgt=SetGadgetText(){left}
sgs=SetGadgetState(){left}
Etc.

{left/right/up/return} = cursor commands: set where I need to put next text
Last edited by Marc56us on Tue Jan 03, 2017 4:27 pm, edited 1 time in total.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Procedure/EndProcedure -> Proc/EndProc

Post by Fred »

We won't implement such change in PB because it will be messy to have 2 ways to do the same thing. Using autocomplete is useful to save some typing:

https://youtu.be/Zf6a2KPHI_U

You can use tab/tab after typing 'proc' and it will autocomplete the keyword and add the endkeyword (works for any keywords which got an endkeyword)
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Procedure/EndProcedure -> Proc/EndProc

Post by Mistrel »

Autocomplete is the solution for this. :|

You can do this in your own custom environment already with macros:

Code: Select all

Macro Proc
Procedure
EndMacro

Macro EndProc
EndProcedure
EndMacro

Proc a()
  Debug "Hello!"
EndProc

a()
The IDE supports adding custom keywords so that they will highlight as the proper color.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Procedure/EndProcedure -> Proc/EndProc

Post by Tenaja »

When I first started with PB, I would have been a HUGE +1 for this. I even implemented my own macros. Unfortunately, macros killed code samples unless you also include those, so I set up the autocomplete and after a week or so haven't looked back.
Post Reply