Community Project: BlitzMax Examples in Helpfiles
BlitzMax Forums/BlitzMax Programming/Community Project: BlitzMax Examples in Helpfiles
| ||
***Update July 9th, New milestone reached.More than 60% of functions/methods now have examples. The latest version can be downloaded from http://www.2dgamecreators.com/files/ -------------------------------- Hi, I have created a system whereby user examples can be appended to the official document which is then produced as a compiled helpfile. The plan is for users to contribute examples in this thread and I will transfer them into the compiled helpfile. There is a table showing which functions already have example(s) so we can concentrate on those without. See http://www.2dgamecreators.com/files/examples.htm Current score: 30% of ~750 total functions have examples To Contribute code to this thread, the contributor has the rights to the code and declares said code as public domain. Depending upon number of contributions, I will endeavour to update the table and helpfile at least once a month until we reach a level of 90%. |
| ||
Code Entry: AppSuspendedSuperStrict SetGraphicsDriver GLMax2DDriver() Graphics 800,600 While Not KeyHit(KEY_ESCAPE) Cls If AppSuspended() = True DrawText "Application Suspended!",10,10 Else DrawText "Application Running...",10,10 EndIf Flip Wend |
| ||
Under what copyright/licencing are you releasing the help-file? |
| ||
Note, that you may need to fully cover the various situations that can happen for a specific function/command, like: 2d, GUI, non-hooked and hooked, with globals, without globals, etc. In addition, examples should be as small as possible, not like having a zillion lines of code with a zillion different -difficult- things to find your way through. Because of all this, I recommend that someone looks into the given examples to make 'em "complete" and uniform. |
| ||
If you start dissecting it like that, it will become hell on earth for beginners to understand anything. |
| ||
Nah, check B+ manual: Appendix 2 'five ways to say Hello World'. That's exactly what's needed: multiple examples of the same thing, in all kinda forms and shapes. Non-GUI, GUI etc. One example might not be able to teach something, but multiple examples doing the same thing will! |
| ||
North: Thanks Otus: As far as I am concerned the original docs belong to BRL, all I'm doing is compiling them. The reason for asking the code to be public domain is to allow BRL, if they so wish, to incorporate the examples into the docs directly. CS_TBL:The contributions can cover any/all variation of the functions. The system can cope with multiple examples for the one function. I will try to do some editing but no guarantees on 'complete' & uniform :) |
| ||
so, examples should be emailed to you, or posted here? |
| ||
+ should always superstrict be assumed? (matters in declaring variables) |
| ||
CS_TBL:posted here. Superstrict would be better |
| ||
Then there's the situation of commands belonging together, like the whole bank family. You want want -in case of the banks- a big example having all the pokes and peeks 'n stuff, or unique examples tailormade for each poke/peek flavor? |
| ||
The objective is to have clear examples. Most of the time unique is better but sometimes multiple flavors in a single example can clarify concepts. |
| ||
This is a very nice community project and I'd like to contribute. Since this just started, may I suggest to setup a small and easy wiki to collect all entries? Using a forum topic will end in a mess. It will become a pain to check what's already covered, what have changed, bugfixed etc... Are there any free hosted Wikis around we could use? Like free forums...no complicated setup, just register and go. |
| ||
Not all bank thingies, but at least most of 'em. |
| ||
Great idea, guys! I'm all in favor of the "Related Commands: blah blah blah" (with hyperlinks to those related commands) approach as well, as alphabetical order is not always the best way to organize commands, even within a certain BMax documentation category. Or, alternatively or in addition to that, if slightly more complete examples are given with not-yet-learned commands included, the actual commands in the example could be hyperlinks. For example, in CS_TBL's CreateBank() code above, BankSize() and PeekByte() could both be hyperlinked to those command definitions. The other commands, such as Local, For and Print would not need to be, as they are more general and not really closely connected to CreateBank(). Russell |
| ||
The real handy part of a manual is what I've done in the lowest 3 examples. Instead of: <command> -> <explanation> one learns more from: <code problem> -> <solution1>, <solution2>, <solution3> etc. |
| ||
Ok, not really a command reference, but nonetheless handy to include for beginners. |
| ||
@CS_TBL: You forgot For...until. Always useful when iterating through arrays. "For idx%=0 until foo.length" |
| ||
Right, will add. Tho I've actually never used it.. :P |
| ||
By the way, did I made the suggestion already to use a Wiki for this task? ;) |
| ||
Jake L: There's been at least two attempts to do this with a Wiki. For this attempt I'd like to stick to this method. CS_TBL, North: I've included your contributions to the compiled help. Download the latest version, click on the search tab and search for your name to see the examples you have contributed. Thanks We are now at 41% complete from 30% before w contributions from CS_TBL, North & yours truly. I'm targetting 90% by year end :) Keep them coming... As a reminder, checkout http://www.2dgamecreators.com/files/examples.htm for a list of functions without examples before contributing. |
| ||
In what kind of setting/enviroment are you going to place those Howtos? Appendixes? |
| ||
Someone ought to write appendixes about typical design patterns, and their applications. |
| ||
I was not planning for how-tos and appendices. ATM I'm sticking them in as extra link to the function example. My main objective is to have 90% of the bmx functions to have examples |
| ||
How do you plan to handle examples that covers more than one function? For example, CanvasGraphics() is covered in the CreateCanvas()-example quite well. |
| ||
I simply copy them across. So they will have the same example. In the stats they count as 2 examples which is OK as they represent examples for 2 functions. |
| ||
This has a lot of Pixmap Functions. (Please optimize it if you can.) |
| ||
hm.. isn't that a bit much for examples which are to explain one single thing? |
| ||
CASO, thanks for your contributions. I broke your example down into smaller slices on a per function basis. Do a search on CASO to check them out. We have now reached an important milestone, 45% functions with examples, which is halfway towards my stated target of 90% done by year end :) Check out the download page in the top post. |
| ||
Can we keep the (forum-)jokes? :P |
| ||
Here are some more. |
| ||
More than 50% of functions now have at least one example. The latest version can be downloaded from http://www.2dgamecreators.com/files/ Next milestone is to surpass BRL no of examples, this effort has contributed examples to 164 functions cf BRL's 190. Don't forget to check the list at http://www.2dgamecreators.com/files/examples.htm before contributing. |
| ||
Here are a few more. |
| ||
caso: I highly doubt your examples are 100% perfect for a manual tho. Not superstrict compliant, and uhm.. "EventSourceHandle" ?? :P |
| ||
The use of Superstrict might not be mandatory, but I actually think it's best to teach things the right way. Esp. for beginners, Superstrict helps finding bugs. (also for the medium/advanced :P) some alternatives: |
| ||
New milestone reached. User examples has surpassed BRL examples. I have now added methods to the list instead of just functions so there's more to do but we are still above 50% The latest version can be downloaded from www.2dgamecreators.com/files/ |
| ||
Thanks Assari! Jason |
| ||
Another milestone reached, 60% of functions/methods now with examples. I will plod through and add more examples but will not be bumping this thread until the next milestone of 70% which could take the next 4-5 weeks. As I add stuff, I will upload to the website so that downloads will be up to date eventhough there's no news here. If you wish to contribute, don't forget to check http://www.2dgamecreators.com/files/examples.htm to see which functions/methods are still without examples. |