Adding commands
Adding commands
If I were interested in adding some new commands to the PB language how would I go about doing it?
Jason
Jason
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
- tinman
- PureBasic Expert
- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Look in the LibrarySDK folder of your PB install. There are documents and examples of how to create libraries with new commands and plugins for different image formats and gadgets / controls.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Why with ASM inside?Psychophanta wrote:The easiest and simplest way i think is to write Macros with ASM inside and save it as PB include files.
Then, hop!, there are new custom commands for their use![]()

Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Re: Adding commands
Create a lib with regular PB code. (use ProcedureDLL for exported funcionts) and then use TailBite to make them a lib.jcoggins wrote:If I were interested in adding some new commands to the PB language how would I go about doing it?
Jason
Look here for TailBite: http://www.purebasic.fr/english/viewforum.php?f=26
Something like this:
Code: Select all
ProcedureDLL MyNewCommand(param)
;do whatever you want
ProcedureReturn 1
EndProcedure
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
oh ok, sorry, I was trying to match with "easiest and simplest" 

Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Actually, I was thinking more alone the lines of adding a new command that did something the current version of the language does not do. For example, a moviePlaying command that can be used with an .mp3 audio file that returns true if the movie is playing or false otherwise. Or a command that can be used to get the length (in seconds) of an .mp3 file (that does not contain frames).
Jason
Jason
In that case you are probably looking to create a lib. Take a look at the tailbite section of the forums. You can create a proc to do what you want and then use tailbite to create the lib and put it in a certain PB direction and PB will use it like it's own addins for database, linkedlists or whatever
atleast that's my understanding, I've never actually bothered to do it myself, I just create include files and add them when I need them
atleast that's my understanding, I've never actually bothered to do it myself, I just create include files and add them when I need them
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
how to include the commands, you have some ways now - Includes, DLLs or UserLibs.For example, a moviePlaying command that can be used with an .mp3 audio file that returns true if the movie is playing or false otherwise. Or a command that can be used to get the length (in seconds) of an .mp3 file (that does not contain frames).
how to program it, you'll have to learn some API-stuff and some ASM.
you have to know how to program it, if you want to include a command that returns the length of an mp3.
oh... and have a nice day.