covering all the BASICs...
Issue 20 ~ January 07, 2007
In This Issue:
E.K.Virtanen, MystikShadows, Hartnell, Richard D.Clark, Chris Warren-Smith
From The Editors
Lot's of code has been written since last issue.
First off, we want to apologize for the delay is releasing issue 20 to our readers. Since issue 10 came out, alot has happened that contributed to the delay of this issue 20. One of the editor's PC crashed for one thing. ASCII-WORLD got a new and improved complete overhaul. And PCOPY! has one less editor than the original founding treesome. PC is fixed now, and since ASCII-World is redesigned, we can get back on track with producing PCOPY! on a more regular basis.
What has happened between these two issues? Well, lot's of things.
mennonite, who had big influence for founding this magazine has now moved away of this magazine. For a while, everything was messed, totally messed and to be honest, future of PCopy was more than unsecured. But here it is now, not the best magazine ever, but it is here and we are in our way of learning how to do better and better all the time.
First issue did receive heck of a lot feedback. One thing that was easy to see while reading them was that either peoples did love it or hate it. Our style did wake peoples attention. Specially at FreeBASIC forums, speed and language of feedbacks were something i havent seen ever. But after reading and even arguin of feedbacks and this bit longer break we can say first issue was pretty good job as an first magazine we did build.PCopy continues in a road we started with first issue, changes are done by the feedback, but naturally messages like "LOL that does suck you motherf***ing jerk retarted a**hole" are considered only as peoples way to express theyr bad and nasty feelings.
But anyway, here it is. PCopy #20, like it or not but considering how quickly and with how small number of contributors it's done, i can say it is something we can be proud of.
- The Editors of PCOPY!
Letter from Pete
Back when you first announced PCopy! about a month ago, I had two immediate reactions: 1.) "Awesome! I can't wait to read it!" and 2.) "Oh dear, does MystikShadows have any idea what he's getting himself into?" Launching a new magazine is TOUGH, because you have to start with nothing -- no contributors, no content, no template or style, not even a title....you start from scratch with nothing but a vision and a commitment to putting in the hours upon hours it takes to get the darn thing released. But, what can I say? You guys pulled it off with flying colors! PCopy! Issue 10 was a GREAT first issue (even if it is labeled #10).
You also did a wonderful job covering all the other BASICs besides QB and FB -- which really sets your mag apart from QB Express. I was skeptical that you'd find enough news to cover for the other BASICs out there, but it looks like there's a lot more going on than I thought! You surprised me with all the news on GW-Basic, BlitzBasic, JustBasic, Dark Basic, etc. I'm sure a lot of other readers from the QB/FB community probably were surprised too...we're just too focused on our own little section of the Internet that we forget that there are other communities out there too. I think PCopy! could really help bring us all together. Bridge the BASIC gap, so to speak. Might I suggest an article for your next issue? An overview of all the different dialects of BASIC currently being used, as well as a look at the other (active) BASIC communities out there would be a really interesting read. I don't know *anything* about BlitzBasic or JustBasic, for example, so a little introductory primer would be very helpful.
So anyway, great job on the news briefs. You actually kept them *brief*, which is something that I've struggled with in QB Express...the briefs are like mini articles sometimes. The only thing I'd recommend is putting in a few screenshots, because people like seeing pretty pictures.
The formatting of the magazine is good for the most part, and really fits the BASIC / old-school DOS look you're going for. However, I think the text is a little bit hard to read. The black background is a bit too dark, and the text should be a little bit bolder... you could jack up the font size a bit, switch colors or switch fonts to make it stick out a bit more. The problem with monospaced fonts is just don't have a lot of thickness in their lines, so they're a little bit tough to read. Don't ditch the font, since it's essential to the style of the magazine, but try to make it stick out a little more. Also, I think the mag is a little bit too wide horizontally... it takes up almost the entire window for me. People like to read narrow columns of text (ie: newspapers), because you don't need to move your eyes as much and you're less likely to lose your place when you read from one line to the next. I think it might be a good idea to set a horizontal limit to your paragraphs. (In QB Express, I tried to keep it to 75% of the screen's width or less.) Anyway, not really major problems. Overall, I really liked the design!
Good mix of articles in this issue! I'm glad to see that your tailoring to gaming (your review of Lynn's Legacy was excellent, and I liked the two previews E.K.Virtanen wrote.), as well as the more technical aspects of programming. Your Windows A.P.I. tutorial was VERY interesting to me... I never really knew how exactly Windows handled its GUI functions, so this was very informative. Aroticoz's intro to 3D series could develop into something great, once he actually gets to the coding part, heheh. We've all read these "what is 3D?" intros many times before, but he did a good job explaining things, and I like his writing style. I'm looking forward to the next installment!
As for mennonite's Intro to QB series, I don't think it's necessary. The same exact tutorial has already been written about 100 times before (http://petesqbsite.com/sections/tutorials/beginners.shtml2), and frankly, there are hardly any people that would find this tutorial useful. He's far better off spending his time writing about just about anything else... the number of complete newbies looking to learn QBasic is small as it is, and chances are they'll consult one of the hundreds of other excellent tutorials that already exist before they'd read mennonite's.
On the other hand, mennonite's "FBWin Console Apps In ReactOS" was very interesting. I wasn't really familiar with ReactOS until this article encouraged me to check it out, and it's a very cool project. It's nice to see that FreeBasic has some compatibility with it, even if it's fairly limited. Thanks, mennonite, for doing all of that field testing for us!
Chandler's article caused a lot of controversy when you released this issue, and I think enough has been said about it. I agree that it was rather misinformed and close-minded, but unlike a lot of people, I'm glad you published it. It's important to share and discuss everyone's opinions, and that article certainly did elicit some lively debates. :) I'm surprised Kristopher Windsor's anti-Windows Vista article didn't get some kind of response. (I myself am a huge fan of Windows XP and can't wait for Vista. But it's always fun to read an editorial by someone who you don't agree with, heheh.)
And now, some responses to your Developer's Desktop Professional project, since you asked.
First off, this sounds very useful! Looking around my computer desk, I've got about a half dozen post-it note "To Do" lists for various areas of my life (and I'm way behind on most of them, heheh). The desktop of my computer is cluttered with little clusters of icons for different projects I'm working on / websites I'm developing. I've got a taskbar full of programs running at once, and I'm working on different projects in all of them -- animating a cartoon in one window, compiling the next issue of QB Express in Notepad, designing some graphics for my TV show in Photoshop, posting news on one of my websites, writing a script in Final Draft, organizing my music library in iTunes, writing an email in another window, and I've got 15 tabs open in FireFox. So something like this to keep me organized could be very helpful!
I like how you identified several different working styles, since not everyone approaches tasks in the same way. I know with Gmail (the best email client ever created, hands down), Google discovered that there are six main styles that people use their email, and they designed the client to work for those six types of people. They ended up creating an email client that's perfect for just about everybody! So very wise software development on your part. :)
Anyway, you asked for features that would be helpful. I'd say: multiple To Do lists, an alarm clock / scheduling system would be helpful. How about a little timer where you can set how long you want to spend on a particular project, and you can see it counting down as you work? One of my biggest problems is I end up taking far more time working on something than I intend to, and then get behind (or never get to) other projects I've got on the docket. If there's a time limit that I can see ticking down, it might encourage me to work faster and stay more focused. I'm someone who works well under pressure, heheh. Also, it would be cool if you could make multiple "Profiles" -- kind of like multiple user accounts -- where you can load up a completely different screen of projects at the touch of a button. I know I would create two separate profiles for different aspects of my life -- school work profile, and then my websites would be another profile, and then another profile for my animations and video projects I work on. Another cool feature would be something where you could merge all three "profiles" and see all of your projects together on one screen, but then you can separate them as well. Catch my drift?
Okay, that's all I've got for now. Besides, I should probably get back to work... Once again, great first issue. I can't wait for issue 20! And hopefully I'll find the time to contribute an article or two.
Keep up the great work,
- From The Editors
"Back when you first announced PCopy! about a month ago, I had two immediate reactions: 1.) 'Awesome! I can't wait to read it!"' and 2.) 'Oh dear, does MystikShadows have any idea what he's getting himself into?'; Launching a new magazine is TOUGH" - Pete's letter 2 us
First of all, let us say "Thank You!" too everyone that contributed to or read any enjoyed our first issue of PCOPY!, because we can't thank you enough- you made our efforts worthwhile.
Secondly, let U.S. remind everyone that PCOPY! has a policy regarding personal attacks on our authors or other members of the Qmunity- that's simply not what PCOPY! is for, and our hands are tied regarding any such articles or letters, you can always edit and resubmit them, and we thank you for understanding.
With that said, we are knot very sensitive about PCOPY! itself, and we are listening (after a fashion) to any critiques made including those sent to us about the magazine. We appreciate your ideas, even though we are pretty happy with the plans we have in mind already. One thing we wanted to do was create a truly "retro" style design, and some love it and some hate it... we sort of figured that some would love it, and we wanted to make something with that feel, too- also, we figure that if you want a crisp, modern-style magazine to send an article to, QBE is perfect for that. It's a nice look too; we just wanted to do something different.
Hear at PCOPY! we don't agree on everything :) that is to say we have at least three really great people bringing you PCOPY! the way you see it now, and sometimes an idea will "tip the scales" a bit. Thanks to Pete's constructive suggestions (don't blame him for what we did, we may have misinterpreted them...) we have decided to narrow our magazine slightly and bring the font up slightly, and we hope this will help everyone read it. Prior to publishing our first issue, the design was based on a 20-point font, but we were sure that was much too large for most readers to appreciate :) Nonetheless, we've taken it up closer to that point, and it's bold now.
Mostly, we doo PCOPY! because we enjoy doing it and want a magazine that offers a few special things, and our layout is one of them. It was created to work with Firefox (in Linux and in Windows, although the Gecko rendering engine is probably the same or virtually the same) and Opera and even Internet Explorer, and we have enough reports that it does work in all three, as well as older browsers. We got one report of "grey boxes" in Firefox being back, despite the fact that each stage of PCOPY!'s creation was tested in Firefox without a problem, both in Windows and in Linux before we went online.
With regards to criticism, we welcome any polite and constructive criticism from our readers, and we are pleased to offer Pete's letter as the perfect example of the sort of letter we are happy to receive and publish. in fact, we are happy to receive pretty much any letter, but some fall within our policy and some do not. Please do not take it personally if we find your submission does not fit our policy, it is very unlikely that it wont, but regardless we will not reject anything based on personal grudges or politics- we welcome *anyone* to write and send in letters and articles (and we believe that is something QBE has in common with us also.) It is our continuning aim to have our professionalism at PCOPY! outweigh everything else.
We wood also like to address some concerns regarding accuracy of statements in our magazine. We are equally interested in the ideas of the experienced and the thoughts of those just learning, at any age. We are far from being a magazine dedicated solely to programmers under the age of 14, but some of us were coding in BASIC at earlier ages from this, and it would have been nice if we'd had some place where we could be recognized equally as humans, if not as experts. To that effort, we offer PCOPY! as a place for younger programmers to show us their best work and to have that work admired by those of us that do not feel far above what we were once learning. It is our hope that BASIC is never taken a weigh from young coders that want do something cool, to be used only by those that will fall in line with some kind of formal BASIC "education."
Because of this, eh factual error may even creep in. We do not consider that a significant problem, we consider it a nominal caveat of community-based publication. The fact is, even the Encyclopedia Britannica contains factual errors, and no one tears it down for that. In fact, If you want to harrass authors of factual errors in a community-based effort, we recommend joining Wikipedia. Not long ago, a USA Today editor blasted Wikipedia for publishing horrible lyes (vs. mere hiccups) about him. Rather than blast Wikipedia for being as open as it is, he could have clicked "Edit" and put his bio in. Even better, he might have even included parts of the libelous attack on him and commented. Either or both would have been a wiser response, and more useful to himself and everyone involved with the project.
Like Wikipedia, PCOPY! is a community-based F. fort, and like Britannica, it may contain a nominal amount of factual errors. We think we've presented you with something of pretty decent quality- we think that with reason being part of judgement, an hiccup does not hurt the quality of our effort.
Of all the criticism oui got, it's most interesting to see the criticism on freebasic.net, where it is the most harsh. Someone hates our layout, or someone strongly disapproves of our authors, the person credited with giving us the most "hardline" critique said he didn't find one single part of our magazine useful.
It's hard to understand what we're supposed to do with a critic that says hour project has no worth at all, but weighed against the praise we got, it doesn't put things in much perspective.
Of course, as we said, Pete's letter is a fine example of use full critique, and we didn't try to take some of his advice because it was polite, we tried to take some of his advice because he had good ideas. Whether he ends up approving of our use of his advice, it's hard to say- but once again, we tried. We considered his critique and agreed that we should try again; something we probably won't bother with very often. Why? Because we're already pretty happy with it. We look at PCOPY! and we think "Hay, nice job guys." and some of you tell us you're happy as well. That's why we do it.
But it's ardor to bother with "help" that basically suggest the whole thing sucks. It's just impossible to please everybody. For instance, some of you have decent parents, and some of you might have abusive parents- or abusive spouses, or abusive lovers- but essentially, if you hear a lot of "You're fat, you're ugly, nothing you do is of any worth, and you're going to be a loser for the rest of your life..." this isn't the kind of criticism that can be worked with. It's also usually follwed with something like "And I'm only telling you for your own good." Well, no, people don't tell you you're worthless because they want to help you, they tell you you're worthless because they will never accept you for who you are NO MATTER WHAT you do. You have to give up on "help" like that, or you'll waste your life trying.
An example of a friend helping would bee more along the lines of "Hey, listen, you could change this and this, it would be better- but I like it." And sometimes, friends aren't even that gentle. Friends are clumsy and human and screw up, so it might come out wrong, but it's pretty easy to tell a friend from someone that's just trying to make you feel bad to push you into doing something his way. Hopefully. A smaller exam pull might be if you have some food on your lip or something on your teeth. A friend might say "Hey, man- you've got a thing- right here." If he's trying to help, he probably wouldn't say "Hey everybody! Look at this stupid jerk that has something in his teeth! HAHAHAHA!"
It's that sort of thing. Sew we appreciate those, like Pete, who gave feedback like a true friend, and set the best example for everybody. Thanks guys. And to others, who don't call themselves friends necessarily, but at least said something nice? Thanks- and thanks again to everyone that was even polite and helpful... but to those who basically can't ever be happy and just wanted to make us feel bad? There's absolutely nothing we can do for you. It's not possible- but we really did try.
So here's an other is shoe of PCOPY! Yes, the amazing incredible and still chugging along, PCOPY! Issue 20. We hope you enjoy it- that's why we're here.
Letter from ASCII-World
We have heard and readed in past times lot's of rumors and assumptions about our website, ASCII-World.com We just wana clear these things here shortly, since what we have heard are came thru irc, IM, email and forums. Mostly these things are pure misundestandings. But since we dont wana make this too long, we just quickly answer for some things there is on air about our site.
- 1. ASCII-World is QBASIC/GwBASIC/DOS website.
No, we are not. We are site dedicated to the art of text and ASCII programming. Programming language or platform is not an issue.
- 2. ASCII-World is antiFreeBASIC website.
Certainly not. Half of all codes posted on forum are made for FB. Most of articles and tutorials are made for FB.
- 3. ASCII-World is FreeBASIC website.
No, we are not. Most of our codes and articles handles FB, but thats because contributors and members are mostly FB users at this point.
- 4. ASCII-World created to keep QB and DOS alive.
Yes and no. QB and DOS act's big part on life of ASCII programs so you can say one of our "missions" is to play with DOS. Alltho, we like to do it, so hard to say it's our mission. It's more like an interest and hobby or even love. Name it as you want.
- 5. ASCII-World is safesite for those who plays with ASCII since they dont have skills to do 3D.
No. We are not retarted, pervers or lame because we like to do ASCII/text programs. We just dont see anything interesting to program 3D scenerys or games. Consider man, who spents he's time and efforts to old Buick, back at 50's. Is he retarted? Naturally, new cars gives way better drive, but feeling ain't same. All cant see or feel it, but someones do. So dont judge us, or then you have to judge every one who likes for something "old".
- 6. ASCII-World is for those who hates latest 3D OS's and hopes return of days of MS-DOS.
No, no and no. Advance is for good. After all, with out it, we would not have internet and all these other great things we do have these days. But we just dont feel the need to have latest 3D desktop's or graphic drivers. We can use older ones and we do actually like to use keyboard.
- 7. ASCII-World is anti-M$ site.
No, no and no. Personally, E.K.Virtanen think M$ sucks, but it's not ASCII-World website's purpose. If you disagree about M$ with E.K.Virtanen, then hop on our forums and say it.
ASCII-World is created and owned by Stephane Richards and Kristian Virtanen. Two man, who just loved ASCII games, tools and applications, by coincidence happened to meet on internet and after a while of conversating, decided to create an website that would present something they both missed on internet.
For now, website is hosted by Stephane Richards. New website is created by E.K.Virtanen who also owns the domain. But as long as these two names are behind ASCII-World.com, guidelines of this website will remain, no matter wich one owns, hosts or codes something new.ASCII-World F.A.Q and Staff and Contact Info
Sincerly, Stephane Richards and Kristian Virtanen
aka, MystikShadows and E.K.Virtanen
Neat BASIC Projects and News
Members of Programmer's Haven had a sad moment when Roy Scott posted an announce about hes plans to close the forum. Something that was been there like years now suffered about spam and Roy Scott because of hes health issues were not anymore capable to maintain it. Gladly it took like minutes before members were activated and now, new home for Programmer's Haven Forum does exist again.
BASIC4Linux website was one nice thing to find while writing our first issue. Sadly, Garret did bury this project. We hope to see something similar started by someone by sometime.
Dig your floppies is an sentence E.K.Virtanen has spreaded everywhere. Here is quoted post by him.
If you have some sort of ASCII/text/console applications/games/tutorials/articles etc. let me know. Programming language or platform is totally free for us. Even though they might feel even silly or just not worth of mentioning, they might be a real treasures for us. Your simple dice game, hangman, document creator, html file checker can be something someone has looked for he's DOS computer. Dont let those possible treasures got lost. :)
Idea is simple. ASCII and text games and other software you might have forgotten totally, but still does exist in your floppies are those treasures ASCII-World is looking for. New software is also welcomed. You can contact to MystikShadows or E.K.Virtanen about this issue or visit in ASCII-World Bulletin Board.
Game Design Principles and Mechanics is an book Richard D. Clark is working with. One link to see whats hes working with is this. As known fact by rdc, text is nice and easy to read. Definately something to follow.
REALbasic 2007 Supports Windows Vista and Office 2007 did read on REAL Software, Inc. - Press Release
FBSL 184.108.40.206 is out! is the topic in post, wich you can find from Freestyle Basic Script Language (FBSL) forums at end of this thread. If youre interested about this BASIC dialect, see more from this article, contributed by Richard D. Clark.
A Beginner's Guide to FreeBASIC Online tells "The goal of this project is to create a Comprehensive beginner's guide to FreeBASIC and publish it so that it may be purchased for under $20 USD. At this moment, I believe the project to be 75% complete"
BCX DevSuite Pro Version 1.28 was released on December 29th. For those of you that don't know what DevSuite Pro is, it is a complete development system built around the BCX BASIC to C translator. This version features an updated BCX Compiler (Version 5.11a) and it's corresponding Help File with the same version number. If you like BCX, you'll love DevSuite Pro. Have a look here for details.
Janet's Samplings of BASIC Programs is located at http://www.janet.jbusers.com/
Apollo Lander is game written by Cortez with DarkBASIC. It took nearly two years to finish but it does for sure look good. If you got interest, see more in here
XBLite Version 2.20 released. at 2006.09.15.
JACAL - A RPN calculator written in JustBASIC is cool application for users who knows German language. More at http://www.freenet-homepage.de/bschaefer
YABasic has released Version 2.763 on September 12th 2006. YABasic is a great down to earth BASIC flavor. It's syntax is quite similar to QBasic though they don't boast this feature. There are some differences. But all in all YABasic is a BASIC flavor worth taking a look at. Have a look here http://www.yabasic.de/ to learn more about YABasic.
The QBasic Nerd Music Video did pop-out few months ago. Go, hear and see. Now we wait to see who is goin to make full evening movie about QB.
Game Design HQ is now Game Design Novice Front page of "GDN Wiki" tell's this "Welcome to Game Design Novice, the free community where you can learn to make video games." Even though this site, maintained by Hartnell is pretty new, it has nice and friendly surroundings for new and experienced game programmers.
Eternal Journey is an huge FreeBASIC project. "Eternal Journey is a huge project, and a lot of work is going into what I hope will be the best game of its kind ever made in BASIC (I hope it will be able to rank among the best 2D RPGs ever made for any platform)." You can read and see more at http://www.smithcosoft.com/ejpage.html.
This GW-BASIC forum had news post by forum admin. " Animal Vegetable Mineral is the old 20 questions game, but it remembers what was played and uses the memories to guess the object. It's short and easy to follow. The only thing that I'm not crazy about is that it forgets everything when you stop playing and you have to start building memories the next time you play.". See the rest from here
ASCII-World has been remade. Old and also original website did serve well but it was time to move on. Frames and fact that old site was hard to update were reasons why E.K.Virtanen did remade whole site with using TikiWiki Wiki/CMS/Groupware. New site has considered generally as good step to forward except by few rare ones who thinks nothing should change ever. To see new site of ASCII-World.com, click here. Old website is still here to see but naturally, it's not updated anymore.
QBE, dead or just sleeping is the question at Pete's forum. When im writing this post, it has gone 174 days since last issue. This period of between first and issue #20 of PCopy took 154 days. It is way too long, hopefully we see QBE #22 soon. Members of Pete's website are worried about situation of QBE.
Brutus2D 1.6 : Innovation
One of the exciting things about working with Brutus2D is that you get the feel that something NEW is happening. The primary reason for this is that Guilect, the developer of B2D has a keen eye for useful innovation, a knack for listening to his userbase, and an unprecedented speed for releasing new features.
A few days ago, Brutus2D 1.6 was released and it shines again with new features it needed and innovations shunned by other game programming language developers. I've played with B2D 1.6 and I can honestly say Guilect deserves a solid slap on the back.
The first, and oddest, new feature of 1.6 is the console mode. That's right, you can now write old style text games in an old style console with OO BASIC. I would have preferred that the console mode have been represented in a more modern text window, but hey, you can't win them all. It will be useful for writing ground-level tutorials for people new to programming. Unfortunately, they do not follow the conventions you'd expect from console functions. No instantly recognizable PRINT or INPUT, but methods that perform these functions are included.
The second innovation was included in the last version, but only perfected in this one. The SFX object allows you to use MIDI tones for sound effects. This isn't a very good way to generate sound effects. The beauty of it is how much time it saves a B2D programmer. No longer do you have to sift thorough freeware sounds, edit them, try them out, re-edit them, try them out, and on and on just to hear a smack where you expect one. Using the SFX object you have an entire range of "placeholder sounds" built right into B2D. As a consequence, if it is properly used, it could result in a few rhythm action games.
The third important innovate comes in the form of a math object. No longer do you need to know the complexities of Pythagoras. Brutus2D already knows him well and can perform his tricks for you. The new methods included wth the math object should help speed up development.
Most of the rest of the updates enhance or improve the IDE, or add features that Brutus2D should have already have had.
Interview with Jukka Lavonen
As an quickly preview about CoolBASIC ill tell it's game programming BASIC evinroment for Windows platforms, mostly documented in Finnish but community members are working on with translations, in here. Jukka Lavonen is main (and the only) programmer of CoolBASIC.
- E.K.V Who is the main programmer of CoolBASIC?
J.L "Me, Jukka Lavonen. This far I have been the only programmer on this project. On our online discussion forums, im known as Zero or Zerppa"
- E.K.V When was the first version of CoolBASIC released?
J.L "I dont think I can recall the exact date of it but I do have some files created back in year 2003 on my hard disk."
- E.K.V Latest version of CoolBASIC?
J.L "Latest official version of CoolBASIC is 10.43. This version is badly out-dated since I have taken some vacation of developing it. People call it summer holiday :) There is, however, newer and more functional code editor and game engine under developement."
- E.K.V What programming languages CoolBASIC is developed with?
J.L "Current CoolBASIC has been written in BlitzBasic, but this project reached it's limits pretty fast due to Blitz's not so expandable programming base. There is new engine under developement, it's written, one to mention, with C++ language with some ASM for parts that need speed optimization."
- E.K.V Nearly everyone who programs, for hobby or for money,
dreams about making own programming language. Was original idea to do so
finished package as CoolBASIC is or to do some improvements on other,
already known language by adding new librarys or functions to it?
J.L "This is a bit different story. The Original idea was to make a game, where purpose was to create an AI for robots. These robots then fight against each other in different arenas, and with different weapons. The player can't influence the battle in any way, and robots are totally relianced from the scripts the player has coded for them."
"I started the game project from a clean desk, and i did all research work for this by myself. While my experience got better, i had an thought that i could use base of my code to create an new programming language."
"After since, CoolBASIC has been written over again for a few times, and every time result has been better, faster and workable CoolBASIC. The latest version of CoolBASIC presents third generation, but fourth is already in the making. This way, CoolBASIC has become better and better in time and i can say that latest package includes manual such a high quality and good quantity of functions, to make a games."
"I have always liked to make games. I want to offer people chance to do so for free and as easily as possible. With many other languages, it is more difficult."
- E.K.V What pops on eyes for first on your website, is
sentence "CoolBASIC is a game programming language". So was the idea to
create a language for pure game programming purposes or did CoolBASIC
evolve into it under its developement?
J.L "Game programming was the purpose since beginning. Everybody wants to make games. CoolBASIC is designed so that it's suitable for beginners. Programming is more rewarding when you can get something concretely on screen as easy as possible, and that way, it's easier to get to know the world of programming."
"Programming can be real challenging time to time, and every one burns their nerves now and then. But when difficult problem gets solved, it's rewarding experience. And that's the reason why we keep on programming."
- E.K.V Often languages that have been designed for pure game
programming, have got a reputation of "not a real programming language"
Since CoolBASIC is purely made for game programming, this kind of
reputation must be familiar to you, too?
J.L "All feed-back I have received has been positive. People simply like this concept. Positive feed-back encourages me to keep on going with CoolBASIC." "And naturally, CoolBASIC developes all the time, by suggestions of its users. There is hundreds of messages on the forums that include wishes of new functions and how to improve CoolBASIC in general. New functions have been added in every version of CoolBASIC."
- E.K.V To quote your site, once again "CoolBASIC's programming
language is probably the easiest one, the type of BASIC." That is a big
promise, if we consider there are several languages for several
purposes. Including game programming languages?
J.L "With that sentence, im pointing to BASIC syntax. With my own experiences, I can say syntax of BASIC is the easiest one if we think with what language you should start programming."
"For easy game programming, BASIC fits perfectly since its easier to learn and you can move on planning game faster instead of wondering detailed architecture of language."
- E.K.V When reading Features List and while writing some code
with CoolBASIC, it's just have to admit that language itself, including
graphics- and sound functions are easy to adopt, even if you're new to
programming. Tools and manual of CoolBASIC are very well made, even if
we compare them to competitors what are been under developement for
longer. Often, language is written first, and then, developement team
starts to document it. In CoolBASIC case it looks like things are done
J.L "It might be hard to believe, but half of whole project time went with documenting. I wrote it totally by myself, and quality of it was on my mind all the time. I think manual of CoolBASIC is way ahead of its competitors, where usually are expected that user knows at least something of programming."
"CoolBASIC was almost totally completed in terms of programming job before I started to work on the manual. This way I was able to give as detailed and coverable package as possible. CoolBASIC wasn't published before the manual was completed. I wanted to offer an finished package right away."
- E.K.V One we could immediately see that CoolBASIC is for
Windows evinroment only. Have you got any plans for Linux and other
J.L "Platform indepency has been my vision for some time, but for now, I dont have any detailed plans on going there with CoolBASIC."
- E.K.V I would ask you to mention one program, programmed with CoolBASIC that I should check?
J.L "This is a hard one. I haven't followed latest announced programs on the forums so precisely. But it's not difficult to spot some great programs from the threads. CoolBASIC users have often arranged small programming competitions, and usually winners have been very high-class."
- E.K.V Whats the next big thing with CoolBASIC, and when we can expect it to happen?
J.L "4'th generation CoolBASIC. What comes for timetable, I prefer not to give any promises. Total reforming of language and new advanced features are something worth of waiting for. Sights of future are very positive ones and there is 3D-engine on that sight too."
- E.K.V Time to time, especially in bigger projects, comes
moments when you just get enough. You feel a need to smash your keyboard
and press (DELETE) on top of source file. How often have You got these
J.L "Well, that kind of situation I havent confronted this far. Programming is challengin and creative to do. Solving hard problems is rewarding and maybe because of that it's possible to write thousands lines of code."
"Naturally, there are moments when I use computer for something totally different than coding CoolBASIC. Sometimes a small brake from coding does wonderful things :) Answer for a problem might come to mind easier if you don't think of it for a while. I don't take CoolBASIC from any compulsory aspect, so that I must develope it all the time. I'll work with it when I have time and motivation. But now, after CoolBASIC has got some publicity, there has been some expectations for me."
- E.K.V Time to time, programmers avoid showing their code
while asking some programming help. Naturally, own source is the one
that looks most worse. Could you now give courage for those ones?
J.L "Well, it's hard to help if you can't see or test the code. If possible, code is good to attach and also mention what possible 3'rd party libraries or medias it uses. This way, more experienced ones can check where the problem is. If code includes secrets, then some password protected package might be a good idea."
"Naturally, it's everyone's own business if they want to show their code. But then it might be a good idea to think how hard it would be to help without seeing it. The fact is, no one gets personalized by their codes. Everyone get more experienced while they program; Experience is the only way of developing your skills."
- E.K.V What makes CoolBASIC so cool?
J.L "It's made for game programming, it's free and user friendly."
The Evolution of Your Userbase
Stick with me here. I'm going to show you a magic trick. I'm going to turn a monkey into a man. No tricks up my sleeve, nothing behind my back, I simply wave my magic wand and... the monkey stays a monkey.
You can't turn a monkey into a man overnight no more than a userbase can be created overnight. Hoping that one will just pop into existence is like waving a magic wand over a monkey. Funny, but hopeless. Realistically, userbases have to go through the proper stages of evolution before they can stand upright and stand proud.
Like the many species of nature, userbases --- and thus programming languages, go extinct or never get off to a good start. This article is to show you the evolution of a userbase and give you a good idea what the stages are and how to identify where your userbase is and where to go from there.Stage 1 : The Cavemen
I'm going to start our story with some cavemen in days of yore, sitting around a fire, scratching symbols into the dirt floor and communicating in grunts.
Imagine. Little Johnny is born into the caveman tribe. He learns everything he needs to know about how to hunt from the older people around him. He grunts questions at them. They grunt answers back. Through a whole lot of grunting, pointing, and drawing symbols in the dirt, Little Johnny caveman learns to hunt well.
Then, GASP! Tragedy strikes. Johnny's father and several other elders get trampled by a rabid woolly mammoth. The event leaves a power vacuum in the tribe and a struggle for power ensues. Eventually, by throwing fire, stones, more grunting, and drawing in the sand, it is decided that the tribe will separate. The tribe's more older and wiser members split off to seek their fortunes elsewhere.
This leaves Johnny alone to rule the tribe. But no worries, he's learned his lessons about hunting well and can pass them on to the next generation, which arrives in just two months.
Then, five years later, GASP! Tragedy strikes. Johnny is killed by the very same rabid wooly mammoth that killed his father. Unfortunately, this leaves his wife and his two children to fend for themselves. They starve to death during the next winter.
Horrible story isn't it? Death, tragedy, starvation. Rabid woolly mammoths. But it happens all to often to programming languages right here on the web. And it happens every day.
This stage is when there is no proper documentation and the few members are using a forum for the main method for exchange of knowledge about your programming language. 
During this evolutionary stage, you will always be losing experienced members of your userbase. Sad as it is, they leave for a number of reasons. They die, they are driven off by flame wars, or they lose interest. It doesn't matter how you lose them, the most important thing to know is that you WILL lose them over time. There's nothing you can do about it.
It also happens that if enough of them leave at the right time, there will be a knowledge vacuum in your userbase, leaving noobs to fend for themselves. Sitting around a fire, grunting, and drawing symbols in the dirt floor (or using a forum) isn't enough to prevent this knowledge vacuum. Someone has to be there to grunt answers back and point at the complicated symbols and reveal their meanings.
To safeguard your userbase, you need to take the next evolutionary step.Stage 2 : The Scholarly Elite
Let's fast forward a bit. Humanity has invented a proper system of marking on paper called writing. They have learned that they can put together many such pieces of paper in a wondrous invention called a "book". Inspired, a few highly intelligent people preserve all their knowledge in these "books".
Unfortunately, learning complicated subjects from books alone rarely works. Only a few scholarly elite are able to come to understand the whole subject. These elite then form into elite groups and shun non-elite outsiders. They write arcane, complex papers and pass them to each other. They read them and nod their heads and smile, knowing they are elite and look down at the unwashed masses.
Those who are not elite are left ignorant (and possibly unwashed). Therefore two classes of people emerge. The elite and the complete noob. The gulf between them becomes as wide as the grand canyon.
At this stage, only a small elite userbase will be able to study at the libraries ( read the documentation ) and learn from it. If all of the elite userbase leaves at the same time, the knowledgebase will be preserved and a small elite user base will be able to rise again. 
Those who became the new elite will have to have learned to program somewhere else that was more noob friendly. A programming language at this stage will never attract a large userbase because they cannot attract people who cannot already program.
This is better than the previous system, but it limits the userbase to a small number of very self-important people. Stage 3 : The Public School
Let's skip ahead a bit. At some point one of the elite turns into a Prometheus  and realizes that more advancement can be made if the ignorant masses were educated too. This elite member recruits a few other elite from the scholarly elite and form the first public school.
For the first time, noone has to blindly search through arcane books for knowledge. It is taught to them, it is demonstrated for them, it is accessible to everyone. There's no need to remain ignorant, you can go to school, become elite, and eventually have enough knowledge in your head that the arcane books don't seem so arcane anymore.
Since more people are working on developing more knowledge, more knowledge becomes available. Soon people everywhere start experimenting and invent and discover all kinds of unexpected things. Someone discovers electricity. Someone invents the lightbulb. They catch on. People are amazed by decide going to public school is worth the trouble. The foundations of modern society are properly laid.
This is stage in the evolution of the userbase where tutorial writing to get complete noobs up to speed is taken seriously. Once this groundwork is laid, intermediate tutorials naturally follow and soon there is an unbroken path from complete noob to elite pro. Also during this stage, projects are completed on all levels, so that everyone has something they look at and say "I can do that."  Stage 4 : The Couch Scholar
Let's skip ahead again. Society has evolved to the point that everyone can afford a car or has access public transportation. They are no longer starving for food or knowledge. Processed cheese becomes popular. So do the Power Rangers.
So what do people in this age do? The intelligent ones who didn't apply themselves in school sit in front of the television. They play video games. They make incredible, yet incomplete leaps of intuition and logic while snacking on toast. They annoy their friends with these leaps. Constantly.
These are the true mavericks of society who are capable of great contributions because of their novel outlook on life. Their thought is non-linear. Simple facts bore them. The only important part of a thought is the application.
I'm going to be frank --- their problem is simply a lack of discipline. They like to play. So instead of going to college, they watch the Discovery Channel and gnaw slowly on For Dummies books. They learn Spanish by throwing Spanish insults at each other or playing a table-top RPG over voice chat in Espanglish. They shift from one study to another like buzzing bees, constantly filling their heads with random ideas that collide and connect randomly in their sleep and jump out in unexpectedly genius ways.
Attracting (and retaining) these people is the last, optional stage of the evolution of a userbase. I like to call them 'couch scholars'. Couch scholars are good for a community because they often provide the missing piece or connection to solving a puzzle.They often find the easiest path to point A to point C because they never learned about point B, or found it completely useless.
More importantly, they provide excellent 'tech support' for a programming language. These are the people who visit your forum everyday looking for a small challenge -- usually by giving people quick answers to programming problems.
If you've ever gotten a bit of trivia from someone as an answer and it actually solved your problem once you thought about it, you've met a couch scholar. If you know someone who gives useless trivia all the time when you don't need it, you've met a couch scholar.
There's only one good way to attract couch scholars. Wow them with something oddball, useless, and completely pointless that inspires the imagination. In other words, give them a wonderful brain-power wasting toy. A zombie infection simulator written your programming language should do it. 
There's only one good way to retain them. Give them a space to play. The best place for a couch scholar to play is a help forum. Any place where they can give answers that start with "Maybe if you tried doing this..." or "That's alot like..."
Once your programming language has been through all four stages of evolution, give yourself a pat on the back. You've evolved from monkey to man.- Shawn Hartnell
 Unfortunately, one of my favorite programming languages, Brutus2D, is currently at this stage. Just now, the Brutus2D userbase is starting to gather around the fire as a tribe. They've been drawing in the dirt for some time now, just not as a tribe.
 I know what some of you are thinking. Some of you are thinking "The manual IS easy to understand." For those of you who forgot what it was like being a noob and think the official documentation is easy reading, consider this. How is a noob supposed to figure out how By Val and By Ref are used in Functions, when they haven't learned what a variable is? It may be clear to you, but a noob thinks "Passing what? To who? Um, what? This is complicated."
 This is exactly where FreeBASIC and PlayBasic is today. PlayBasic is a bit farther along because it's been around longer, yet, they seem stuck in this evolutionary stage.
 Prometheus types are rare. I've only known two personally in my lifetime. Consider yourself lucky if you ever meet one. One good example is David Ahl from Creative Computing, whose magazine was all about making computers accessible to the average joe. Another is Richard Clark from the FreeBASIC community (who you should know). Another example is 10b, who is rubbing the sticks together so he can pass on the fire, but you can already see how big the fire's going to be when he gets it started.
 DarkBasic and BlitzBasic have been in this stage for years now. Technically, they've moved on to the stage past this, but since I can't think of any programming languages currently in this stage, I mention them here.
-  Unfortunately, when the FreeBASIC userbase started this stage of evolution, it was quickly stopped by uncertainty of the future syntax of FreeBASIC. A well-written intermediate tutorial written today could be completely useless tomorrow.
 As a couch scholar, I speak from experience. A good friend of mine recently showed me a chladini generator he wrote that makes complex, yet useless patterns. I played with it for hours. It's still on my desktop. Calling me...
by Chris Warren-Smith
The SmallBASIC project commenced in May 2000 by Nicholas Christopoulos and was initially designed for the Palm Pilot.
The 'Small' prefix in the project name reflects the project's original intention of being used with this small hand-held device.
SmallBASIC now also runs under a wide range of platforms including Nokia 770 internet tablet, Franklin eBookman, Linux and Windows.
The language supports old-school BASIC syntax including line numbers, GOSUB and the [in]famous goto statement. This along with various high level built-in routines make it easy for beginners to type in a few lines of code and quickly see some thing happen. Example charts:
dat = [5,6,3,7,10]
chart LINECHART, dat, 3, 20, 17, xmax, ymax
SmallBASIC also supports modern structured syntax allowing you to write maintainable and re-usable code.
Supported syntax includes familiar if/while/until/case etc statements along with nest-able user defined functions and sub-routines. You can further partition your code into separate source modules using the unit keyword.
SmallBASIC is an excellent tool for mathematics. It contains built-in functions for Matrices, Unit conversion, Trigonometry, Logarithms, Statistics (eg SUMSQ, STATSPREADS) Equations (eg LINEQN, DIFFEQN), 2D Algebra (eg PTDISTSEG, SEGLEN) and 2D & 3D graphics transformations.
? "Solve this:"
? " 5x - 2y + 3z = -2"
? " -2x + 7y + 5z = 7"
? " 3x + 5y + 6z = 9"
A = [ 5, -2, 3; -2, 7, 5; 3, 5, 6]
B = [ -2; 7; 9]
C = LinEqn(A, B)
? "[x;y;z] = "; C
A = [1, 2 ; 3, 4]
B = [5, 6 ; 7, 8]
? A * B
? A + B
? A - B
SmallBASIC was recently changed to support variables that can reference (point to) SUB or FUNC blocks using the @ operator and the CALL statement. Here's a few examples:
? "in foo1"
foo3 = 43
fp = @foo3
n = call(fp)
fp = @foo1
A pointer variable can also be passed as an argument to another SUB or FUNC. This offers a similar pattern of use to "virtual functions" available in other languages.
Another area that has been recently enhanced is the CHAIN statement. CHAIN now takes a string or array of strings variable and executes it as a separate process. Program control returns to the calling program once the CHAIN'ed program has completed.
code = "for i = 0 to 10: ? i: next i"
TLOAD "program.bas", code
? "program.bas completed"
Internally SmallBASIC consists of a set of core modules developed in the "C" language. In addition, there are several "driver" implementation modules that target the code for a particular platform. The main drivers currently being developed are the FLTK based module which builds under both Linux and Windows, and the GTK module designed for the Nokia 770.
It was never really intended that SmallBASIC would be used to deliver code to a paying customer. However the console version can be a useful tool for building relatively complex scripts as part of your development process. For example I have used SmallBASIC to generate complicated SQL statements from an input properties file. I have also used it to create a Java database access layer code generator. Like other BASIC's SmallBASIC is great for doing string manipulation.
The GTK driver has enhanced support for the BUTTON and DOFORM statements. With these statements SmallBASIC could be used as kind of "ultra RAD" tool for building a forms based workflow applications. There is potential here for SmallBASIC to be used in a more serious way.
Although the SmallBASIC community forum is a bit "slow", the source forge download counters indicate the project is still reasonably popular.
Here are few tasks that may help raise the project profile:
- Web site overhaul
- Linking into the wider BASIC community perhaps with a web-ring.
- Updated user documentation.
- More sample programs to demo new features.
- More articles in PCOPY!
There are still a few core syntax ideas that are being considered for further enhancement including user defined structures and if test short circuit evaluation. The FLTK version may also gain some form of rudimentary debugger perhaps with breakpoints, line stepping and variable inspection.
Please feel free to give SmallBASIC a try and let us know what you think. SmallBASIC is released under the GPL licence so you are also able to examine its internal workings.
Lesser-Known Basic Languages
by Richard D. Clark
This article presents an overview of some of the lesser-known basic programming languages. All of these languages are available on the internet are all are either open source, free for non-commercial use or freely available.
- License: GPL2
- Platforms: PalmOS, Unix (various), DOS, Windows
- Status: Stable
If you hearken back to the good old days of basic programming, SmallBasic may just be the thing for you. This interpreter runs within its own IDE and follows the old mantra of type and run. The language is quite extensive, with the standard basic commands you would expect, along with a full graphics and sound engine. However the language also includes some advanced mathematical functions such as built-in 2D equation solving, matrix functions and some advanced graphic commands like DrawPoly that you do not see in the standard Basic implementation. The language seems to be quite popular with the hand-held crowd as well. SmallBasic runs on a number of hand-held devices such as the Palm, eBookman, Helio and Clie.
SmallBasic isn't really designed to be a developer platform, but rather a hobby language in the truest sense. If you miss the good old type and run days, you should check out SmallBasic.
- FreeStyle Basic Scripting Language
- License: Free for non-commercial use
- Platforms: Windows
- Status: Active
FBSL is a Windows-only interpreter that seems to be a cross between Visual Basic, Quick Basic, RapidQ, Pascal and C. The language syntax takes a bit to get used to, but once you understand the basics, you can create powerful Windows application quite easily. The remarkable thing about the language is the many built-in constructs such as integrated COM support, and the easy way you interface with third party DLLs. Interfacing to a DLL is simply a matter of listing the exported functions and then using those functions.
In most languages that do use a RAD design, creating Windows applications is time consuming since you must interface with the Windows API. In FBSL you interface with Windows objects using a RapidQ-like syntax that makes building Windows application quite easy. Out of all the Windows-based languages that do not use RAD, I have found FBSL to the easiest tool to create both small and large Window applications.
- License: LGPL
- Platforms: Windows, Linux
- Status: Active
wxBasic uses the wxWidgets library to create cross-platform GUI based applications. Like FBSL, the GUI interface is very easy too use, and supports almost all of the wxWidgets objects. The language syntax is quite familiar, adhering to the QuickBasic and Visual Basic style.
In addition to wxWidgets support, wxBasic has a number of nice features such as dynamic arrays, true strings and associative arrays. The documentation is a bit skimpy but the there is an active forum filled with very helpful people. There have also been a number of utilities created by the active members such as a form designer and IDE to further enhance the usability of wxBasic.
- Yabasic PS2 Emulator
- License: GPL
- Platforms: Windows
- Status: Stable
This is probably one of the most unique of the Basic languages listed here. This is actually a port of YaBasic that was available on the PS2 and runs in a PS2 emulator under Windows. The interesting aspect of this language is the ability to use the PS2 graphics engine (emulated) within the language. There are a number of 3D graphics command that you can use within the language that makes creating 3D applications much easier than using OpenGL or DirectX.
The language structure is classic basic, and if you are used to using old-style basic languages, you should have no problem using this language. While the documentation is slim, there are a number of example programs that you can download and study to see how things are done.
- License: Custom, similar to GPL
- Platforms: Windows
- Status: Active
Basic4GL is a basic interpreter that incorporates OpenGL 1.1 into the language. The language handles all the OGL initialization for you, allowing you to start writing GL programs from the first line. Vectors and matrices are integrated directly into the language so that you can use the standard operators in these constructs just like normal variables. Basic4GL is an excellent language for learning OGL, and for creating OGL applications without all the drudgery usually associated with OpenGL.
- License: Free for personal or commercial use
- Platforms: Windows
- Status: Active
JustBasic was created by the same folks that created the popular commercial product Liberty Basic, and has many of the same features. Liberty Basic has had a long history and dedicated users, and continues to both thrive and improve. Having these same developers, who have years of experience in language development, release a free Basic language puts this ahead of most homegrown versions of Basic. While Liberty Basic has more features than JustBasic, JustBasic isn't a stripped down programming language. It has an integrated IDE with debugger, form designer and has a fairly extensive language. The language supports structured statements, it has a number of graphical commands and something you don't find in most languages, built-in sprite commands including a collision detector. It also supports the creation of GUI applications using simplified GUI commands so you don't have to mess with the Windows SDK. This is fine package, born out of a very successful legacy.
There are of course a number of other versions of Basic out on the internet, but these products I think are the better of the breed and offer some real alternatives to the products that we all know about.
Brutus2D Vs. BASIC
Most of you who are reading this probably have never heard of Brutus2D. That's ok. It hasn't been around for long and hasn't gotten a chance to prove itself, but I can guarantee you that it's at least worth a look. Brutus2D challenges the rules, both as a game programming language and as a BASIC dialect. Given another two years, it may shake things up. Or, just maybe, take over.
Yes, I said the cliche. It challenges the rules. It doesn't break them. It bends them in a wierd way so perverted that you will swear it's immoral. And it just might be.
This tutorial is all about getting a heads-up about what is different from standard BASIC and Brutus2D. But first, I'm going to confess Brutus2D's dirty little secret that has been kept from BASIC fans. Brutus2D doesn't just use BASIC. Optionally, you can use JScript. (GASP!) Don't panic. It's optional. Most B2D programmers revel in BASIC goodness. Now, on to the perversion.
Brutus2D was born with a full-featured scripting language and Bill Gates made it possible. Guilect, the developer of B2D, figured out that he could just include the VBScript engine provided with Visual BASIC, used Direct X as a backend, and then he would be free to create the bridge. And, that's exactly what Brutus2D is. An abstraction of Direct X using VBScript. You get all the goodness (and quirks) of VBS with none of the whack of Direct X. (I said whack.)
I'll be honest, I never used VBScript before using Brutus2D and I had no idea what I was in for. After a week or so, I kind of liked it. It felt dirty selling my soul to Bill Gates but I'm over it now. VBScript is the best scripting language that exists, Bill Gates be damned. But before that let's go with what you know.Variables
VBScript, and thus Brutus2D have only one kind of variable. The variant, that deviant of generic data. Variants are all data types at once. They're kind of like a transsexual. Kind of a he-she / number - string thing. Whatever you want to put into a variable, you can do it. Even if it's kinky.
Since VBScript's variables are so... androgynous, there's no need to declare a data type. Just DIM them.
And, that's it. You can then abuse this variable with any kind of data you so please.For-Next
In BASIC, we are accustomed to this format :
for i = 1 to 100
' do something
But, in Brutus2D this becomes :
for i = 1 to 100
Did you catch it? Instead of "NEXT I", it only requires a NEXT. Bill Gates made VBScript smart and classy enough to handle nested NEXTs without having to mention the variable. The downside of this is if you have an ungodly amount of FORs, good luck on finding which NEXT goes with which FOR.Types
Forget types. You'll find out why later.Built-In Objects
That about covers it for bending BASIC (mostly), so I'm going to move onto Brutus2D itself. As with any game programing language, it provides a number of functions useful for making games. The difference between B2D and the average game programming language based on BASIC is that these functions are mostly provided as objects. (GASP!). Let's look at how B2D initializes a game screen, then shuts it down.
All of this, of course, happens with the B2D graphics object. Not only is this convenient, its easy to remember because functions that are related in use are grouped together under their objects.Lastly, B2D Has Class
This is what makes VBScript the greatest scripting language in the world. You can make your own objects. And you can do it the you've always wanted to. In fact, in the B2D world, types have been dropped altogether for Classes. I don't have space in this tutorial to describe them in detail (maybe next time), but here's a sample object to give you the idea.
Public Sub Init()
' init stuff
Public Sub moveLeft()
' move left
Set meanDemon = new MeanDemonCl
Well, that's all folks.
Windows A.P.I. - A Complete Study
Part Two - API Extended Knowledge
Welcome to this second part of the Windows A.P.I. - A Complete Study series. As promised in first part of the series, we will be looking at more details of the API and see what we can do with them. So in case you don't have it, grab the last sample program from the first part of the series since that's the one we'll be working with in this second part. Well be looking at how to work with the default controls, adding text to a text box, populating a combobox and the likes in a first part. In the first part's conclusion I mention we'd be working with unregistered non standard controls but there is plenty to cover with just the standard controls so a little patience, the unregistered controls will be elaborated in the next part of the series.
It's important to note that though I am using freebasic in this example any BASIC implemenation capable of accessing the Windows A.P.I. should be able to run these programs with someone minimal changes (once you know which Windows related file to include at the top of your source file). So I think any BASIC programmer can probably learn fine from this example. You can always email me if you're having problems porting the sample programs to your flavor of BASIC.
AND THE JOURNEY CONTINUES:
Just to warm ourselves up a bit, the first new thing we'll do is quite simply add a button to the form that will change the text in the textbox we already created in the example. When Adding controls to a form, the basic steps are pretty much the same for all intrinsic windows controls. They are:
- Create a variable to hold the handle of the control (or redim an array of control handles depending on your choice).
- Add a CreateWindowEx function call to create the new control WinMain function (or whatever function you use to create the controls of the form).
- Add code to respond to the events needed in the WindowsCallbackProcedure function where appropriate.
With this in mind we will follow these guidelines to add our button and management code where we need to. First step is to create a variable for our button handle. We'll add that variable where the other control variables are currently created. So, right ater line 27 add this.
DIM SHARED ChangeButtonHandle AS UINTEGER
Next, well add the command to create the button itself with it's new caption. To do that you need to go where the other controls are created (that's the series of calls to the CreateWindowEx that end on line 189. After that you can add this:
ChangeButtonHandle = CreateWindowEx(0, "BUTTON", "&Change Text", WS_VISIBLE Or WS_CHILD Or WS_TABSTOP, _ 300,300, 110, 30, hWnd, null, hInstance, null)
Now we want this button to change the value of the textbox on the form. In order to do that, we'll need to learn a new API function called SetWindowText(). Basically we need two parameters when we call this API the handle of the control we want affected and the text value we want to put in the control. This code will be added in the WindowsCallback in the last case statement as shown here:
CASE WM_COMMAND SELECT CASE lParam ' ----------------------- ' Ok Button was clicked ' ----------------------- CASE OKButtonHandle MessageBox hWnd, "You have clicked the OK button!", "INFORMATION", 0 ' -------------------------------- ' Change Text Button was clicked ' -------------------------------- CASE ChangeButtonHandle CALL SetWindowText(EditControl, @"Text I Added.")
And there you have it, it's really that simple, here is the source module to see it at work. EditControl is the name of the variable we created the textbox. The "Text I added" is passed with th @ since SetWindowText expects a pointer to string. Now, compile this and execute it. You'll see the new button added to the form. and when you click on it you will see the text of the textbox get changed as it should. Next on the list, we'll create a combobox and populate it with options at the click of another button.
A MORE DETAILED API EXAMPLE:
We keep on adding to this example and well one of the things I'm trying to illustrate is that once you get the API basics of Form Design adding controls, determining the order they navigate in, can become a rather systematic thing. In Windows API programming, the first thing to remember is that the order you create your controls determines the order in which the tab key will navigate through those controls. This becomes important when you start creating, data entry forms or specific types of dialogs that need things in a specific order.
Now for this next part, we will add another button and a combo box (one of those text boxes that has a button on the right to bring down a list of items. Now we won't stop at just displaying the combo box itself. The button will add items to the list part of the combo box so you know how to do that as well. So, as our 3 guidelines dictates, we'll start by adding a variable to get the handle of the button and a variable to get the handle of the combo box. Hence, right after where you added the ChangeButtonHandle, add this:
DIM SHARED ComboControl AS UINTEGER DIM SHARED PopulateButtonHandle AS UINTEGER
Next we add the CreateWindowEx calls for the two controls. We do that in the WinMain funcion (we'll add them at the end of the other CreateWindowEx calls we have there). Take a good look at the call that creates the combo box, it has specific styles added to it and i'll explain them after. Here's the code for them:
ComboControl = CreateWindowEx(0, "COMBOBOX", "", _ CBS_DROPDOWN Or CBS_AUTOHSCROLL Or WS_VISIBLE Or _ WS_CHILD Or WS_TABSTOP Or WS_BORDER Or WS_VSCROLL, _ 300,90, 200, 120, hWnd, null, hInstance, null) PopulateButtonHandle = CreateWindowEx(0, "BUTTON", "&Populate ComboBox", _ WS_VISIBLE Or WS_CHILD Or WS_TABSTOP, _ 500,300, 150, 30, hWnd, null, hInstance, null)
Note that we added two 3 styles to the creation of the combobox control. The CBS_DROPDOWN, CBS_AUTOSCROLL and the WS_VSCROLL. In the windows API, any constants that starts with WS_ is of a general nature. That means that WS_XXXX constants affect all types of controls. The CBS_XXXXX constants are for combobox, listbox and dropdown type controls (all created with the "COMBOBOX" type of control. The are preceded by CBS because they affect only combobox specific types of controls. If you look at the Windows.bi declaration (or any Windows API declaration file you happen to be using for the BASIC flavor you are using you'll see there's a lot of constants and they are all preceded by a prefix like WS_ or CBS_ and others to tell you what they are there for. when creating controls like this you have to specify every style you want added since they are all off by default. for example, take the WS_VSCROLL out of the combobox CreateWindowEx and see what happens to the combobox control when you run it.
The next step is to actually add elements to the combobox's selection list part. Now you can add these when you create the control (or pretty much anywhere you see fit to add elements. In this example, I decided to do it when you click on the Populate ComboBox button. Hence, in the WindowsCallbackProc function, in the same select case statement as our Text Changing example, we'll add a case for the PopulateButtonHandle and add our elements to the combobox on that button's click. To add elements to the combo, we'll need to use the SendMessage API function. Here's what the select case should look like:
CASE WM_COMMAND SELECT CASE lParam ' ----------------------- ' Ok Button was clicked ' ----------------------- CASE OKButtonHandle MessageBox hWnd, "You have clicked the OK button!", "INFORMATION", 0 ' -------------------------------- ' Change Text Button was clicked ' -------------------------------- CASE ChangeButtonHandle CALL SetWindowText(EditControl, @"Text I Added.") ' -------------------------------------- ' Populate Combobox Button was clicked ' -------------------------------------- CASE PopulateButtonHandle CALL SendMessage(ComboControl, CB_ADDSTRING, 0, @"First Item") CALL SendMessage(ComboControl, CB_ADDSTRING, 0, @"Second Item") CALL SendMessage(ComboControl, CB_ADDSTRING, 0, @"Third Item") CALL SendMessage(ComboControl, CB_ADDSTRING, 0, @"Fourth Item") CALL SendMessage(ComboControl, CB_ADDSTRING, 0, @"Fifth Item") CALL SendMessage(ComboControl, CB_ADDSTRING, 0, @"Sixth Item") END SELECT
Quite simple so far right? We basically add to the code as we add controls to the form. The 6 calls to SendMessage we have here will simply add 6 elements to the combobox control. CB_ADDSTRING is an API constants defined as &H143 that is the message to add an item to a combobox. Now compile this and and execute. You can see that when you click on the Populate Combobox button and click on the little arrow on the combobox that it has now added 6 elements to it.
In this second part of the series we will be covering one more thing. And that is one of the most standard things you can do in a windows application. We will be covering how to create a menu system for your program (still by adding to the same example) and how to find out which menu option was clicked by adding code to exit the program when the exit menu option is selected. Source example
ADDING A PULLDOWN MENU TO THE PROGRAM:
Most programs you use in Windows have a menu, usually at the top of the form, that the users can select operations from. Adding a menu system is rather trivial though you do need to set a few things up first. In order to do this we will Need to add some data types and variables to accomodate the creation of he menues and menu items. We will also need to create some subs and functions that will help keep the definition of the menu system clear and then we will see how to incorporate the menu operations in the rest of the API example. So them, let's start by creating the data types we'll need. Here's the code that should be added at the beginning of the sample module. The first part are some constant definitions:
CONST BaseMenuIDNumber = 20 CONST MaximumMenues = 20 CONST MaximumMenuItems = 60
At this point, the choice is yours, but you'll need to create a list of values for each menu item in the whole menu system. You could do that with a list of constants or, like I did here, in a ENUM datatype. I like ENUM datatypes because they are quicker to create since you don't have to type the CONST keyword everytime and when you add or insert elements in the ENUM structure everything after gets automatically assigned a new value so you don't have change everything after where you inserted the new item. So here's the ENUM structure for our menu example.
ENUM MenuIDNumbers MenuFileNew = BaseMenuIDNumber MenuFileOpen MenuFileClose MenuFileExit MenuEditUndo MenuEditRedo MenuEditCut MenuEditCopy MenuEditPaste MenuSearchFind MenuSearchReplace MenuSearchGoto MenuWindowTileVertical MenuWindowTileHorizontal MenuWindowCascade MenuHelpAbout MenuHelpContents MenuHelpIndex END ENUM
Now we'll need two User Define Tpes to hold the data for our menu definitions. One for the menu system and one for menu items. Here is what these user defined types are defined as:
TYPE TMENU Handle ASs HMENU END TYPE TYPE TMENUITEM Title AS STRING Id AS INTEGER ' This will be tied to our ENUM values above END TYPE
We will be creating 4 new subs that will help us in defining the menu system. Of course, like all subs and functions they will need to be declared first using the DECLARE keyword so that they are accessible throughout the module. Hence right adter the type definitions you can add these declarations:
' ------------------------------- ' SUB and FUNCTION declarations ' ------------------------------- DECLARE SUB MenuInsert (BYVAL MenuHandle AS HMENU, BYVAL SubMenu AS INTEGER, _ Title AS STRING, BYVAL Flags AS INTEGER = 0 ) DECLARE SUB MenuSeparator (BYVAL SubMenu AS INTEGER) DECLARE SUB MenuAppend (BYVAL SubMenu AS INTEGER, BYVAL id AS INTEGER, _ Title AS STRING, BYVAL Flags AS INTEGER = 0) DECLARE SUB SetupMenuSystem (BYVAL ParentForm AS HWND) DECLARE FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _ BYVAL hPrevInstance AS HINSTANCE, _ szCmdLine AS STRING, _ BYVAL iCmdShow AS INTEGER ) AS INTEGER
The WinMain function was already there, we just added the four subs above it. In the module, I've implemented these subs at the very end of the module so if you want you can add them there as well. MenuInsert() is a sub that well inserts a submenu to the menu system itself so when we want to add a menu to the menu bar at the top of the window, we'll use MenuIsert to do that. Here's the code for MenuInsert():
SUB MenuInsert(BYVAL MenuHandle AS HMENU, BYVAL SubMenu AS INTEGER, _ Title AS STRING, BYVAL Flags AS INTEGER = 0 ) WITH SubMenues(SubMenu) .Handle = CreatePopupMenu( ) InsertMenu(MenuHandle, SubMenu, MF_BYPOSITION Or MF_POPUP Or MF_STRING or Flags,_ cuint( .Handle ), Title) END WITH END SUB
The MenuAppend() sub takes a menu item and addes it to a given submenu. When you look at the SetupMenuSystem() SUB you'll see how trivial this makes creating a menu system. Here is its code:
SUB MenuAppend(BYVAL SubMenu AS INTEGER, BYVAL Id AS INTEGER, _ Title AS STRING, BYVAL Flags AS INTEGER = 0) WITH MenuItems(Id - BaseMenuIDNumber) .Id = Id .Title = Title AppendMenu(SubMenues(SubMenu).Handle, MF_STRING or Flags, Id, Title) END WITH END SUB
In most menu system you'll see you notice that items or often seperate by a line to help group them some. This is called a seperator line and it's so used everytime that this is why we have a MenuSeparator() sub defined here. Here's the code, don't blink cause it's a short one.
SUB MenuSeparator(BYVAL SubMenu AS INTEGER) AppendMenu(SubMenues(SubMenu).Handle, MF_SEPARATOR, 0, NULL) END SUB
Now that we have our support subs created we can go ahead and define our menu system. SetupMenySystem() has the complete menu definition and as you can see here, with the use of those support subs we created, it looks very clear and easy to understand what each menu definition is all about. here's the code to the SetupMenuSystem() subroutine:
' ========================================================= ' NAME........: SetupMenuSystem() ' PARAMETERS..: ParentForm AS HWND ' RETURNS.....: no values ' ASSUMES.....: that the parent form is a valid handle ' --------------------------------------------------------- ' DESCRIPTION.: This subroutine defines the menu system ' and once done, attaches it to the form ' which is passed as a parameter to the ' subroutine. ' ========================================================= SUB SetupMenuSystem(BYVAL ParentForm AS HWND) DIM WorkMenu as HMENU WorkMenu = CreateMenu() ' --------------------------- ' Insert File Menu Contents ' --------------------------- MenuInsert(WorkMenu, 0, "&File") MenuAppend(0, MenuFileNew, "&New") MenuAppend(0, MenuFileOpen, "&Open ...") MenuAppend(0, MenuFileClose, "&Close ...") MenuSeparator(0) MenuAppend(0, MenuFileExit, "&Exit") ' --------------------------- ' Insert Edit Menu Contents ' --------------------------- MenuInsert(WorkMenu, 1, "&Edit") MenuAppend(1, MenuEditUndo, "&Undo") MenuAppend(1, MenuEditRedo, "&Redo") MenuSeparator(1) MenuAppend(1, MenuEditCut, "&Cut") MenuAppend(1, MenuEditCopy, "&Copy") MenuAppend(1, MenuEditPaste, "&Paste") ' ----------------------------- ' Insert Search Menu Contents ' ----------------------------- MenuInsert(WorkMenu, 2, "&Search") MenuAppend(2, MenuSearchFind, "&Search ...") MenuAppend(2, MenuSearchReplace, "&Replace ...") MenuSeparator(2) MenuAppend(2, MenuSearchGoto, "&Goto ...") ' ----------------------------- ' Insert Window Menu Contents ' ----------------------------- MenuInsert(WorkMenu, 3, "&Window") MenuAppend(3, MenuWindowTileVertical, "&Tile Vertically") MenuAppend(3, MenuWindowTileHorizontal, "T&ile Horizontally") MenuSeparator(3) MenuAppend(3, MenuWindowCascade, "&Cascade") ' --------------------------- ' Insert Help Menu Contents ' --------------------------- MenuInsert(WorkMenu, 4, "&Help") MenuAppend(4, MenuHelpAbout, "&About ...") MenuSeparator(4) MenuAppend(4, MenuHelpContents, "Help &Contents") MenuAppend(4, MenuHelpIndex, "Help &Index") ' ---------------------------------------- ' Assign menu system to form and draw it ' ---------------------------------------- SetMenu(ParentForm, WorkMenu) DrawMenuBar(ParentForm) END SUB
At this point we have all we need. We just need to put it in the right place in our existing code in order for the menu to be defined, presented to the user and managed when the user selects one of the options. So lets take these steps one at a time. To create the menu, we'll call the SetupMenuSystem() inside our WindowsCallbackProcedure() function. When the WM_CREATE event is triggered. Hence that case will look like:
' ----------------------------- ' Message Process Select Case ' ----------------------------- SELECT CASE message CASE WM_CREATE CALL SetupMenuSystem(hWnd) ' Our call to setup the menu EXIT FUNCTION
In order to determine what menu option was selected, we'll need to add a few variables at the beginning of our WindowsCallbackProcedure() function to hold the menu option as well as one variable that will keep track of the last menu we selected. Here there are:
STATIC LastMenuId AS INTEGER DIM WindowMenuId AS INTEGER DIM WindowMenuEvent AS INTEGER DIM menu AS HMENU
The use of these variables occur in the WM_COMMAND case statement (where all our other events are controled). We'll put our menu specific code right before the existing SELECT CASE statement that's there. So just before that you can insert this code (which I'll explain after):
CASE WM_COMMAND ' --------------------------------------------- ' Get menu ID and event from wParam parameter ' --------------------------------------------- WindowMenuId = LOWORD( wParam ) WindowMenuEvent = HIWORD( wParam ) Menu = GetMenu(hWnd) ' --------------------------------------------------------- ' Select case to execute code based on menu item selected ' So far only the Exit menu option is implemented. ' --------------------------------------------------------- SELECT CASE WindowMenuId CASE MenuFileExit PostMessage( hWnd, WM_CLOSE, 0, 0 ) EXIT FUNCTION END SELECT ' -------------------------- ' save current menuitem id ' -------------------------- LastMenuId = WindowMenuId ' -------------------------------------------------------- ' force a repaint so the menu id and title will be drawn ' -------------------------------------------------------- GetClientRect( hWnd, @WindowRectangle ) InvalidateRect( hWnd, @WindowRectangle, TRUE )
The wParam variable is a 32bit Integer, to get the menu ID and the menu Event from that one numeric value we use the LOWORD() and HIWORD() freebasic functions. we then give the handle of the created menu to our Menu variable. The WindowMenuID is given the number that we used in our definition (in our case one of the values in our ENUM structure that we defined above). So the select case becumes crystal clear since we can use words like MenuFileExit instead of the value 103. And if you run the program you'll see that this system works very well, you can select the Exit menu option and it will properly exit the program. The GetClientRect() and InvalidateRect() calls we have after are, as commented, intended to force a redraw of window (say we wanted to display the selected option on the form we could add code before forcing the redraw and the screen would be updated with the last chosen menu option. Source Example
AND THIS CONCLUDES PART 2 OF THE SERIES:
And there you have it for now. We've covered alot of ground (even though we didn't have time to look at unregistered controls as I mentionned we would) in this 2nd part of the series. I hope you are digesting all this so far and I think that with all of this you'll be starting to create some pretty amazing stuff. The best thing to do to get a grasp of what's available is to google for windows API references to see what all the controls are, what styles/options are available for them and see if you can put them all together into a form and make it all work properly. This will help you get very familiar with the Windows API and more than read for out third part.
The 3rd part of the series will be about the promised unregistered controls we will create an example that uses the listview control. We won't stop there because in the next part, we will also be looking at a big missing part of efficient API programming. We are talking about resource files. With them, it's easy to make alot of common things you're likely to find in a windows GUI application and provides a great way to organize all the resources you'd need in your projects. So we'll be covering resource files and how to use them in our Windows Programming projects. The API is a big beast, no two ways about that. If you have questions and comments or ideas about what should be covered in this series, feel free to let me know by email or whatever other means you have. if there's enough material to cover, I'll extend this series to as many parts needed to make a real "complete study" series so don't hesitate to send me your ideas and suggestions. Until next time, happy reading and coding.
FreeBASIC syntax colors for GEdit
Since GEdit is "official text editor" for Gnome and pretty popular but does miss FB syntax colors, here is how you get them. I made this first like year ago, lost lang file, used vb.net colors but now i thought to remake it.
With help of stylin and few others, we should now have FreeBASIC syntax colors for gedit and it should work with every version too. Original thread about this issue locates at FreeBASIC forums. This thing is very easy to install, so take 3 minutes and you have fb colors on your gedit. By changing few things, you can add syntax colors for any language.
Nearly all keywords and data types should be there. If we missed some, please post a note of it in here and ill add it on there. You can easily add your own keywords there. I dont think i need to explain that ;) Anyway, just remember that 250 keywords is max for one list.
If you start editing syntax files from that folder (just like vb.net) make sure you have backup. An error on file can make a real mess. And i mean REAL since gnome uses those .lang files pretty many other places too. If you mess your computer because of this, dont come and whine for me. ;D
- 1. Open terminal or console.
- 2. Type sudo gedit /usr/share/gtksourceview-1.0/language-specs/freebasic.lang
- Path might be different for different distros. Just search *.lang and where you find them, correct path based of your search results.
- 3. Copy/Paste source from here: www.ascii-world.com/downloads/extras/fb.lang
- There has been some problems when source is copied from phpBB forums or websites, thats why i use here stright link to .txt file.
- 4. Check first line, change "UTF-8" for your UTF code. If you are not sure what it is, open vbnet.lang (or any other .lang file) from same folder to check it.
- 5. Save file and restart GEdit.
Now you can choose your new FreeBASIC syntax file to use by goin: View - Highlight Mode - Sources - FreeBASIC
If you dont like colors, go to Edit - Preferences - Syntax Highlightning and select FreeBASIC to edit it.
There you have it folks, it took longer than it should have (with good reasons), but we believe that it was a good quality issue even if smaller than the last. Since the redesign of the website is now all done and we're back at the "maintaining the contents" of the site fresh, we can now gat back in sync with more regular releases of PCOPY! So you can expect the next issue to be out before you can make yourself a condominion out of tooth picks (we promise hehe).
Of course any BASIC related contribution (or news brief) is always more than welcome here. Got an article, a rant, a tutorial, a review that is either BASIC programming related or about things that were created in a BASIC flavor (any BASIC, any OS). If you want it publised in PCOPY! just send it over to us and we'll take care of the rest, no templates, no guidelines per se (cept for the respect of other people's hardwork creating the BASIC dialect you want to talk about.
You found something out about one of the basic program or related projects and you'd like to share that news with us to be published in the next upcoming issue of PCOPY! just send us an email and we'll take care of adding it to our news items for you.
We hope you enjoyed this issue of PCOPY! and be sure to be on the lookout for the next upcoming issue. Until next time, Happy Coding!
The PCOPY! Editing Team.