IDE : Give us a predefined Templates collection

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

IDE : Give us a predefined Templates collection

Post by Flype »

The PureBasic IDE comes with a template system which is really usefull.

it would be very nice to have a predefined template collection bundled with the PureBasic installer.

for example, most of the snippets presents in the documentation can be included as templates.
This way we could have a ready to use snippet for each function of purebasic.



:idea: :?:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Yeah, there could be a directory with example templates in that template window. And maybe a group of people should make templates for common used stuff, but don't include the whole CodeArchive.
I like logic, hence I dislike humans but love computers.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

If your after a library of templates it will soon get muddled without an ordering system. This could be as simple as coding the template window to support folders? Does the template window already support folders? (i'm at work and can't check)
--Kale

Image
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

@kale.

yes it support folders. fortunately. so the template system shows a tree of templates.
this way it's possible to sort by 'chapter' (Window, Gadget, Screen, and so on) all the need stuff.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Its not such a bad idea actually. We'll see what i can do for the next version.
quidquid Latine dictum sit altum videtur
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Image
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

Isn't this a bit what CodeCaddy and the CodeArchiv are trying to achive?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

well not really,
i think more just about very little snippets of 10/15/20 lines max to show how to use a purebasic function. just like the ones in the purebasic.chm. not a wide one. each user can make it's own template then.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

Mmmm okay, but I don't see how it would help much, I mean, what's to stop me making a little source with all my own examples, and do a search (or hit ^F1) to look up a word in it? Well, perhaps if the feature is there I applaud for it :-) as it probably is me who doesn't understand it :?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Having a template for creating a window with event loop is very handy.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Yes for example, and

a screen template,
a console template,
a systray template,
a toolbar template,
etc...

Especially for newbies ! but also for everybody (time saving).


Another things that might help newbies :

Having a wizard like Visual Studio or DevC++ to create a new project in which you can choose between a window app, a console app, a screen app that open an associated template.

Also, the little help/description for the functions in the bottom editor might be (IMHO) more useful to the final programmer if the type of arguments were described.

For example, OpenWindow() shows :
OpenWindow (#Window, x, y, InnerWidth, InnerHeight, Title$ [, Flags [, ParentID]]) - Opens a new window according to the specified parameters.
It might be better this way :
Window.l = OpenWindow (PBId.l, x.l, y, InnerWidth.l, InnerHeight.l, Title.s [, Flags.l [, ParentID.l]]) - Opens a new window according to the specified parameters.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

I actually have a few templates setup in my IDE. here is the templates files if your interested. Just drop into your Purebasic folder (backup yours if you dont want mine to overwrite).

http://www.kalekold.net/Purebasic/Misc/Templates.prefs

I wonder if theres a way we could colaborate online to build a open template repository?
--Kale

Image
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Post by dontmailme »

Kale wrote:I wonder if theres a way we could colaborate online to build a open template repository?
Nice idea, especially if it was sponsored by the PB team...... in other words it was a semi-official one which we could help to write which would be included in the PB releases or at least a link on the download page.

8)
Paid up PB User !
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

My plan is to allow several tempate files to be viewed (through a combobox probably)
This would allow to keep such a proposed "help examples" list separate from
user created ones, and it would also allow easier sharing of the templates.
quidquid Latine dictum sit altum videtur
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

hi freak,

i'm not bumping, just going to news.

i understand very well that it is not a priority (even for myself), but just wondering if you still have this one (or something like this) in your todo list ?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Post Reply