PCOPY!
covering all the BASICs...

Issue 10  ~  August 02, 2006
In This Issue:

Contributors:
MystikShadows
 (editor in chief)
Kristopher Windsor
Lurah
Aroticoz
mennonite    
Chandler
Corey Yeates
Mac
 


From The Editors

Welcome to the VERY FIRST ISSUE of PCOPY!, a brand new "magazine" created and offered to ALL BASIC developers all over the web. After some research amongst other BASIC forums and Websites we noticed that aside QB and family of compilers and FB, most other BASIC dialects didn't have anything close to a "magazine". Hence, PCOPY! saw the light of day. PCOPY! exists because we believe that alot of BASIC dialects out there deserve to be mentioned and talked about. Therefore, anything that pertains to any freely available BASIC can make it's way to PCOPY! being projects, new versions of compilers, new or updated libraries for these compilers, if it's about BASIC it can definitaly be in PCOPY!.

THE PCOPY! F.A.Q.:

As you might expect, a new "magazine" surfacing in the middle of nowhere for no particular reasons probably raises some questions. After all, it's not like a "magazine" is just thrown together. As such, we felt it was a good idea to answer a few questions that you would most likely be asking yourselves when reading this. Hopefully it will help make things clear.

Another "Magazine", why?
First and foremost, the authors of PCOPY! are great fans of
QB Express and are definitaly looking forward to many more issues of QBE to read in the future. PCOPY! exists to provide even more reading material to those who love to sit down and read something so yes, the readers of QB Express might also like to give us a try. Also, it's not like it's a 20th active "magazine", there's QBE and
QBXL, there's probably room for one or two more. We look forward to hearing from
FreebasicNews, too.

So what is PCOPY! all about?
PCOPY! is a "magazine" aimed to provide news, reviews, information, updates, articles and tutorials for a different range of basic dialects than that of QB Express. Of course such languages as QuickBASIC and FreeBASIC will be covered but also other languages like BCX, XBasic, and many other different basic dialects that are available out there. PCOPY! is a "magazine" for BASICs in General. If a new version of a BASIC dialect comes out, if a new tool or new version of a tool for them comes out we'll do our best to let you know about it. ALso, if any success stories about these BASIC dialects happens we'll be sure to let you know about them as well. Keep you updated as good as we possibly can.

Who is PCOPY! for?
PCOPY! is for BASIC programmers, of all levels, and attempts to cover all aspects of programming from applications to tools and utilities, from RPG games to 3D games. Tutorials of all levels are most definitaly accepted. From the usage of INKEY$ to full fledged 3D Open G.L. tutorials. We aim to offer something interesting to read to anyone that stumbles on this "magazine". As such, It doesn't matter your background or current plans and projects you just might find something worth reading here.

Do you accept material submitted from readers?
We most certainly do. As many might know it's quite a job to keep updated all the news that can happen in the BASIC world. And writing tutorials, reviews and articles takes a good time. So any help is definitaly more than welcome. If you've already written something in the past, or feel like writing something now, by all means do so, it will only help the quality of the "magazine". Contributions can of course be anything you'd like to see in PCOPY! like reviews, comparison charts, articles, interviews and tutorials. Reviews can be of anything, a game, a language, a tool, a BASIC related programming website even just review it and submit it. Send your articles to:
mystikshadows@ascii-world.com

Will this affect your current QB Express contributions?
the answer to that is no. As mentionned above, PCOPY! has a different range of articles possibilities since it covers some very different languages as well as those covered by QB Express. There's plenty of room for plenty of creativity. Not to mention that there's still plenty of writing to do for QB Express for many more months (even years). We can pull that off without a problem.

Inside Issue 10:

We have an excellent lineup in this premier issue of PCOPY! For starters, Lurah briefs us on one of the most amazing games ever to use SCREEN 12 - "Bounce 3: On the Town" by Kristopher Windsor, and a cool new program by Alex Kivikoski that turns bitmaps into sound, MystikShadows describes his "Developer's Desktop" project, Chandler shares his thoughts about QBasic, FreeBASIC and C in "Hey, this is gonna give some programmers a heart attack", Mac talks about "KRef - A Kriegspiel Referee", Kristopher Windsor tells us why we shouldn't "feel obligated to use Vista", Aroticoz makes his writing premiere by offering us a 3D tutorial, Corey Yeates talks about a simple but useful creation of his called "Program Edition", MystikShadows reviews chaOs' Lynn's Legacy Game. We think you'll love our first issue, but don't let us hold you off any longer, see for yourself and get reading!

- The Editors of PCOPY!



Neat BASIC Projects

Starting with the quasi-related: Ascii-world, who bring you PCOPY! now have a subforum for classifieds. The classifieds are for participants of the Pure-text and Ascii-world forums and the entire QMunity. (If you participate, you're a participant. if you don't, you're uh, not. Pretty simple, don't worry about it.) The classifieds (NOT "PERSONALS") can't be used to spite other members of the community, but CAN request boycotts of commericial industries (such as the boycott rdc wants against Lifoam for its treatment of one of its employees.) If all goes well, the classifieds will eventually become a feature of PCOPY! You can browse the classifieds at the Ascii-World forums:
http://www.ascii-world.com/phpBB2

Also at Ascii-World, Lurah has opened a deadline-free 20-line program compo:
http://www.ascii-world.com/phpBB2/viewtopic.php?t=594 So far, Lurah's posted a program that encourages you to commit suicide (well it does) and mennonite's entry draws fusilli pasta. rdc has added a program that prints out the Golden String in color and Lurah added one that simulates a snow fall. Outside of this 20-line compo, Lurah additionally points out: "If someone makes ASCII version (multiplatform) of LEGENDARY game Pirates by Sid Meier, ill marry him lol." Your kids will look interesting.

Soon, Liberty Basic will be available in versions for Windows, Mac, and Linux. (A lite version of Liberty Basic for Windows, called JustBasic, is free.)

Lunar Lander Reloaded, made with CoolBasic is available at:
http://www.coolbasic.com/forums/index.php?showtopic=4746 Tracks are randomly made each time and game is finished, although crash check isn't working perfectly.

Jerry Muelver is in the process of rebuilding his site at:
http://hytext.com He's the author of the incredibly excellent WikiWriter (open source, windows freeware, coded in IBasic) which you can download at:
http://hytext.com/ww/Download.htm

nawi has been working for a while on his StuntMoto game in BlitzBasic, but is looking for a good 3d artist. You can contact nawi and see a screenshot (and video trailer) for the game at:
http://blitzbasic.com/Community/posts.php?topic=61812

George from KindlyRat's GW-BASIC forum has a new site where he posts his GW-BASIC code:
http://mysite.verizon.net/resratu3/gwbasic311 right now he has a program that codes text into a jpeg file and one that reads the volume label of a floppy using the SHELL command.

Jordan Morsberger's first text-based adventure in GW-BASIC called "Toby Rainbow" is now available - you can get it from his site at:
http://hosted.filefront.com/jormor/

"Darth Vader" (probably another guy with the same name) has created a horse betting game called "HorBox Racing" in Dark Basic... He explains: "You start off with $500 not much but enough to place a few bets on the horses. You place a bet on the first horse and then move to your sitting box. Advanced technology gives you two views. A normal side windowed view or a Cinematic view. The bell rings, the horses are off!! Number 1 wins! You go estatic! You immediately run to the beting box to place another bet!" download this game from his website (which he's still working on):
http://ideal-entertainment.galekus.com/Horbox%20Racing%201.4.rar

Karra's first JustBASIC game is called "Invasion of planet earth" and can be found at:
http://jbusers.com/phpBB/viewtopic.php?t=362 The game seems to have impressed a number of people so far.

Basic4Linux under major changes: Garret has updated
http://www.Basic4Linux.com and it looks very good. Garret has listed lots of BASIC dialects that can be used under linux OS's. Hes also planning tons of stuff there, so as we can easily guess, all help is appreciated. All Penguins who thinks "thats a job for me", connect to Garrets site.

Kristopher Windsor is working on a Monopoly game, and given the quality of some of his projects like iOS and his new version of Bounce! (see below), this is a QBasic project worth watching. He's also made a cool "camera shake" demo at:
http://www.network54.com/Forum/13959/message/1153150599 on The Qbasic Forum, where you can find most his projects. Kristopher's website is now up too, at:
http://geocities.com/tzmne

coderJeff is working on a dos help program for freebasic: http://www.freebasic.net/forum/viewtopic.php?p=42043

Lurah (we realy couldn't put it all in one post) is working on Ascii Beerman, think Pac Man, only drunk. His Ascii Meteors game in QBasic is expected soon.

Using his amazing Glyph32 routine, rdc has recreated Tailgunner in ASCII: http://www.ascii-world.com/phpBB2/viewtopic.php?p=3346 he is also working on an impressive platformer entitled "Goldman" - using Glyph32 much the same way ASCII games are drawn with PRINT, but look at some of the graphics: http://www.ascii-world.com/phpBB2/viewtopic.php?p=3397

Shanghai Mahjongg (BCX / C Game): On july 30th 2006, Michael S. Sanders Announced the release of Shanghai Mahjongg
in this thread on the Basically Programming Forums. The game features the classic turtle like layout of the tiles. The object is to match tiles to get rid of them and to clear the board of all the tiles. An excellent BCX / C / Windows API creation from Michael S. Sanders that's sure to bring you puzzle lovers some good wholesome entertaiment.

Earth Prime: The Nanite Event: Osirin Ra has created
this thread on the freebasic forums entitled Earth Prime: The Nanite Event. It is a new game project that features an amazing storyline. The basis of the game is a post apocalyptic strategy RPG in the spirit of the classic Wasteland/Fallout series. From what I've read so far it is promising to be one of the most unique RPG ever developed in FreeBasic.

Dragon Dancer was announced
in this thread on July 18th. Adigun Asikiwe Polack has created another game. This game features amazing and smooth graphics, excellent gameplay and really lets us preview the awesome abilities of his other project, the AFLIB2 library that he created. The game reflects Adigun's exquite graphic art and promises to be one of the hottest games released this summer.

D.J. Peters has been busy working on his FBSOUND library, a library designed to handle digital audio files. In
this thread he annouced his library, on July 23rd. There are plans to add even more to the library in the near future, functionality to make it more usable in gaming projects. This will be one to follow closely.

rujohn announced the beta release of XBLite GDE version 0.90. XBLite GDE is a GUI Development Environment created to give XBLite a visual design tool that greatly cuts down on application design time. Even in it's alpha state XBLite GDE didn't have many bugs at all. From the looks of things this will make XBLite even more usable for bigger scale projects by cutting down drastically on the visual design of any related forms and dialogs. For all you XBLite users, be sure to give this project a try. You can download this project from
right here. Note that you need XBLite already installed in the default xblite folder right now but this will change very soon.

Bounce 3: On the Town

by Lurah

Bounce 3: On the Town

Kristopher Windsor announced about hes new game, Bounce 3: On the Town. This hectic game, made with QBasic puts you in role of smiling ball and your simple mission is to move forward by bouncing in top of buildings and over helicopters.

On sidenote, this is very addictive game so be warned =)

Kris notes: Get as many points (bright green objects) as possible before losing all of your lives. The bonuses will make you bigger, bounce higher, and give you invincibility. (You will not lose a life if you die with yellow eyes.) Also, if the progress gets to 100%, the game is over. So try to get many points before progressing throughout the city. You have to bounce on the helecopters and buildings to avoid landing on the ground.

You can find source for this game
here.

Space Sound Generator

by Lurah

Alex Kivikoski announced at
CoolBASIC Forums about hes new clever program that produces cool space sounds by reading picture files (.bmp)

Program, named as Space Sound Generator allows you to open .bmp files with it and then plays spookie space sounds, depending nature of your .bmp file.

As long as picture is in .bmp format, theres no matter with what picture/drawing program you have created it. There is also possibility to draw your own pictures with Space Sound Generator and save them for later use.

Program also includes chance to change tempo, factor and it also includes few different sounds and other stuff, you just got to check. I recommend all Windows users to check out this funny, clever and also weird program. Program is still under developement but i didn't find any harmfull bugs from it. PCOPY! will follow developement of Space Sound Generator and lets you know when major changes or improvements pops up.

.rar package can be downloaded from:
http://www.ascii-world.com/pcopy/files/ssg_english.rar

Developer's Desktop Professional Project

by MystikShadows

INTRODUCTION:

Welcome to the Developer's Desktop project. You can think of Developer's Desktop as your one place development tool that is designed with developers in mind. Developer's Desktop is inspired by the ever classic
Tandy's DeskMate application software and as such offers a completely integrated set of tools a developer might need in the course of his development sessions. Of course, there's more than one way to work on your coding projects. Some people will basically want everything that is currently tied to a given project as a basis for the whole user interface. Others will prefer to begin with a list of projects and work their way down the hierarchy to get to the html document, code modules or other related files. Others might decided to completely organize the way they work based on more than one project with different sets of tasks to do in each of those project. Filanny others just might not really care about projects per se, they might just want to go into a program and start to work on whatever (which they would choose after they are in the program itself. Basically, once Developer's Desktop is started, you define the way you'll be working and let Developer's Desktop adjust itself to your specific way of working for you.


Here's a screenshot of the main screen itself (the one you get when you first start the application. I'll explain after what exactly you're looking at.


Each of these different lists can be completely customized to fit the way you want to work and you can decide to show or not the to do list, calendar, contact list and other accessories. In this screenshot you're seen a typical general view showing different projects, website projects, documents that you would want to work with at a general level. Selecting a project would change the desktop to show what is relevant to the project itself completely defined by you. There's more than one way to go about working with Developer's Desktop. Let's review the main usage scenarios types.



THE TYPICAL USAGE SCENARIOS:

The main goal of Developer's Desktop is to be adaptable to each user's specific needs and wants while sacrificing none of the features that each approach offers compared to the other approaches. Hence, no matter which approach is desired by the user, they can switch easily to other types of approaches just to see what happens then and what to do next (if need be). Developer's Desktop is designed specifically for people that just want to get things done any way they would typically do it themselves manually. It's there to keep track of things, or not, and help organize the developer's daily workload pretty much any way they want. As such, Developer's Desktop supports the following four approaches to their development work.

  • Project Based Approach:
    In this context (if you choose to) you start Developer's Desktop in a list of current projects. If you have any existing projects you can simply find the one you want to work on and select it or create a new project (note that if you want, you can create a new project based on an existing project to save you considerable typing depending on the project). Once you have selected the project, you fall into the main desktop screen. This main screen displays selection boxes for each type of application. If your project has files or events or notes relating to a specific application, they will appear in that application's respective box. a calendar will also appear as well as a list of contacts (so if you're working in a group on a project you'll be able to list them all here. The todo list will also appear so that if you have things to do you'll know it right away. In the main list of projects, little indicators will appear for any pending work or to do items so you'll know right from the start if you're supposed to be doing something or not. The main thing to remember is that everything you see on the main project screen is related to the currently selected project.

  • The Task Based Approach:
    As you might have guessed, this offers a more agenda like approach to their work. Some people will want to list out their work and basically start from that set of tasks. Task may be related to a project but it's not the main reason to do the task. Whenever and wherever in the application, if something is related to a project, that project will appear so they know that whatever they are currently doing is part of the given project. likewise, once they have done that work, since they are in the project, they might want to look at other things to do on that specific project or return to the list of tasks. Developer's Desktop allows with a simple push of a button users are of course free to do whatever they want. Everything else that might appear is basically for informational purposes more than anything. But users just might find it quite practicval to be alerted if other tasks should/could be done so that they know and can decide to do them right now or go back to the main list of tasks.

  • Globally Based Approach:
    This basically skips the main project list of the Project Based Approach. You fall right into the project view (with all the application types and related documents) there's no filtering on any project so you see all the files you have entered in the system. This is for the user that basically goes in the system and decides what type of work to do first. Once he or she decided that step, they will, if needed, pick a file that may or may not belong to a project. Everything depends on what the user feels like doing.

  • The File Management Based Approach:
    This one, you guessed it starts in the file manager, from there, the user can access any and all functions. This is yet another popular metaphore that allows typically quick access to relevant files provided they have been organized accordingly. It would be easy to say create a project fodler, under which a database, text, worksheet, code and other relevant folders are created. to define which application would be used, a simple selection of the appropriate application folder would be all that's needed to defined which application will be used, etc etc. This metaphore, like the 3 other ones is but a different means of accessing the same files as offered in the three other metaphores. A different way of working while still accomplishing the same designated development goals.


THE DEVELOPER'S DESKTOP APPLICATIONS:

The applications will be there typically to help you perform your every day software development tasks. They are full fledge programs that are designed to work together in a highly integrated way to allow you to do everything you need without the need to resorting to other programs. These planned applications will be as follows:

  • Text Processor:
    Text based word processor is a text editor with basic text formatting capabilities. It can create letters, align text and paragraphs, it can create numbered and standard bullets, it can bold and italicize characters and even create basi ctables layouts. It can also work with the spreadsheet and/or database manager to create merging databases and import a table from the spreadsheet right into a table in your document.

  • Spreadsheet:
    Text Based Spreadsheet application. Everyone today should know what a spreadsheet is. If not, well think of a spreadsheet as a big sheet that you can use to do calculations in. The main object is to offer enough functionality to make it very usable to do such things as balance a checkbook, create a budget, maybe create an basic invoice if needed, and other things that can be represented as tabular data.

  • Database Manager:
    Text Based Database Management Application. This particular one is designed to work with a proprietary database system that allows for any type of database to be created. A tool for creating forms to enter the data is also available to give a certain style to your database screens. Unlike most basic integrated packages, this one will allow the combination of mure than one table. Hence doing, for example, an invoicing system with an Invoice Header and Invoice Details table will definitaly be possible.

  • Project Manager:
    Of course, as one of the main engines of Developer's Desktop. Project manager allows you to organize your development projects into phases / task groups / tasks based views. You could of course just work with a simple list of tasks (as a do not forget list so to speak) But as far as project management goes, the use of phases and grouping of tasks can really help create a dependance between tasks as to what should be done before another can begin or let you see what tasks can be done independantly of others (useful when more than one person is working on your project). It of course works on data/time and unless specified otherwise project delays are calculate based on the estimated time entered. A comparison tool will allow you to compare the estimated time versus the actual time to see how you're doing timewise. The Project manage is designed to be used in a fast and easy way and might help a developer more than a developer might realise when used well. It will also have specific features for group based development (as in organizing people working on a project as well as organizing the project itself).

  • Global / Local / Project Agenda Management application:
    Basically, no matter where you are in Developer's Desktop, no matter what you are working on, you can decide to add the current items to the agenda. For example, let's say you're writing a note on a given projet, a letter..and you have to go, but don't wanna forget about that letter. you can throw it on your agenda and it will remind you that you are not finished with the current item. Same goes for anything else you might possibly be doing.

  • Code Editor:
    This is of course a regular text editing program that can work with more than one file at a time in more than one programming language at a time as well. Standard clipboard functionality will exist of course and everything will be configurable on a per language basis so you can call whatever compiler you want for a given language. If you have a VB-DOS project, a freebasic project and other BASIC projects you can do 3 4 BASIC configurations (or more) as needed so each compiler can be accessed easily.

  • Code Librarian:
    Many times you probably end up asking yourself "didn't I do this before on this or that project?" well Code Librarian just might be what you need to find out the answer to that very question. You can organize your code snippets by category of course, but you can also relate code snippets to projects which gives you the ability to search for a particular snipped just about any way you need to to find it quickly and efficiently.

  • The Hierarchal Note Taking Application:
    As you'll quickly learn when you take a look at this application, it offers a means of categorizing notes in a tree that can be defined and customized to your way of thinking. Because of the tree like nature of the notes, it's very easy to define groups and enter relative notes that are designed to make you work faster and better.


THE DEVELOPER'S DESKTOP TOOLS AND UTILITIES:

The utilities are designed to assist you as you are using the applications. As such they are mainly popup tools that appear at the press of a key. You can decide to show and position them on the desktop whever you see fit so they are always available (see the calendar and todo list in the screenshot for an example. Or you could close them all and just press the corresponding key to have them "popup" at will.


  • The Regular, scientific, ribbon based, and developer's calculators:
    Needless to say that each of these calculators offer a different set of functions and calculation possibilities. The developer's calculator will allow, namely to convert between common number bases for example.

  • The NotePad:
    Well, the most simple kind of editor there is. The notepad is designed specifically to take quick notes. As a feature you can adda notepad note to anyhthing you see on the screen and it will stay attached to it as needed.

  • The File Manager:
    A very typical file/folder management application that works as you'd exect such an application to work. with a tree like structure for folderrs and a list of files on the right. it will have the ability to move or copy files around, associate files with programs and/or projects to really organize everything anyway that you like.

Note that other tools will be added as they are thought of or suggested by others. The main goal is to make this project as useful as it can be and as customizable so it can be tailored to anyone and everyone's particular ways of working and organizing their work.



IN CONCLUSION:

So then, this is the list of features, applications and tools that are planned so far for Developer's Desktop. I think so far that it should make it quite a complete and very usable system for developers. It's a work in progress so of course this should change but I think what's there will stay which means that things will be added but not removed from this list.

If you think there's something important that i might have skipped over that you believe MUST be in an application like this one, don't hesitate to send me an email (see my email address below) to let me know. I want Developer's Desktop to be as complete as it possibly can so I'm definitaly opened to suggestions. Until my next article, keep on coding.


MystikShadows
Stéphane Richard
MystikShadows@gmail.com

Hey, this is gonna give some programmers a heart attack

by Chandler

menn actually asked if I wanted 2 write something about QB,FB,and C. I actually did think about this,but since menn will be thrilled,I decided 2 do it.

Now,we have 2 conflicting languages.

BASIC

BASIC has been around 4 awhile. It's how I started. It makes a complete novice able 2 do cool things. There are 2 good choices.

QBasic is an OLD thing 4 DOS.It can run on the oldest of computers. I suggest it when first starting. It's what I did.

FreeBasic originally was really compatible with QB and most progs could be compiled with it. It is Freeware and doesn't have the crappy array limits like QB does. However,it has become more C like. I can handle that,but some don't like it.

C

C is a popular language. People believe it's faster than other languages(and it IS). However,it's also VERY hard 2 learn. I tried it years back,but could NOT get the hang of anything. I got depressed until I found QBasic. After nearly 2 years of programming with QB and FB,I challenged C once again(because of Ben Dellhiem). I actually did OK cause then I had DSL internet. This allowed me 2 find some help on the functions. It is certainly NOT something I suggest a beginner try. You already must know about variables and loops from another language if you wanna do something cool. Also,"printf" is a pain compared 2 "print".

There is the lie that C is platform independant. The C compilers DO have different rules. I've tried like 10 of them. What compiles in 1 compiler won't work in another even if they both run on the same OS. So you can 4get about compiling something on a different OS !

So,if it wasn't 4 C being faster and more popular,I wouldn't mess with it.

Remember,as far as what I prefer 2 use is based on what I want 2 do. I do huge numbers so C is cool cause of it's speed.

If you're doing drawings or ASCII art,QBasic will do fine. FreeBasic is just a ripoff of both languages. QB is the easy thing and C is the fast and hard thing. If you try mixing them,you make BIG sacrifices.

It's like salt and sugar. You can mix them up and people wouldn't know UNTIL THEY TASTE IT!

KRef - A Kriegspiel Referee

by Mac

"Kriegspiel" is a chess variation whereby a player cannot see what the opponent is doing. As such, it is much like war. Hence the name from "krieg" (war) and "spiel" (game). A person with great chess expertise often has no advantage at all over a newbie. Opening moves and end-game knowledge are useless.

Three chessboards are set up: one for each player and one for a referee. The players are positioned so that the referee can see both boards but each player can only see his/her own board.

When a player attempts to make a move, the referee makes the same attempt on the referee's board. If it is legal, both players are simply notified that a legal move was made. If not, the announcement is "not possible" or "illegal". One might also hear "pawn gone" or "piece gone". That is usually a happy surprise for the attacker, although it is not known which piece was taken.

Anyway, the challenge at The QBasic Forum was to come up with a QBasic program that would act as a referee. That would make correspondence play of a Kriegspiel game possible. Well, maybe it was "possible" before, but intolerable. The sequence before KRef would be

1) White tries a move by notifying the referee (another human one
could reach via email, etc.)
2) The referee notifies White that the move is impossible
3) White tries another one
4) The referee notifies White that the move was possible
5) The referee notifies Black that a legal move was made after one call of "impossible"
6) Black tries a move ... etc.

With KRef, the sequence would be

1) White tries moves and is immediately told of possibility, etc. by the QBasic program.
2) When a legal move has been made, White sends the game file to Black
3) Black loads the game and notes the calls that were made.

We met this challenge! Even the complicated problem of guarding against cheating. At least one entire game has been completed by two independent people (Michael Calkins and myself). You are encouraged to find an opponent and play. All information can be found at

http://www.network54.com/Forum/188265/message/1139697499

If you are curious about how a motley crew of 4 could put together a program of this magnitude that NEVER HAD A BUG and thus required NO BETA TEST (first run was perfect), then you could look over the subforum in general.

To follow the development sequence, go to approximately
http://www.network54.com/Forum/188265/page-9

You will see a bunch of separator lines "==============". That is the start of the KRef project.

Or just post questions on the subforum. It is monitored.

NEVER HAD A BUG? Yep. That is, the completed program as specified and modularly developed. But later, I added some "enhancement" patches which, as with all modifications, caused slight problems. The enhancements were to allow games to be replayed at the end so the players could see what happened during the game. In this sense, the KRef.bas referee is superior to a human one which often end with players complaining to the referee that it was impossible to be in the position they were.

At some point, the top-down specification-driven, debug-for-all-cases techniques illustrated in the Kriegspiel Referee project will be described, but for now, just enjoy playing the game - if only to have the pleasure of finding the first bug and making me eat crow!

Don't feel obligated to use Vista

by Kristopher Windsor

...Like most people will. It takes a big company like M$ to create a new standard such as a 3D OS, but I think M$ will suffer from single-handedly forcing this standard more than anticipated.

I'm not surprised at Vista's NTVDM compatibility, though. Xp has a direct link to the command prompt, so it makes sense to keep it. Since the DOS graphics weren't running, I wonder how compatible 2D programs will be, or if there will be a good emulator to run them.

I'm sure many of you would agree with me, though... You wouldn't want to upgrade your current hardware to Vista because that would mean paying M$ to have less performance in 2007 than we have now. And if you buy a new Vista PC, you would keep at least one PC without it, for compatibility with older programs. So if you buy a new PC with Vista, you get upgrades of current programs (I'm sure you're all waiting to buy Office 2007), but if you buy a new Mac instead, you will get all new software, and now maybe even more DOS compatibility. {:-D)

I might switch to Macs; I have all of the Windows software I want. {:-D)

Program Edition

by Corey Yeates

PROGRAM_EDITION

Program edition is a 22kb program made in qbasic, although it is large it is not all one program, instead it is one program holding many of my programs together. Program edition has many extra features that i have added over the time i started created it. It allows you to choose many colors in the beginning for easy to read text. The menu is a quite easy to read with up to 5 programs on each page, so far there is 2 pages. It includes the following programs.

QWord: A nice little program that reminds me of notepad but it is no way near as great.

Mind Maker: A cool little program that gets random answers.

Calculator: A nifty calculator.

Date and Time Displayer: It displays the date and time in a cool little box.

Well there is my main program i have in there. more version of PROGRAM_EDITION is being made.

CLS
COLOR 4
LOCATE 3, 3
PRINT "Loading..."
COLOR 12: FOR a = 1 TO 10
SLEEP 1
LOCATE 3, 3
PRINT LEFT$("Loading...", a);
NEXT a
CLS
COLOR 7
PRINT STRING$(80, "*")
PRINT
LOCATE 3, 30
PRINT "Welcome to....."
PRINT
PRINT STRING$(80, "*")
SLEEP 2
CLS
PRINT STRING$(80, "*")
PRINT
LOCATE 3, 30
PRINT "PROGRAM EDITION"
PRINT
PRINT STRING$(80, "*")
SLEEP 2
CLS
PRINT "There is many programs in this one compact program."
PRINT "Ideas come from MIND MAKER QBASIC VERSION1.0 and MIND MAKER QBASIC VERSION 1.1."
PRINT "Which you can find a copy of at http://geocities.com/coreyyeates/index.html"
PRINT "Also you can E-MAIL me at runescape_rune_man@hotmail.com"
PRINT
PRINT "Press <c> to continue."
DO
LOOP UNTIL INKEY$ = "c"
CLS
PRINT
colo: PRINT "COLOR MENU:"
PRINT
COLOR 12
PRINT "(b)right red"
COLOR 10
PRINT "(L)ime"
COLOR 13
PRINT "(p)ink"
COLOR 7
PRINT "(g)ray"
COLOR 15
PRINT "(w)hite"
COLOR 1
PRINT "(d)ark blue"
COLOR 3
PRINT "(c)olor, blueish green"
COLOR 7
DO
i$ = INKEY$
LOOP UNTIL ((i$ = "c") OR (i$ = "b") OR (i$ = "d") OR (i$ = "l") OR (i$ = "p") OR (i$ = "g") OR (i$ = "w"))
IF i$ = "b" THEN GOTO red
IF i$ = "l" THEN GOTO lime
IF i$ = "p" THEN GOTO pink
IF i$ = "g" THEN GOTO grey
IF i$ = "w" THEN GOTO white
IF i$ = "d" THEN GOTO blue
IF i$ = "c" THEN GOTO green
red: COLOR 12: GOTO mmenu
lime: COLOR 10: GOTO mmenu
pink: COLOR 13: GOTO mmenu
grey: COLOR 7: GOTO mmenu
white: COLOR 15: GOTO mmenu
blue: COLOR 1: GOTO mmenu
green: COLOR 3: GOTO mmenu
mmenu: CLS
PRINT "PROGRAM MENU:"
PRINT
PRINT "MIND MAKER VERSION 1.1"
PRINT "A program designed for picking random YES/NO answers"
PRINT "NUMBER 1"
PRINT STRING$(80, "#")
PRINT "DATE AND TIME DISPLAYER"
PRINT "A simple little program that displays the date and time"
PRINT "NUMBER 2"
PRINT STRING$(80, "#")
PRINT "CALCULATOR"
PRINT "A simple designed calculator"
PRINT "NUMBER 3"
PRINT STRING$(80, "#")
PRINT "QWORD"
PRINT "A text based program"
PRINT "NUMBER 4"
PRINT STRING$(80, "#")
PRINT "END"
PRINT "Ends the program"
PRINT "NUMBER 5"
PRINT STRING$(80, "#")
PRINT "NUMBER 6 Next page"
INPUT "Enter the number of the choice: "; a
SELECT CASE a
CASE 6
CLS
sm: CLS
PRINT "PROGRAM MENU(Page two):"
PRINT
PRINT "COLOR CHANGE"
PRINT "Allows you to change the color."
PRINT "NUMBER 1"
PRINT STRING$(80, "#")
PRINT
PRINT "HELP"
PRINT "Help menu"
PRINT "NUMBER 2"
PRINT STRING$(80, "#")
PRINT
PRINT "NUMBER AND TEXT"
PRINT "Tells you number and text code/number."
PRINT "NUMBER 3"
PRINT STRING$(80, "#")
PRINT
PRINT "ASCII TABLE"
PRINT "Shows you the number and what an ascii chr is."
PRINT "NUMBER 4"
PRINT STRING$(80, "#")
PRINT
PRINT "COMPASS MATHS"
PRINT "A mathmatical game."
PRINT "NUMBER 5"
PRINT STRING$(80, "#")
PRINT
PRINT "NUMBER 6 Previous page"
PRINT
INPUT "Enter the number of the choice: "; b
SELECT CASE b
CASE 6
GOTO mmenu
CASE 5
CLS
score = 0
life = 3
      'n + Y
b = 4
c = 8
     'e  - Y
d = 5
e = 2
     's  /
f = 9
g = 3
     'w  * Y
h = 3
i = 9
     'ne + Y
j = 7
k = 4
     'se - Y
l = 9
m = 4
     'sw / Y
n = 81
o = 9
     'nw * Y
p = 9
q = 6
CLS
PRINT
PRINT "###########################################################"
PRINT "########################.##################################"
PRINT "########################.#.################################"
PRINT "######################.#.#..###############################"
PRINT "#####################..#.#...######################....####"
PRINT "####################...#.#....####################......###"
PRINT "########################.########################..##....##"
PRINT "########################.########################..###....#"
PRINT "###########............................##############.....#"
PRINT "############..........................##############......#"
PRINT "#############........................##############.......#"
PRINT "#.##..##..## #......................#..##..##..###........#"
PRINT "##..##..##..###########################..##..##...........#"
PRINT "###########################################################"
SLEEP 1
CLS
PRINT
PRINT "###########################################################"
PRINT "########################.##################################"
PRINT "########################.#.################################"
PRINT "######################.#.#..###############################"
PRINT "#####################..#.#...#####################....#####"
PRINT "####################...#.#....##################.......####"
PRINT "########################.######################...##....###"
PRINT "########################.######################...###...###"
PRINT "###########............................##############...###"
PRINT "############..........................##############....###"
PRINT "#############........................##############.....###"
PRINT "#.##..##..##.#......................#..##..##..###......###"
PRINT "##..##..##..###########################..##..##.........###"
PRINT "###########################################################"
SLEEP 1
CLS
PRINT
PRINT "###########################################################"
PRINT "################################.##########################"
PRINT "###############################..##########################"
PRINT "##############################....#########################"
PRINT "#############################......########################"
PRINT "############################........#######################"
PRINT "#############################........######################"
PRINT "##############################..............###############"
PRINT "###############################........#####.##############"
PRINT "################################........#####.#############"
PRINT "#################################........#####.############"
PRINT "#.##..##..##..##..##..##..##..#..##########..###..##..##.#"
PRINT "##..##..##..##..##..##..##..##..#############..###..##..###"
PRINT "###########################################################"
SLEEP 1
PRINT "W E L C O M E   T O..."
SLEEP 2
PRINT "C O M P A S S   M A T H!"
mini: SLEEP 3
CLS
LOCATE 1, 30
PRINT "score: "; score
LOCATE 1, 57
PRINT "Lives: "; life
LOCATE 1, 1
PRINT "NW  N  NE"
PRINT "  \ | /  "
PRINT "W-------E"
PRINT "  / | \  "
PRINT "SW  S  SE"
PRINT
PRINT "To end, enter <q>"
INPUT "Enter in DIRECTION: "; a$
SELECT CASE a$

CASE "q"
PRINT
PRINT "Thanks for playing compass maths."
PRINT
PRINT "T O T A L   S C O R E   I S   "; score
PRINT
PRINT "T O T A L   L I V E S   A R E   "; life
SLEEP 5
GOTO sm

CASE "n"
PRINT b; "+"; c
INPUT ""; a
IF a = b + c THEN
PRINT "Correct"
PRINT "You Survive The Wave."
score = score + 5
c = c + c
b = b + b
ELSE
PRINT "Wrong"
PRINT "You Lose A Man From The Impact Of The Wave."
life = life - 1
IF life = 0 THEN GOTO en
END IF
GOTO mini

CASE "e"
PRINT d; "-"; e
INPUT ""; a
IF a = d - e THEN
PRINT "Correct"
PRINT "You Survive The Wave."
score = score + 5
d = d + d
e = e + e
ELSE
PRINT "Wrong"
PRINT "You Lose A Man From The Impact Of The Wave."
life = life - 1
IF life = 0 THEN GOTO en
END IF
GOTO mini

CASE "s"
PRINT f; "divide"; g
INPUT ""; a
IF a = f / g THEN
PRINT "Correct"
PRINT "You Survive The Wave."
score = score + 5
f = f + f
g = g + g
ELSE
PRINT "Wrong"
PRINT "You Lose A Man From The Impact Of The Wave."
life = life - 1
IF life = 0 THEN GOTO en
END IF
GOTO mini

CASE "w"
PRINT h; "X"; i
INPUT ""; a
IF a = h * i THEN
PRINT "Correct"
PRINT "You Survive The Wave."
score = score + 5
h = h + h
i = i + i
ELSE
PRINT "Wrong"
PRINT "You Lose A Man From The Impact Of The Wave."
life = life - 1
IF life = 0 THEN GOTO en
END IF
GOTO mini

CASE "ne"
PRINT j; "+"; k
INPUT ""; a
IF a = j + k THEN
PRINT "Correct"
PRINT "You Survive The Wave."
score = score + 5
j = j + j
k = k + k
ELSE
PRINT "Wrong"
PRINT "You Lose A Man From The Impact Of The Wave."
life = life - 1
IF life = 0 THEN GOTO en
END IF
GOTO mini

CASE "se"
PRINT l; "-"; m
INPUT ""; a
IF a = l - m THEN
PRINT "Correct"
PRINT "You Survive The Wave."
score = score + 5
l = l + l
m = m + m
ELSE
PRINT "Wrong"
PRINT "You Lose A Man From The Impact Of The Wave."
life = life - 1
IF life = 0 THEN GOTO en
END IF
GOTO mini

CASE "sw"
PRINT n; "divide"; o
INPUT ""; a
IF a = n / o THEN
PRINT "Correct"
PRINT "You Survive The Wave."
score = score + 5
n = n + n
o = o + o
ELSE
PRINT "Wrong"
PRINT "You Lose A Man From The Impact Of The Wave."
life = life - 1
IF life = 0 THEN GOTO en
END IF
GOTO mini

CASE "nw"
PRINT p; "X"; q
INPUT ""; a
IF a = p * q THEN
PRINT "Correct"
PRINT "You Survive The Wave."
score = score + 5
p = p + p
q = q + q
ELSE
PRINT "Wrong"
PRINT "You Lose A Man From The Impact Of The Wave."
life = life - 1
IF life = 0 THEN GOTO en
END IF
GOTO mini
END SELECT

en: CLS
LOCATE 1, 30
PRINT "score: "; score
LOCATE 1, 57
PRINT "Lives: "; life
LOCATE 1, 1
PRINT "NW  N  NE"
PRINT "  \ | /  "
PRINT "W-------E"
PRINT "  / | \  "
PRINT "SW  S  SE"
PRINT
PRINT "G A M E   O V E R"
PRINT
PRINT "T O T A L   S C O R E   I S   "; score
SLEEP 5
GOTO sm
CASE 4
CLS
top: FOR a = 1 TO 100
PRINT a; ":"; CHR$(a); " ";
NEXT a
PRINT
INPUT "1: next page 2:end 3:back to main menu: "; a%
IF a% = 2 THEN END
IF a% = 1 THEN
IF a% = 3 THEN GOTO sm
CLS
FOR b = 100 TO 255
PRINT b; ":"; CHR$(b); " ";
NEXT b
PRINT
INPUT "1: previous page 2:end 3:back to main menu: "; a%
IF a% = 1 THEN GOTO top
IF a% = 2 THEN END
IF a% = 3 THEN GOTO sm
END IF
CASE 3
CLS
men: CLS
PRINT "TEXT/NUMBER"
PRINT
PRINT "1: Amount of letters."
PRINT "2: Letter to Number."
PRINT "3: Number to letter."
PRINT
INPUT "What choice: "; b
SELECT CASE b
CASE 1
INPUT "Type in a word to find how long it is: "; a$
PRINT
PRINT
PRINT "The length of the word is: "; LEN(a$)
PRINT
PRINT "1: Back to main menu"
PRINT "2: TEXT/NUMBER menu"
PRINT "3: End"
INPUT "Enter number of choice: "; z
IF z = 1 THEN GOTO sm
IF z = 2 THEN GOTO men
IF z = 3 THEN END
CASE 2
INPUT "type in 1 letters: "; c$
PRINT
PRINT
PRINT "The number of that charecter/s is: "; ASC("c$")
PRINT "1: Back to main menu"
PRINT "2: TEXT/NUMBER menu"
PRINT "3: End"
INPUT "Enter number of choice: "; z
IF z = 1 THEN GOTO sm
IF z = 2 THEN GOTO men
IF z = 3 THEN END
CASE 3
INPUT "Type in a number between (1-255): "; d
PRINT
PRINT
PRINT "That number makes: "; CHR$(d)
PRINT "1: Back to main menu"
PRINT "2: TEXT/NUMBER menu"
PRINT "3: End"
INPUT "Enter number of choice: "; z
IF z = 1 THEN GOTO sm
IF z = 2 THEN GOTO men
IF z = 3 THEN END
END SELECT
CASE 1
PRINT "COLOR MENU:"
PRINT
COLOR 12
PRINT "(b)right red"
COLOR 10
PRINT "(L)ime"
COLOR 13
PRINT "(p)ink"
COLOR 7
PRINT "(g)ray"
COLOR 15
PRINT "(w)hite"
COLOR 1
PRINT "(d)ark blue"
COLOR 3
PRINT "(c)olor, blueish green"
COLOR 7
DO
i$ = INKEY$
LOOP UNTIL ((i$ = "c") OR (i$ = "b") OR (i$ = "d") OR (i$ = "l") OR (i$ = "p") OR (i$ = "g") OR (i$ = "w"))
IF i$ = "b" THEN GOTO reds
IF i$ = "l" THEN GOTO limes
IF i$ = "p" THEN GOTO pinks
IF i$ = "g" THEN GOTO greys
IF i$ = "w" THEN GOTO whites
IF i$ = "d" THEN GOTO blues
IF i$ = "c" THEN GOTO greens
reds: COLOR 12: GOTO sm
limes: COLOR 10: GOTO sm
pinks: COLOR 13: GOTO sm
greys: COLOR 7: GOTO sm
whites: COLOR 15: GOTO sm
blues: COLOR 1: GOTO sm
greens: COLOR 3: GOTO sm
CASE 6
END
CASE 2
CLS
mh: CLS
PRINT "HELP"
PRINT
PRINT "Welcome to the help file where you can fins your question and get a full answer to it."
PRINT
PRINT "Help menu"
PRINT
PRINT "1: How to answer question like the main menu."
PRINT "2: How to answer questiong like (m)enu."
PRINT "3: Using the calculator."
PRINT "4: Using the MIND MAKER 1.1."
PRINT "5: Using the QWord."
PRINT "6: end"
PRINT "7: menu"
PRINT
INPUT "Enter the number of your choice: "; t
SELECT CASE t
CASE 7
GOTO sm
CASE 6
END
CASE 1
CLS
PRINT "How to answer question like the main menu."
PRINT
PRINT "It is very simple how to use that part of the program."
PRINT "All you need to remember is that if there is a question like that just simply"
PRINT "type the number/letter of the choice you want."
PRINT "E.G: Enter the number of your choice: ?4"
PRINT "$ being the choice means that the program will take you to where that is."
PRINT
PRINT "(h)elp menu"
PRINT "(e)nd"
DO
LOOP UNTIL ((INKEY$ = "h") OR (INKEY$ = "e"))
IF INKEY$ = "e" THEN END
IF INKEY$ = "h" THEN GOTO help
CASE 2
PRINT "How to answer question like (m)enu"
PRINT
PRINT "It is simple to answer these questions."
PRINT "All you need to remember is this:"
PRINT "Whatever is middle of the () is the letter you press on the keyboard."
PRINT "Then it will take you to where you need to goto."
PRINT
PRINT "(h)elp menu"
PRINT "(e)nd"
DO
LOOP UNTIL ((INKEY$ = "h") OR (INKEY$ = "e"))
IF INKEY$ = "h" THEN GOTO help
IF INKEY$ = "e" THEN END
help: GOTO mh
hs: GOTO sm
CASE 3
PRINT "Using the calculator"
PRINT
PRINT "The way you use the calculator is simply by doing:"
PRINT "first: choosing your problem you wish to use E.G addition Ect"
PRINT "secondly: Type in you first number you wish to use."
PRINT "Thirdly: type in you second number you wish to use."
PRINT "Fourth: just use the menu to do it again or leave."
PRINT
PRINT "(h)elp menu"
PRINT "(e)nd"
DO
LOOP UNTIL ((INKEY$ = "m") OR (INKEY$ = "e"))
IF INKEY$ = "e" THEN END
IF INKEY$ = "h" THEN GOTO help
CASE 4
PRINT "Using the MIND MAKER 1.1"
PRINT
PRINT "To use MIND MAKER 1.1 just press the button it says and follow the instructions."
PRINT
PRINT "(h)elp menu"
PRINT "(e)nd"
DO
LOOP UNTIL ((INKEY$ = "h") OR (INKEY$ = "e"))
IF INKEY$ = "h" THEN GOTO help
IF INKEY$ = "e" THEN END
CASE 5
PRINT "Using QWord"
PRINT
PRINT "All you need to do is follow all the instructions in qword."
PRINT "There is some helpers in qword already."
PRINT
PRINT "(h)elp menu"
PRINT "(e)nd"
DO
LOOP UNTIL ((INKEY$ = "h") OR (INKEY$ = "e"))
IF INKEY$ = "e" THEN END
IF INKEY$ = "h" THEN GOTO help
END SELECT
END SELECT
CASE 5
END
CASE 3
CLS
PRINT "CALCULATOR"
PRINT
PRINT
GOTO mo
menu: CLS
mo: PRINT "MENU OF PROBLEMS"
PRINT
PRINT "(d)ivision"
PRINT
PRINT "(m)ultiplication"
PRINT
PRINT "(a)ddition"
PRINT
PRINT "(s)ubtraction"
INPUT "Enter the first letter of the problem"; a$
SELECT CASE a$
CASE "a"
a: CLS
PRINT "ADDITION"
PRINT
INPUT "How many number will you use: "; b
DIM a(b)
FOR c = 1 TO b
PRINT "Enter number"; c
INPUT a(c)
d = d + a(c)
NEXT
PRINT "Total is "; d
PRINT
PRINT "(b)ack to menu"
PRINT "(m)ain menu"
PRINT "(e)nd"
PRINT "(a)gain"
DO
LOOP UNTIL ((INKEY$ = "a") OR (INKEY$ = "b") OR (INKEY$ = "m") OR (INKEY$ = "e"))
IF INKEY$ = "a" THEN GOTO a
IF INKEY$ = "b" THEN GOTO menu
IF INKEY$ = "m" THEN GOTO e
IF INKEY$ = "e" THEN END
CASE "s"
s: CLS
PRINT "SUBTRACTION"
PRINT
INPUT "How many number will you use: "; b
DIM a(b)
FOR c = 1 TO b
PRINT "Enter number"; c
INPUT a(c)
d = d - a(c)
NEXT
PRINT "Total is "; d
PRINT
PRINT "(b)ack to menu"
PRINT "(m)ain menu"
PRINT "(e)nd"
PRINT "(a)gain"
DO
LOOP UNTIL ((INKEY$ = "a") OR (INKEY$ = "b") OR (INKEY$ = "m") OR (INKEY$ = "e"))
IF INKEY$ = "a" THEN GOTO s
IF INKEY$ = "b" THEN GOTO menu
IF INKEY$ = "m" THEN GOTO e
IF INKEY$ = "e" THEN END
CASE "m"
m: CLS
PRINT "MULTIPLICATION"
PRINT
INPUT "How many number will you use: "; b
DIM a(b)
FOR c = 1 TO b
PRINT "Enter number"; c
INPUT a(c)
d = d * a(c)
NEXT
PRINT "Total is "; d
PRINT
PRINT "(b)ack to menu"
PRINT "(m)ain menu"
PRINT "(e)nd"
PRINT "(a)gain"
DO
LOOP UNTIL ((INKEY$ = "b") OR (INKEY$ = "a") OR (INKEY$ = "m") OR (INKEY$ = "e"))
IF INKEY$ = "a" THEN GOTO m
IF INKEY$ = "b" THEN GOTO menu
IF INKEY$ = "m" THEN GOTO e
IF INKEY$ = "e" THEN END
CASE "d"
d: CLS
PRINT "DIVISION"
PRINT
INPUT "How many number will you use: "; b
DIM a(b)
FOR c = 1 TO b
PRINT "Enter number"; c
INPUT a(c)
d = d / a(c)
NEXT
PRINT "Total is "; d
PRINT
PRINT "(b)ack to menu"
PRINT "(m)ain menu"
PRINT "(e)nd"
PRINT "(a)gain"
DO
LOOP UNTIL ((INKEY$ = "a") OR (INKEY$ = "b") OR (INKEY$ = "m") OR (INKEY$ = "e"))
IF INKEY$ = "a" THEN GOTO d
IF INKEY$ = "b" THEN GOTO menu
IF INKEY$ = "m" THEN GOTO e
IF INKEY$ = "e" THEN END
CASE ELSE
CLS
PRINT "Wrong Choice"
END SELECT
e: GOTO mmenu
CASE 1
RANDOMIZE TIMER
CLS
'MIND MAKER IS COPYRIGHTED COREY 2006 - 2007
'QBASIC VERSION
'MIND MAKER QBASIC VERIONS 1.0
'-----------------------------------------
'-----------------------------------------
i$ = INKEY$
PRINT "MIND MAKER"
PRINT
PRINT "Press space to continue."
DO
LOOP UNTIL INKEY$ = " "
CLS
PRINT "This is one of unknown copys of MIND MAKER qbasic verion 1.0"
PRINT "No copy of this program can be made or placed on sites without permission."
PRINT "Thanks you"
PRINT
PRINT "Press space to continue."
DO
LOOP UNTIL INKEY$ = " "
beg: CLS
PRINT "Think of a YES or NO question and PRESS SPACE"
DO
LOOP UNTIL INKEY$ = " "
CLS
a = INT(RND * 12) + 1
SELECT CASE a
CASE 1
PRINT "Yes"
CASE 2
PRINT "No"
CASE 3
PRINT "Hell no"
CASE 4
PRINT "Of course"
CASE 5
PRINT "defintely"
CASE 6
PRINT "Always"
CASE 7
PRINT "Ask again"
CASE 8
PRINT "Never"
CASE 9
PRINT "Absolutely"
CASE 10
PRINT "Why not"
CASE 11
PRINT "Sorry did not hear your thought"
CASE 12
PRINT "Yep"
CASE 13
PRINT "If you think so"
END SELECT
PRINT
PRINT "Thank you for using Corey Y's program"
PRINT
PRINT "(t)ry again"
PRINT "(e)xit"
PRINT "(m)enu"
DO
i$ = INKEY$
LOOP UNTIL ((i$ = "t") OR (i$ = "e") OR (i$ = "m"))
IF i$ = "t" THEN GOTO beg
IF i$ = "e" THEN END
IF i$ = "m" THEN GOTO mmenu
CASE 2
CLS
PRINT "TIME AND DATE DISPLAYER"
PRINT
clo: DO
CLS
PRINT "Press <s> to stop the clock"
PRINT
PRINT "*************************"
PRINT "*          *            *"
PRINT "*   Time:  *   Date:    *"
PRINT "*          *            *"
PRINT "*          *            *"
PRINT "* "; TIME$; " * "; DATE$; " *"
PRINT "*          *            *"
PRINT "*************************"
SLEEP 1
LOOP UNTIL INKEY$ = "s"
PRINT
PRINT "(m)enu"
PRINT "(e)nd"
PRINT "(s)tart the clock again"
DO
i$ = INKEY$
LOOP UNTIL ((INKEY$ = "m") OR (INKEY$ = "e") OR (INKEY$ = "s"))
IF INKEY$ = "e" THEN END
IF INKEY$ = "m" THEN GOTO e
IF INKEY$ = "s" THEN GOTO cl
cl: GOTO clo
CASE 4
CLS
PRINT STRING$(80, "~")
PRINT STRING$(80, "~")
PRINT
PRINT "Press Space To Continue"
PRINT
PRINT STRING$(80, "~")
PRINT STRING$(80, "~")
DO
in$ = INKEY$
LOOP UNTIL ((in$ = " "))
CLS
PRINT
PRINT "QWord"
PRINT "~-~-~"
PRINT "This Was Made By <Corey Yeates><Aged:11><New Zealand>"
PRINT "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
PRINT "This Is A Very Basic Word Program."
PRINT "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
GOSUB mm
me: CLS
mm:
PRINT "(i)nstructions"
PRINT "(c)ontinue"
PRINT "(e)xit"
PRINT "(m)ain menu"
DO
in$ = INKEY$
LOOP UNTIL ((in$ = "i") OR (in$ = "m") OR (in$ = "c") OR (in$ = "e"))
IF in$ = "m" THEN GOTO e
IF in$ = "i" THEN GOSUB pg1
IF in$ = "c" THEN GOSUB c
IF in$ = "e" THEN END
pg1: CLS
PRINT "Instrutions sheet PG1"
PRINT
PRINT "QWord"
PRINT
PRINT
PRINT "Moving around:"
PRINT "To move around PRESS what the KEY it says to PRESS."
PRINT
PRINT "Entering text:"
PRINT "Enter text just like entering it in NOTEPAD."
PRINT
PRINT "Running out of space to type:"
PRINT "If you run out of space PRESS the KEY it says to make more space."
PRINT
PRINT "Choosing:"
PRINT "APPEND version is to add more to the last note you made."
PRINT "OUTPUT version is to delete and start again with you note space."
PRINT
PRINT "(n)ext"
PRINT "(b)ack to menu"
PRINT "(e)xit"
DO
in$ = INKEY$
LOOP UNTIL ((in$ = "n") OR (in$ = "b") OR (in$ = "e"))
IF in$ = "n" THEN GOSUB pg2
IF in$ = "b" THEN GOSUB me
IF in$ = "e" THEN END
pg2: CLS
PRINT "QWord"
PRINT
PRINT "Information About:"
PRINT "QWord"
PRINT
PRINT "Version 1.0"
PRINT "2006"
PRINT "10/06/06"
PRINT
PRINT "(p)revious"
PRINT "(b)ack to menu"
PRINT "(e)xit"
DO
in$ = INKEY$
LOOP UNTIL ((in$ = "p") OR (in$ = "b") OR (in$ = "e"))
IF in$ = "p" THEN GOSUB pg1
IF in$ = "b" THEN GOSUB me
IF in$ = "e" THEN END
c: CLS
PRINT "(o)UTPUT"
PRINT "(a)PPEND"
PRINT "(v)iew last added note"
PRINT "(e)xit"
PRINT "(m)ain menu"
DO
in$ = INKEY$
LOOP UNTIL ((in$ = "o") OR (in$ = "m") OR (in$ = "a") OR (in$ = "v") OR (in$ = "e"))
IF in$ = "o" THEN GOTO oput
IF in$ = "a" THEN GOTO apnd
IF in$ = "v" THEN GOTO vw
IF in$ = "e" THEN END
IF in$ = "m" THEN GOTO e
oput:
OPEN "note.txt" FOR OUTPUT AS #1
PRINT "When finished/ran out of space PRESS enter."
INPUT "Enter Text Here: "; text$
PRINT "(f)inish"
PRINT "(m)ore"
DO
in$ = INKEY$
LOOP UNTIL ((in$ = "f") OR (in$ = "m"))
IF in$ = "f" THEN GOSUB fin
IF in$ = "m" THEN GOSUB med
fin: PRINT #1, text$
CLOSE #1
GOSUB menu
PRINT #1, text$
med:
CLOSE #1
OPEN "note.txt" FOR APPEND AS #1
INPUT "More Text Here: "; text$
PRINT #1, text$
PRINT "(b)ack to menu"
PRINT "(m)ore"
CLOSE #1
DO
in$ = INKEY$
LOOP UNTIL ((in$ = "b") OR (in$ = "m"))
IF in$ = "b" THEN GOSUB me
IF in$ = "m" THEN GOSUB med
apnd:
OPEN "note.txt" FOR APPEND AS #1
mor:
INPUT "Add more to your notes: "; text$
PRINT "(m)ore"
PRINT "(f)inish"
PRINT #1, text$
CLOSE #1
DO
in$ = INKEY$
LOOP UNTIL ((in$ = "m") OR (in$ = "f"))
IF in$ = "m" THEN GOSUB mor
IF in$ = "f" THEN GOSUB me
vw: OPEN "note.txt" FOR INPUT AS #1
INPUT #1, text$
PRINT text$
CLOSE #1
PRINT "(b)ack to menu"
PRINT "(e)xit"
PRINT "(t)he main menu"
DO
in$ = INKEY$
LOOP UNTIL ((in$ = "b") OR (in$ = "t") OR (in$ = "e"))
IF in$ = "b" THEN GOSUB me
IF in$ = "e" THEN END
IF in$ = "t" THEN GOTO e
END SELECT

You can also visit my site at:
http://geocities.com/qbasic50/index.html

Lynn's Legacy: The Review

by MystikShadows

ABOUT THE GAME:

Lynn's Legacy is one of the newest games created by none other than chaOs and Josia Tobin. The game features some very original artwork, excellent sound tracks and really reflects so great quality coding, the kind I've come to expect from chaOs and Josia. Just to get you curious, I've assembled some screenshots right here. Note that I've kept it to basic screenshots to keep you curious, if you want to see more (and there is a whole lot more to see) go ahead and play the game.


 

 

 


I don't know about you, but I think these screenshots (and the rest of the game) pretty much speak for themselves, You can tell right here how much quality Lynn's Legacy is all about. But you don't have to take my word for it. Just have a look at This thread on FreeBasic.net to hear what many others had to say. And then to really make your own mind up, get the game and play it. The game features some simple keyboard and/or gamepad usage that makes it easy to just sit down and play it.

THE LYNN'S LEGACY REVIEW:

As with all my reviews, the game will be reviewed based on my regular specific characteristics when evaluating a game. These characteristics are:

  • Playability:
    Basically, how long it takes before you can efficiently play the game. Some games will require you to learn alot of key combinations and different things like that before you can do everything in the game. Some games are worth the learning too. But not all of them.

  • Replay Value:
    This is the ability for a game to keep you coming back for more. Sometimes you'll notice you should have taken something at the beginning of the game that you didn't. Also, some games will hide things from you, make it hard to even know they are there. Next time around you'll want to make sure you don't miss a thing. These kind of things (and the simple urge to do better next time) are part of the "replay value" of the game.

  • Overall Entertainment:
    Well this encompasses everything about the game, the combination of great graphics (or screen designs), sound and music, coherence in story and adventure to form a package that's worth playing from start to end. This defines the overall entertainment of a game.

  • Technical Features: This part essentially covers how well the game was coded (not by looking at the source code but basically how much effort into the source it must have taken to bring out the game as we see and play it).

So then, without waiting any longer, let's begin the review of this newly released game that is Lynn's Legacy:


PLAYABILITY: 9/10

Lynn's Legacy, being a classic Zelda inspired game has some pretty simple means of letting the user play the game. Everything can be controlled either from the keyboard or (newly added feature) from a gamepad joystick. There's no complicated keyboard combinations to learn and remember, the gameplay is therefore simple and quick to get into. For this reason, Lynn's Legacy gets a 9 out of 10.

REPLAY VALUE: 10/10

There's something to be said about this "genre" of game. Still today I hear about people playing Zelda (the classic version even). Games like these just keep you coming back for more by definition almost. Add to that the beautiful graphics, exquisite sound and music, a good story line with a good couple humoristic twists and you have yourself a perfect combination to just keep on playing. For this reason, a perfect 10 out of 10 on replay value is more than warranted.

OVERALL ENTERTAINMENT: 8/10

Ok, so the game might not have the flashy OpenGL 3D visual aspects. But as I mentionned before, a game should be reviewed based on the type of game it is. As far as games in the "genre" of Lynn's legacy, it offers some very unique combination of fights, humor, story, excellent graphics, smooth scrolling, and you name it. Everything just seems to fit together. But even if you take all that eye candy out, Lynn's legacy texts alone are entertaining. For that reason, I give it an 8 out of 10 on overall entertainment.

TECHNICAL VALUE: 9/10

As far as gaming goes, Lynn's Legacy features some great technological savy. Game saving right in the game's graphics, good pixel collision, smooth stable graphics and game play. I can only imagine the kind of small scale wizardry it must have taken to bring all this together this well to bring us a game like Lynn's Legacy. chaOs and Josia Tobin really deserve a great pat on the back to say the least. They also prove that great teamwork can accomplish some great things. For those reasons I give Lynn's Legacy a 9 out of 10 for it's technical value.


THE FINAL VERDICT: 36/40 (90%)

What can I say. The best way to review the game for yourself is to sit down and play it. And after, if you can manage to pry yourself off of the game you'll see for yourself just how good Lynn's Legacy is. You'll see that the comments made on that forum thread I posted above are simply not exagerated. Lynn's Legacy is a great entertaining game that deserves every bit of any credit that are given to it. The developers of that game get my two thumbs up.

If you want to play the game for yourself, you can get it from
this location. Go there, download it, play it and you'll see just how well put together that game is on all aspects of game design and development. Definitaly worth your download and installation time. This is MystikShadows closing this review by saying "PLAY ON!".


MystikShadows
Stéphane Richard
MystikShadows@gmail.com

3D Explanations & Simulations:
From A to Z and from the 3 to D

by Aroticoz

Note: These will be series, in the parts I will go into explaining both simple and complex how 3D simulations work, and how to achieve them, from simple object placing to shadows and reflections. Throughout the series I will also include ready BASIC code examples of how things work. Have fun reading.

The Basics

I will start this article with an explanation of the very base of 3D. First off, what does 3D mean? Well 3D is short of 3 dimensions. We (with our two eyes) can see 3 dimensional picture, this means that we can distinguish if two or many more objects are placed (from our point of view) one in front of other, or one over other, or one next to other, or combinations of these cases. I won't go into explaining the coordinate system, if you don't know what it is try here:
http://en.wikipedia.org/wiki/Cartesian_coordinate_system Here is how the coordinate system will look like throughout the whole article:

Perspective

The perspective is probably both the hardest thing to understand and the easiest one. Under perspective trough this article you should understand the changing of the objects forms depending on their position in relation to the view point. In other words how objects look in different positions but from one point of view.

There are many types of perspective you can find in art and 3d simulation, but the type I love the most and I believe is most widely used is the "One Point Perspective". The idea of the OPP(One Point Perspective) is that when you look in direction, no matter how big an object will be, at some point in the distance it will look like a dot(point), and in the distance all objects "go to" that point. Here is something that will make it more clear:

    

I hope this is clear enough. Now, the small dot you see is the point of perspective, as you can see the objects "lean" to it in the distance. Note that the point of perspective can be anywhere, although it's most realistic and easiest to put in the center of the screen and far, far away from the point of view on the Z axis. Basically, The more in depth the point of perspective is the more realistic things are. In real life your point of perspective is on the horizon. Of course depending on the way things are displayed on the screen the point of perspective could need to be closer or more distant, but only in very rare cases it's not in the center. These cases are most likely because of special "deforming" needs of the look to achieve some effect. Now, in the first 2 drawings we see the same object in different places and is show how it will deform depending on the point of perspective. As you can see I have put it "out" of the "screen" so that the object in it's length does not reach the point of perspective. In the third picture however I have put the point in the middle of the "screen", and far away form the viewer, the 3 objects are different length, different positions, and you can easily see how their shapes differ because of the perspective.

Short said, the perspective is how all objects appear depending of our point of view.


The 3D Engines

First I will talk a little about ready 3D libs like OpenGL. These libs have ready algorithms to calculate and simulate perspective, and as far say I know you could have a really hard time changing the point of perspective in OpenGL generated simulations. However, OpenGL and other libs offer only the basic calculations and the main part has to be done by the author. This requires knowledge of trigonometry, stereometry and basic maths. Of course all this is learned at school and just needs to be used.

Now if you would go to making your own 3D engine from scratch you will need to find your own algorithms to simulate perspective. The easiest way is to put your point of perspective say 100 units away form the view point, and simply make objects smaller if the near it, like getting 1/100 smaller on every unit they move back. This is of course the simplest way of making it, and not very effective. You also would have to find a way to make the objects "lean" to your point of perspective in the distance, in the next part I will throw in some simple formulas you could use to achieve that effect.


In conclusion

I would say that perspective is one of the most important things in 3D simulations because it is the first thing that you see, and it makes a big impact on the whole picture. I would say experiment with the perspectivity until you see what you want, the only way to achieve almost perfect perspective simulation is trial and error.

Well with this the first part of the series comes to an end, in it we saw the basics of the perspective. In the next part we will go deeper into simulating perspective and see couple of example programs, we will learn some neat tricks and illusions that come with it. Also we will get into the basics of light simulating.

Windows A.P.I. - A Complete Study
Part One - A.P.I. Basics

by MystikShadows

INTRODUCTION:

Welcome to this series on developing using the Windows A.P.I. (Application Program Interface). This will be a series as mentionned because there is a whole lot of grounds to cover in order to become proficient in the art of using the Windows A.P.I. IT's a little more complicated than alot of windows theory, but as far as Windows development is concerned, the API gives you a tool to access windows resources and services in the most optimal possible way.

In this first part, we'll give you some background information on the A.P.I. which DLL are used for what purpose, give you some theory and reference material that you can use, along with useful links, to prepare you as you venture into the many mysteries of this infamous Windows A.P.I. and all it's functionalities. So sit yourself down, grap a cup of your favorite drink and let's get started.

WHAT DOES WHAT?

The API is a big world however it has been divided into more than one file, which makes it a bit more reachable to the common mortals that we are. If it wasn't, the DLL would have been way too big in size. So let's take a look here at these API files and give you a description of what they are and what the give in functionality.

  • File, Memory, Process, Threading, Time, Console, and Comm control(kernel32.dll)
    This is one of the main Windows DLL (Dynamic Link Library) that you'll see in the Windows API reference. Kernel32 takes care of pretty much most low level Windows stuff. Anything from multi-tasking to communications to files, to memory you name it.

  • Window handling, and Windows UI control(user32.dll)
    When you're creating Windows, adding controls to a windows, assigning window handles, managing events on a control or a window in particular, all these activities take place in this DLL. One key thing to remember is that the order you create the controls on a form defines the order by which they will be addressed when pressing tab. A small but useful rule of thumb.

  • Graphics and Imaging(gdi32.dll)
    When it comes to low level graphics related functions, the gdi32.dll is the one to call. This gives youa ahost of function specifically designed for low level graphics access and drawing. This dll doesn't rely on anything in particular and many great graphics related things can be accomplished by using gdi. GDI stands for Graphic Device Interface and as such can really prove to be quite helpful in graphically based applications.

  • Audio, Video, and Joystick control(winmm.dll)
    If you're a game maker of any kind, here's a DLL you'll probably never want to do without. Whether you're talking about Audio (MIDI or Digital Audio), Video, joystick controlling and the likes, the winmm.dll is the one to use for lowlevel access to these particular hardware.

  • Registry, Event Log, Authentication, and Services(advapi32.dll)
    If you need to consult the Windows Registry or need to add keys to the Windows registry, this is the dll that will do it. Along with this, advapi32.dll also allows to log events, authenticate applications as services as well as control and manage windows services. Depending on the program you are making it can come in quite handy at times.

  • Printing(winspool.drv)
    It's no secret that many applications today make use of the printers and printing services. WHether you want to select printers, send jobs to the printer spool, or any other printer related functionality winspool.drv is what you need.

  • Winsock, windows berkley socket support(wsock32.dll)
    This DLL is for anything that helps you talk to network or internet servers. It has all the functions that you need to open connections to servers, interrogate the status of that server and is also used for Protocol based communications such has FTP, HTTP and the likes.

  • Common Dialog control(comdlg32.dll)
    THis one holds all the functions types and constant to display any and all of Windows' common control. THese include the file open dialog, font and color selection dialogs, printer, printer select and printer properties. Using this typically saves you the trouble of creating your own dialog for these types of functionality.

  • Windows Network support(netapi32.dll)
    This is another hetwork DLL this one is more low level than winsock itself. This allows direct access to the network card that's connected to the computer. This can be handy if you're planning or creating a network administration system or tool of some sort.

  • Windows Compression(lz32.dll)
    Windows 200X and XP come with their own compression system. if you want to make programs that take advantage of this compression you can using this DLL. IT saves one the trouble of having the user go get such programs as Winzip or Winrar.

  • Common Controls(comctl32.dll)
    All of Windows standard controls are included in this DLL. These include text boxes, radio buttons, check boxes, list boxes, command buttons, combo boxes, scrollbars, and a couple other types of controls.

  • Versioning support(version.dll)
    This DLL allows, for example, to perform certain functionality only if the current windows version is version X.XX or more. It's very handy especially when you want to take advantage of features of a newer version of Windows without causing problems if the program is executed on an older version of Windows.

  • Object linking and embedding(ole32.dll)
    O.L.E. was initially used primarily for copying and pasting data between different applications, especially using drag and drop, as well as for managing compound documents. It later evolved to become an architecture for software components known as the component object model (COM), and later DCOM.

There, hopefully this little list will help you define which DLL is needed for the particular functionality that you want to achieve. The one good thing about this is that as you can see, none of these DLLs overlap themselves, only one of them will do the job for you, you just have to get the right one and you should be all set. Now that we somewhat organized all these API DLLs we can concretely start with a first example of API based development.

WINDOWS API BASIC NOTIONS:

The first thing you need to do is to break a windows GUI application into 3 parts and really get that into your subconscience. Unlike DOS or other OSes, when you create a Windows GUI application you don't just perform actions per se. You basically interact with the user, the OS and your application itself. I'll explain where in these 3 parts.

  • Creating The Form And Controls
    This is of course where you do the actual creation of the form, define it's caption, get Icons from resources if needed and the likes. It is also where you would add the controls you'll want displayed on the form along with theie relative positions on the form itself. One key rule of thumb to remember is that the order in which you issue your control creation statements will determine the order in which controls are tabbed on the form. You'll see why it can be important when you create forms that have several different controls on them and you want to give them an intelligent navigation order.

  • A Message Loop
    Typically, once the controls are created and the form displayed, you can enter into a loop where you start receiving and processing events created by the user or the OS. For example, if the user closes the form, clicks on an element of the form or the form itself, presses keys on the keyboard and the likes. In that case, these "events" are sent to the message loop.

  • A Command Procedure (A Windows Callback Procedure)
    Each type of event, whether caused by the operating system or the user, for whichever reason gets processed in the Windows callback procedure. This is to allow Windows to include your application as part of it's tasks and give it some CPU time when needed. Hence, if your form needs to be redrawn for esample (say you had another form on top of it that you just closed for example) your program will issue a Paint event which will tell Windows that your application needs to be redrawn on the screen. Windows will receive the message and call your Windows callback procedure to execute the appropriate code to redrawn the forms and the controls on the form.

With this basic knowledge in our head, it's now time to take a look at a rather basic and first Windows API example program. Rather than breaking up the program in parts I am commenting the code here (maybe in an overly exagerated fashion) but you should see clearly what's happening where with this first example.

WINDOWS API A FIRST AND CLASSIC EXAMPLE:

What you will be seeing here is the very basics of Windows API programming. THis will create a standard Window as any other windows look and feel. We will also project a click on the forum to display a message in a message box. Note that this code is done in FreeBasic but that porting it to another BASIC shouldn't require too many changes.

' ======================================================
'  Sample Windows API program
'  by MystikShadows
' ======================================================
Option explicit
Option private

' ------------------------
'  This include is a must
' ------------------------
#include once "windows.bi"

DECLARE FUNCTION WinMain ( BYVAL hInstance     AS HINSTANCE, _
                           BYVAL hPrevInstance AS HINSTANCE, _
                           szCmdLine           AS STRING, _
                           BYVAL iCmdShow      AS INTEGER ) AS INTEGER


' ------------------------------------
'  So far, only one line of main code
' ------------------------------------
END WinMain( GetModuleHandle( null ), null, COMMAND$, SW_NORMAL )

' ==========================================================
'  NAME........: WindowsCallbackProcedure
'  RETURNS.....: 0 or the error level if any.
' ----------------------------------------------------------
'  DESCRIPTION.: This function is the windows callback
'                procedure.  It will be attached to the
'                created window when that window is
'                registered, created and shown.
' ==========================================================
FUNCTION WindowsCallbackProcedure ( BYVAL hWnd    AS HWND, _
                                    BYVAL message AS UINT, _
                                    BYVAL wParam  AS WPARAM, _
                                    BYVAL lParam  AS LPARAM ) AS LRESULT

    ' ----------------------------
    '  We'll need a few variables
    ' ----------------------------
    DIM WindowRectangle     AS RECT
    DIM WindowPaint         AS PAINTSTRUCT
    DIM DeviceContextHandle AS HDC

    FUNCTION = 0

    ' -----------------------------
    '  Message Process Select Case
    ' -----------------------------
    SELECT CASE message
           CASE WM_CREATE
                EXIT FUNCTION
           CASE WM_LBUTTONUP
                MessageBox NULL, "Hello world from FreeBasic", "FB Win", MB_OK
           CASE WM_PAINT
                DeviceContextHandle = BeginPaint( hWnd, @WindowPaint )
                GetClientRect( hWnd, @WindowRectangle )
                DrawText( DeviceContextHandle, _
                          "Hello Windows from FreeBasic!", _
                          -1, _
                          @WindowRectangle, _
                          DT_SINGLELINE Or DT_CENTER Or DT_VCENTER )
                EndPaint( hWnd, @WindowPaint )
                EXIT FUNCTION
           CASE WM_KEYDOWN
                ' --------------------------
                '  Close if esc key pressed
                ' --------------------------
                IF lobyte( wParam ) = 27  Then
                   PostMessage( hWnd, WM_CLOSE, 0, 0 )
                END IF
           CASE WM_DESTROY
                PostQuitMessage( 0 )
                EXIT FUNCTION
    END SELECT

    ' ----------------------------------------------------------------
    '  If the message isn't for our program it getts sent to Window's
    '  default message handler for standard processing.
    ' ----------------------------------------------------------------
    FUNCTION = DefWindowProc( hWnd, message, wParam, lParam )

END FUNCTION

' =========================================================
'  NAME........: WinMain
'  RETURNS.....: 0 or the error level if any.
' ---------------------------------------------------------
'  DESCRIPTION.: This function is the windows callback
'                procedure.  It will be attached to the
'                created window when that window is
'                registered, created and shown.
' =========================================================
FUNCTION WinMain ( Byval hInstance     As HINSTANCE, _
                   Byval hPrevInstance As HINSTANCE, _
                   szCmdLine           As String, _
                   Byval iCmdShow      As Integer ) As Integer

    ' ---------------------
    '  Some work variables
    ' ---------------------
    DIM WindowMessage        AS MSG
    DIM WindowClass          AS WNDCLASS
    DIM ApplicationClassName AS STRING
    DIM hWnd                 AS HWND

    ' ---------------------------------------------
    '  First we populate the WindowClass structure
    ' ---------------------------------------------
    FUNCTION = 0
    ApplicationClassName = "FirstSample"
    WITH WindowClass
         .style         = CS_HREDRAW Or CS_VREDRAW
         .lpfnWndProc   = @WindowsCallbackProcedure
         .cbClsExtra    = 0
         .cbWndExtra    = 0
         .hInstance     = hInstance
         .hIcon         = LoadIcon( NULL, IDI_APPLICATION )
         .hCursor       = LoadCursor( NULL, IDC_ARROW )
         .hbrBackground = GetStockObject( WHITE_BRUSH )
         .lpszMenuName  = NULL
         .lpszClassName = STRPTR( ApplicationClassName )
    END WITH
    ' -----------------------------------
    '  Next we register the window class
    ' -----------------------------------
    IF RegisterClass( @WindowClass ) = FALSE  THEN
       MessageBox( null, "Failed to register WindowClass!", ApplicationClassName, MB_ICONERROR )
       EXIT FUNCTION
    END IF
    ' ------------------------------------
    '  We then Create and show the window
    ' ------------------------------------
    hWnd = CreateWindowEx( 0, _                     ' Extended Window Style
                           ApplicationClassName, _  ' Registered Class Name
                           "The Hello Program", _   ' Windows Title Caption
                           WS_OVERLAPPEDWINDOW, _   ' Window Style Bit
                           CW_USEDEFAULT, _         ' X Position
                           CW_USEDEFAULT, _         ' Y Position
                           CW_USEDEFAULT, _         ' Width of the window
                           CW_USEDEFAULT, _         ' Height Of the window
                           NULL, _                  ' Handle to owner window
                           NULL, _                  ' handle to menu
                           hInstance, _             ' Handle to Application Instance
                           NULL )                   ' Handle to Window Creation Data
    ShowWindow( hWnd, iCmdShow )
    UpdateWindow( hWnd )
    ' ------------------------------------------
    '  This loop processes the windows messages
    ' ------------------------------------------
    WHILE GetMessage( @WindowMessage, NULL, 0, 0 ) <> FALSE
          TranslateMessage( @WindowMessage )
          DispatchMessage( @WindowMessage )
    WEND
    ' -------------------------------------------------------------
    '  Program has ended, we return wParam to the operating system
    ' -------------------------------------------------------------
    FUNCTION = WindowMessage.wParam

END FUNCTION

A FEW NOTES:

All functions such as RegisterClass, CreateWindowEx and the likes are all part of the standard WindowsAPI so by including "windows.bi" you are infact gaining access to all these functions (and many more) that help you create Windows API based GUI applications. Here's a screenshot of what you get:


Basically you get the white window displayed first, when you click on it, the little message box you see near the center appears and waits for you to click the "OK" button.

As you can see, although maybe a bit long, the code is rather straight forward. There's a method to the madness so to speak and there's an order in which to get things done if we want the window and it's controls to work the way we originally planned it. In the next step we'll add a couple buttons in the window to show you where the new code would go when creating mroe complex types of forms. We'll use this initial example and build on it. But before we do that, let's cover some of the default Window classes that you can use in your application.


DEFAULT WINDOW CLASSES:

Default classes are window/control types that are already "registered" in the Windows system. These classes include things like buttons and edit boxes, that would take far too much work to define manually. Here is a list of some of the pre-made window types:

  • BUTTON
    A BUTTON window can encompass everything from a push button to a check box and a radio button. The "title" of a button window is the text that is displayed on a button.

  • SCROLLBAR
    SCROLLBAR windows are slider controls that are frequently used on the edge of a larger window to control scrolling. SCROLLBAR types can also be used as slider controls.

  • MDICLIENT
    This client type enables Multiple Document Interface (MDI) applications. We will discuss MDI applications in a later part of the series.

  • STATIC
    STATIC windows are simple text displays. STATIC windows rarely accept user input. However, a STATIC window can be modified to look like a hyperlink, if necessary.

  • LISTBOX, COMBOBOX
    LISTBOX windows are drop-down list boxes, that can be populated with a number of different choices that the user can select. A COMBOBOX window is like a LISTBOX, but it can contain complex items.

  • EDIT, RichEdit
    EDIT windows allow text input with a cursor. Basic EDIT windows also allow for copy+paste operations, although you need to supply the code to handle those options yourself. RichEdit controls allow for text editing and formatting. Consider an EDIT control being in Notepad.exe, and a RichEdit control being in WordPad.exe.

And there you have it. THese controls make it a whole lot simpler for us especially for this second example. But since these are standard controls, there's already alot of applications that make good use of these controls. And now, let's see about our more advanced example.


A MORE DETAILED EXAMPLE:

For this part, we'll be adding a static label, a text edit box and a button to the form. First we add some SHARED variables to module to hold the creation of the controls we want to add. These are SHARED variables so they can be put in the beginning of the module.


     DIM SHARED StaticLabel    AS UInteger
     DIM SHARED EditControl    AS UInteger
     DIM SHARED OKButtonHandle AS UInteger


The actual creation of the controls will take place right after the call to the CreateWindowEx we already have in our example (just before the call to the ShowWindow Function). Remember that the order that you create the controls in is the order that you can navigate the controls in (hence by pressing tab of the control's WS_TABSTOP property was set, you'll see how it's set right here:


    ' -----------------------------------------------------
    '  Right here is where we add our controls to the form
    ' -----------------------------------------------------
    StaticLabel    = CreateWindowEx(0, "STATIC", "Enter Your Name:", WS_VISIBLE Or WS_CHILD Or WS_TABSTOP, _
                                    30, 30, 200, 30, hWnd, null, hInstance, null )
    EditControl    = CreateWindowEx(0, "EDIT",   "", WS_VISIBLE Or WS_CHILD Or WS_TABSTOP Or WS_BORDER, _
                                    300,30, 200, 30, hWnd, null, hInstance, null)
    OKButtonHandle = CreateWindowEx(0, "BUTTON", "&Ok", WS_VISIBLE Or WS_CHILD Or WS_TABSTOP, _
                                    100,300, 80, 30, hWnd, null, hInstance, null)


Finally, the last thing we need to think about is to add code, in the Windows Callback Procedure (WindowsCallbackProcedure) if we want anything to happen on certain events of these newly created controls. In this example we'll display a message box when the users clicks the Ok button, but of course, anything could happen that can be coded. Hence in the CASE of a WM_COMMAND event (this will be added at the end of the SELECT CASE statement in the WIndowsCallbackProcedure function), we'll add this:


CASE WM_COMMAND
     SELECT CASE lParam
            CASE OKButtonHandle
                 MessageBox hWnd, "Button 1 Clicked!", "Test", 0
     END SELECT


And it's really as simple as that. We add variables to hold the handles of the controls, we create the controls, and if needed we manage their events in the Windows callback procedure. Simple 3 step mechanism. Here is what the complete source code looks like with all these additions.


' ======================================================
'  Sample Windows API program
'  by MystikShadows
' ======================================================
Option explicit
Option private

' ------------------------
'  This include is a must
' ------------------------
#include once "windows.bi"

DECLARE FUNCTION WinMain ( BYVAL hInstance     AS HINSTANCE, _
                           BYVAL hPrevInstance AS HINSTANCE, _
                           szCmdLine           AS STRING, _
                           BYVAL iCmdShow      AS INTEGER ) AS INTEGER

' ------------------------------
'  Shared Variable Declarations
' ------------------------------
DIM SHARED StaticLabel    AS UINTEGER
DIM SHARED EditControl    AS UINTEGER
DIM SHARED OKButtonHandle AS UINTEGER

' ------------------------------------
'  So far, only one line of main code
' ------------------------------------
END WinMain( GetModuleHandle( null ), null, COMMAND$, SW_NORMAL )

' ==========================================================
'  NAME........: WindowsCallbackProcedure
'  PARAMETERS..: BYVAL hWnd    AS HWND    Window HAndle
'                BYVAL message AS UINT    Message
'                BYVAL wParam  AS WPARAM  Message
'                BYVAL lParam  AS UINT    Message

'  RETURNS.....: 0 or the error level if any.
' ----------------------------------------------------------
'  DESCRIPTION.: This function is the windows callback
'                procedure.  It will be attached to the
'                created window when that window is
'                registered, created and shown.
' ==========================================================
FUNCTION WindowsCallbackProcedure ( BYVAL hWnd    AS HWND, _
                                    BYVAL message AS UINT, _
                                    BYVAL wParam  AS WPARAM, _
                                    BYVAL lParam  AS LPARAM ) AS LRESULT

    ' ----------------------------
    '  We'll need a few variables
    ' ----------------------------
    DIM WindowRectangle     AS RECT
    DIM WindowPaint         AS PAINTSTRUCT
    DIM DeviceContextHandle AS HDC

    FUNCTION = 0

    ' -----------------------------
    '  Message Process Select Case
    ' -----------------------------
    SELECT CASE message
           CASE WM_CREATE
                EXIT FUNCTION
           CASE WM_LBUTTONUP
                ' MessageBox NULL, "Hello world from FreeBasic", "FB Win", MB_OK
           CASE WM_PAINT
                DeviceContextHandle = BeginPaint( hWnd, @WindowPaint )
                GetClientRect( hWnd, @WindowRectangle )
                DrawText( DeviceContextHandle, _
                          "", _
                          -1, _
                          @WindowRectangle, _
                          DT_SINGLELINE Or DT_CENTER Or DT_VCENTER )
                EndPaint( hWnd, @WindowPaint )
                EXIT FUNCTION
           CASE WM_KEYDOWN
                ' --------------------------
                '  Close if esc key pressed
                ' --------------------------
                IF lobyte( wParam ) = 27  Then
                   PostMessage( hWnd, WM_CLOSE, 0, 0 )
                END IF
           CASE WM_DESTROY
                PostQuitMessage( 0 )
                EXIT FUNCTION
           CASE WM_COMMAND
                SELECT CASE lParam
                       CASE OKButtonHandle
                            MessageBox hWnd, "You have clicked the OK button!", "INFORMATION", 0
                END SELECT
      END SELECT

    ' ----------------------------------------------------------------
    '  If the message isn't for our program it getts sent to Window's
    '  default message handler for standard processing.
    ' ----------------------------------------------------------------
    FUNCTION = DefWindowProc( hWnd, message, wParam, lParam )

END FUNCTION

' =========================================================
'  NAME........: WinMain
'  PARAMETERS..: BYVAL hInstance     AS HINSTANCE
'                BYVAL hPrevInstance AS HINSTANCE
'                szCmdLine           AS STRING
'                BYVAL iCmdShow      AS INTEGER
'  RETURNS.....: 0 or the error level if any.
' ---------------------------------------------------------
'  DESCRIPTION.: This function is the windows callback
'                procedure.  It will be attached to the
'                created window when that window is
'                registered, created and shown.
' =========================================================
FUNCTION WinMain ( Byval hInstance     As HINSTANCE, _
                   Byval hPrevInstance As HINSTANCE, _
                   szCmdLine           As String, _
                   Byval iCmdShow      As Integer ) As Integer

    ' ---------------------
    '  Some work variables
    ' ---------------------
    DIM WindowMessage        AS MSG
    DIM WindowClass          AS WNDCLASS
    DIM ApplicationClassName AS STRING
    DIM hWnd                 AS HWND
    DIM BackgroundColor      AS INTEGER
    ' ---------------------------------------------
    '  First we populate the WindowClass structure
    ' ---------------------------------------------
    FUNCTION = 0
    BackgroundColor = &HC0C0C0
    ApplicationClassName = "Your First Window"
    WITH WindowClass
         .style         = CS_HREDRAW Or CS_VREDRAW
         .lpfnWndProc   = @WindowsCallbackProcedure
         .cbClsExtra    = 0
         .cbWndExtra    = 0
         .hInstance     = hInstance
         .hIcon         = LoadIcon( NULL, IDI_APPLICATION )
         .hCursor       = LoadCursor( NULL, IDC_ARROW )
         .hbrBackground = GetStockObject(LTGRAY_BRUSH)
         .lpszMenuName  = NULL
         .lpszClassName = STRPTR( ApplicationClassName )
    END WITH
    ' -----------------------------------
    '  Next we register the window class
    ' -----------------------------------
    IF RegisterClass( @WindowClass ) = FALSE  THEN
       MessageBox( null, "Failed to register WindowClass!", ApplicationClassName, MB_ICONERROR )
       EXIT FUNCTION
    END IF
    ' ------------------------------------
    '  We then Create and show the window
    ' ------------------------------------
    hWnd = CreateWindowEx( 0, _                     ' Extended Window Style
                           ApplicationClassName, _  ' Registered Class Name
                           "The Hello Program", _   ' Windows Title Caption
                           WS_OVERLAPPEDWINDOW, _   ' Window Style Bit
                           CW_USEDEFAULT, _         ' X Position
                           CW_USEDEFAULT, _         ' Y Position
                           CW_USEDEFAULT, _         ' Width of the window
                           CW_USEDEFAULT, _         ' Height Of the window
                           NULL, _                  ' Handle to owner window
                           NULL, _                  ' handle to menu
                           hInstance, _             ' Handle to Application Instance
                           NULL )                   ' Handle to Window Creation Data
    ' -----------------------------------------------------
    '  Right here is where we add our controls to the form
    ' -----------------------------------------------------
    StaticLabel    = CreateWindowEx(0, "STATIC", "Enter Your Name:", WS_VISIBLE Or WS_CHILD Or WS_TABSTOP, _
                                    30, 30, 200, 30, hWnd, null, hInstance, null )
    EditControl    = CreateWindowEx(0, "EDIT",   "", WS_VISIBLE Or WS_CHILD Or WS_TABSTOP Or WS_BORDER, _
                                    300,30, 200, 30, hWnd, null, hInstance, null)
    OKButtonHandle = CreateWindowEx(0, "BUTTON", "&Ok", WS_VISIBLE Or WS_CHILD Or WS_TABSTOP, _
                                    100,300, 80, 30, hWnd, null, hInstance, null)
    ' ----------------------------------
    '  We're now ready to show the form
    ' ----------------------------------
    ShowWindow( hWnd, iCmdShow )
    UpdateWindow( hWnd )
    ' ------------------------------------------
    '  This loop processes the windows messages
    ' ------------------------------------------
    WHILE GetMessage( @WindowMessage, NULL, 0, 0 ) <> FALSE
          TranslateMessage( @WindowMessage )
          DispatchMessage( @WindowMessage )
    WEND
    ' -------------------------------------------------------------
    '  Program has ended, we return wParam to the operating system
    ' -------------------------------------------------------------
    FUNCTION = WindowMessage.wParam

END FUNCTION


You might want to note that I commented out the MessageBox statement under the WM_BUTTONUP in the SELECT CASE statement. Also when I setup my WindowClass, I decided, for this second example, to change the background color of the window from white to light grey. If you compile and run this code, here's a sample of what you'll get:


As before, you get the big grey window when the program runs. You can just click on the OK button to see the little message box with "You have clicked the OK Button!" appear on the screen. This is good when you use the already registered controls that I've enumerated and explained earlier in this tutorial. A very simple three step system to add any of the pre registered Windows classes.



IN CONCLUSION:

This brings this first part of the series to an end. I think we've covered quite alot of grounds as far as Windows API and GUI application programming goes. One of the best thing to do, until the 2nd part of the series comes out, is to take these code samples and experiment with them. Change some values, see what happens. Get acquainted with atleast part of what's available to you from the API that you can use right away. Try out some of the other preregistered classes to see how they look and feel and basically have fun with it.

In the next part of the series we will look even more details of windows API development. We'll look at how you can do more detailed things like populate a combo box with elements that can be selected and the likes to give you a complete overview of the basics of Windows API development. We'll even take a non registered class and see how to register them so we can then use them in our forms and dialogs. Of course, if anything isn't quite as clear as you'd like, you can always email me with questions and comments (see my email below in my signature. So until the next part of the series arrives, have fun and happy Windows API coding.



MystikShadows
Stéphane Richard
MystikShadows@gmail.com

mennonite's QB Intro - What Exactly is QBasic?

by mennonite

[note: this tutorial is designed to start completely from square one and move up as far as possible from there. in order to make each chapter easier to find, only one is included per issue. chapter one, for the most part, only tells you what basic is- but those not very familiar with qb might learn something anyway.]

qbasic is a basic program interpreter published by microsoft. it was designed for the ms-dos operating system, however it works to some degree with various other flavors of dos, including freedos. b.a.s.i.c. is a simple language developed at dartmouth college for coding computer programs.

quickbasic is a basic program compiler... the principal difference between the two is, of course, that quickbasic compiles and has more functions available than the qbasic interpreter. in fact, quickbasic includes an editor roughly the same as qbasic's, but was originally published as its own software package, whereas qbasic was included with ms-dos versions 5 and up, and also with windows 9x (it might not be installed, but can be found on the win95 install cd.)

you will not usually encounter differences between the interpreter and compiler until you want to make your own stand-alone exe files. generally, the more complex the routines a program uses, the more likely it is that it requires the compiler and companion libraries. however, in my personal experience, most programs will run from the interpreter. of course, once a program is compiled into a stand-alone exe file, you don't need any version of qbasic or quickbasic to run it at all.

b.a.s.i.c. was designed to make programming more accessible to newcomers, and is probably the friendliest programming language there is. if you are trying to quickly write a small program to perform a simple task on your computer, b.a.s.i.c. allows you to do so with little time and effort. it is a major part of a decades-long tradition of hobby programming, and countless books and websites include b.a.s.i.c. source code for you to try out on your computer.

b.a.s.i.c. programs usually run slowly compared to programs written in other languages, and most b.a.s.i.c. interpreters and compilers have serious limitations as to what and how well they can perform. because of this, most serious programmers (and pretty much anyone who intends to code as a means of creating income) move on to other languages. none of this stops b.a.s.i.c. from being useful or fun, and if it is one of the lesser languages, it keeps a strong following even today.

in the next chapter, we'll get started with qbasic and write some code. if you have friends that want to learn programming, you can share this tutorial with them. as we move ahead with the chapters, you'll probably find a number of things you weren't familiar with before- this starts with the beginner in mind, but moves on to make *you* (or s/he) a bit more of an expert, and show you what basic can really do.

FBWin Console Apps In ReactOS

by mennonite

one of the projects the good people at
http://reactos.org want tested with ros is freebasic. this article will help to show that indeed, freebasic works with ros.

of course, reactos is being worked on a piece at a time, and is an open source project created and maintained mostly in the spare time of the coders involved. i think they're doing something amazing, and i think it shows.

that said, reactos is not meant for everyday use, it is not quite stable, it is ALPHA, and that's fine. but given all this, when something works in reactos, it is exciting and a real sign of progress. i have been following reactos for a while- half a year or more, and i'm excited with the progress i've seen- 0.3.0 release candidate 1 is yet another fine example.

i have tried the reactos live cd, installed it on real (old) hardware, and run reactos in qemu in windows 98. for this article, i will be using reactos 0.3.0 rc1 in qemu- and i recommend running it in qemu because on my older hardware, i haven't had enough increase in speed by installing it. qemu (or vmware player) within your existing os is a good bet, and a popular choice. if you have a lower end pentium, for now i think you will find you don't want to dev in the ros environment. you will probably want to code in windows, and then test your programs in ros.

the first thing you will need to do to use freebasic in reactos is download the os. to use the version that comes preinstalled with qemu, use this link:
download ros 0.3.0 rc1+qemu from sourceforge

it is somewhere in the neighborhood of 45 megabytes- yes, you CAN download it on dialup. it will take a couple of hours.

when i downloaded ros 0.2.8 on qemu, i had a major display problem, but only inside the qemu window- it only showed 1/4 of the screen, kind of scrunched inside it. i was unable to find a fix for this, and tried a number of switches.

i was also unable to find anyone else who had this problem, but on the offchance it happens to anyone else, you can use version 0.2.9 to fix it- see this post on ascii-world for more:
using ros 0.2.9+qemu to fix display of 0.3.0 rc1+qemu

once you have downloaded reactos, you can download freebasic 0.16 or 0.15b- i use the latter, and that's what i have tested the code in this article with. i assume that the same functions that work in reactos in fbwin 0.15b work in 0.16 as well. if not, see the migrating.txt included in fb 0.16 for more information.

you will need the *windows* version of freebasic for reactos. dosbox DOES run in reactos, but dosbox and freebasic for dos do not get along quite as well as qb and dosbox do, and also i have yet to get dosbox working in ros PERSONALLY; others have.

without dosbox, reactos can only run 32 bit applications. qb will not run at all- there is a possibility of a dos subsystem in reactos' future, but that is the distant future. right now they are focused- even i think rightfully so, on making the windows functions work. as long as dosbox works in reactos, i'm happy- they make the right promises, are kind, and have never been seen straying from their own "hype." the reactos project makes me proud to be human, and it just gets better.

so i think that's more than enough intro, let's get cracking.

after you've unzipped ros+qemu, it should be ready to run. run "boot.bat" and qemu will load, and load reactos. from there, start the command prompt, and you should be able to use dos commands such as DIR /w ... etc.

to shutdown reactos, click start and "log off" - i presume that will be changed in the future. after reactos is shutdown to a blue screen and a logoff message, you can close qemu.

the next step is to install freebasic on a windows system. i was unable to install freebasic directly in ros, so i installed to windows and "copied" the files using an .iso image- i'll explain that in a moment.

if you go to the dos prompt in windows (before running reactos), CD "c:\fbwinpathnameofyourchoice" and enter:

DIR /ad /s /b > fbhelper.bat

you will save a listing much like this one:

d:\fbwin32\bin
d:\fbwin32\docs
d:\fbwin32\inc
d:\fbwin32\lib
d:\fbwin32\examples
d:\fbwin32\bin\win32
d:\fbwin32\bin\win32\res

[ i have removed all listings that start with
 d:\fbwin32\examples\ to save time and space :) ]

d:\fbwin32\inc\crt
d:\fbwin32\inc\disphelper
d:\fbwin32\inc\gdsl
d:\fbwin32\inc\Lua
d:\fbwin32\inc\mysql
d:\fbwin32\inc\al
d:\fbwin32\inc\GL
d:\fbwin32\inc\pcre
d:\fbwin32\inc\SDL
d:\fbwin32\inc\win
d:\fbwin32\inc\crt\sys
d:\fbwin32\inc\win\rc
d:\fbwin32\lib\win32


because i didn't think of doing so ahead of time, i ended up typing in the following by hand into the command prompt in ros. still, before you go any further, you should be able to get away with creating the following batch file in your favorite editor. you should adjust folder/pathnames to the names of your choosing:

md c:\reactos\fbwin015

md c:\reactos\fbwin015\bin
copy d:\fbwin32\bin\*.* c:\reactos\fbwin015\bin

md c:\reactos\fbwin015\docs
copy d:\fbwin32\docs\*.* c:\reactos\fbwin015\docs

md c:\reactos\fbwin015\inc
copy d:\fbwin32\inc\*.* c:\reactos\fbwin015\inc

md c:\reactos\fbwin015\lib
copy d:\fbwin32\lib\*.* c:\reactos\fbwin015\lib

md c:\reactos\fbwin015\examples
copy d:\fbwin32\examples\*.* c:\reactos\fbwin015\examples

md c:\reactos\fbwin015\bin\win32
copy d:\fbwin32\bin\win32\*.* c:\reactos\fbwin015\bin\win32

md c:\reactos\fbwin015\bin\win32\res
copy d:\fbwin32\bin\win32\res\*.* c:\reactos\fbwin015\bin\win32\res

md c:\reactos\fbwin015\inc\crt
copy d:\fbwin32\inc\crt\*.* c:\reactos\fbwin015\inc\crt

md c:\reactos\fbwin015\inc\disphelper
copy d:\fbwin32\inc\disphelper\*.* c:\reactos\fbwin015\inc\disphelper

md c:\reactos\fbwin015\inc\gdsl
copy d:\fbwin32\inc\gdsl\*.* c:\reactos\fbwin015\inc\gdsl

md c:\reactos\fbwin015\inc\Lua
copy d:\fbwin32\inc\Lua\*.* c:\reactos\fbwin015\inc\Lua

md c:\reactos\fbwin015\inc\mysql
copy d:\fbwin32\inc\mysql\*.* c:\reactos\fbwin015\inc\mysql

md c:\reactos\fbwin015\inc\al
copy d:\fbwin32\inc\al\*.* c:\reactos\fbwin015\inc\al

md c:\reactos\fbwin015\inc\GL
copy d:\fbwin32\inc\GL\*.* c:\reactos\fbwin015\inc\GL

md c:\reactos\fbwin015\inc\pcre
copy d:\fbwin32\inc\pcre\*.* c:\reactos\fbwin015\inc\pcre

md c:\reactos\fbwin015\inc\SDL
copy d:\fbwin32\inc\SDL\*.* c:\reactos\fbwin015\inc\SDL

md c:\reactos\fbwin015\inc\win
copy d:\fbwin32\inc\win\*.* c:\reactos\fbwin015\inc\win

md c:\reactos\fbwin015\inc\crt\sys
copy d:\fbwin32\inc\crt\sys\*.* c:\reactos\fbwin015\inc\crt\sys

md c:\reactos\fbwin015\inc\win\rc
copy d:\fbwin32\inc\win\rc\*.* c:\reactos\fbwin015\inc\win\rc

md c:\reactos\fbwin015\lib\win32
copy d:\fbwin32\lib\win32\*.* c:\reactos\fbwin015\lib\win32


put this batch and all your files from your freebasic folder into a folder called "fbwin32" and save an .iso file of that folder using a tool such as nero or burn4free (recommended.) this .iso file will be your virtual "cdrom" in qemu.

in your qemu folder, you want to edit the boot.bat file. it should look like this:

qemu -boot c -m 64 -L . c.img -user-net


you want to add the switch -cdrom fb015.iso so it says:

qemu -boot c -m 64 -L . c.img -cdrom fb015.iso -user-net


now it will load your .iso file as drive d: in reactos.

when you have run qemu again, you should be able to access the d: drive in the command prompt by typing d: and hitting enter. then you can type:

cd fbwin32

and enter the name of your batch file to "install" freebasic.

if any of the folders are missing when you run fbc, go back and make sure you copied that folder. every time you close qemu you can update your .iso file "cd" to get new files into ros.

finally! freebasic is ready to go. lets see one of my favorite features of fb:

c:\reactos\fbwin015>echo ? fre(0) > hello.bas

c:\reactos\fbwin015>fbc hello.bas

c:\reactos\fbwin015>hello
24199168


23 megs of ram- not too shabby, since by default qemu is given 64!

now we can:

c:\reactos\fbwin015>start notepad

and the notepad will open. we can use this to save to a file called "print.bas" and compile that to test freebasic features.

hopefully you've already seen print fre(0) in action, and we can move forward:

print "hello world!"
sleep


yes, had to do that. i wrote this example before i tried fre(0). let's do color:

for n=1 to 7
color n: print "hello world!"
next n
'sleep


and we'll try graphics:

screen 9:for n=1 to 7
pset (4*n,7*n),n
next n
sleep


sorry, not yet. maybe with allegro? i thought i'd try a few other screen modes too. here's screen 13:

screen 13:for n=1 to 7
pset (4*n,7*n),n
next n
sleep


no, and it appears to open a window with a working area that is actually 320x200 pixels in size instead of simulating larger pixels (but actually fbwin does that in windows 98 as well)


 

screen 12:for n=1 to 7
pset (4*n,7*n),n
next n
sleep

no. i think this has as much to do with reactos api functions as freebasic, although i have had trouble with pset in windows 98 as well. oh well, let's see if files work!

open "print.bas" for binary as #1
q$=input$(lof(1),1)
close
open "print2.bas" for output as #1
? #1, q$
? #1, "'";
for n=128 to 255
? #1, chr$(n);:next
close
open "print2.bas" for input as #1
do while not eof(1)
line input #1, q$
? q$
loop
close

yes! yes they sure seemed to. one sad thing about reactos's command prompt is it seems to mangle extended ascii into ansi. i wanted to make sure it was working so i wrote this second program that totally gave me hell the whole way - i know, and it's so simple :P

open "files" for binary as #1
for n=0 to 255: q$=chr$(n)
put #1,n+1,q$ :next
close
open "files" for binary as #1
q$=input$(256,1)
close
for n=1 to 256
? asc(mid$(q$,n,1));" ";
next
but also, it works!

i guess dosbox is much cooler on the ascii side of the screen. i did find a way to simulate chr$(219) for ascii art though:

? chr$(219)
? "."
color 0,15
? " ";:color 7,0
?


let's also make sure locate can access the whole screen:

for y=1 to 25
for x=1 to 80
locate y,x
if y=1 or y=25 or x=1 or x=80 then color 0,int(rnd*15+1):? " ";:color 7,0
locate 2,2
next x
next y
sleep

that works as well. i must warn you, i would have "optimized" this if i had known how long it would take to locate all the points on the screen! it's instantaneous in windows. does anyone else wonder if the arrow keys work? they do:

do:q$=inkey$
select case q$
case chr$(255)+"H":? "[u]";
case chr$(255)+"P":? "[d]";
case chr$(255)+"K":? "[l]";
case chr$(255)+"M":? "[r]";
case chr$(27):? "[esc]";
case chr$(13):? "[enter]";
case "": q$=""
case else:? q$;
end select
loop until q$=chr$(27)


and we'll try getmouse:

do
locate by+1,bx+1:? " ";
locate y+1,x+1: ? "*";
by=y
bx=x
do:getmouse x,y,,b:loop until x<>bx or y<>by
loop until b=1 or inkey$=chr$(27)

no, sadly, no mouse in fbwin console apps yet. but shell works:

shell "dir"
shell "dir > file"
shell "cmd /c dir /w"
shell "cmd /c start notepad"
shell "start notepad"

in qbasic, "cmd /c" is needed with the shell command in 2000/xp but not in 98. in 98 shell "start notepad" works reliably.

in reactos, all five of the above statements will do what you would expect: show a directory listing, redirect it to a file, show a listing with /w, and both the lines that attempt to run notepad succeed.


so in summary:

  • reactos is in alpha and freebasic is in beta. they do not always work together, but they do enough to say that "you can use freebasic to compile in reactos, and you can write freebasic programs that run in reactos."
  • for now, you are limited to console apps without the mouse- game libraries such as allegro remain untested in reactos.
  • file functions work
  • locate works
  • extended ascii will show up as ANSI
  • shell seems to work fine regardless of whether you use cmd /c or not
  • by default, reactos in qemu creates a virtual machine with 64mb of ram. after running reactos, fbc and fb apps get 23 megs of ram to work with :) this can be increased if you have more physical ram for running qemu.


ultimately, you are probably not going to be able to run top-of-the-line freebasic programs, or simple graphics programs. you can run qbasic in dosbox, but i've found that running programs with screen 12 in dosbox is pointless too- maybe not, on a higher end system. for those of you that have fast machines and want to make simple programs (or complex programs that don't use the mouse or extended ascii) in BASIC in reactos... this may be your best bet.

we'll see what the future brings...



Exit Issue

And there you have it, we're at the end of this first issue of PCOPY! Feel free to share any suggestions, ideas, constructive criticism and the likes and of course we welcome any contributions that you might want to submit. If there's something you really liked, let us know, you might see more of it in future issues!

We just finished this PCOPY! and back to work we go to bring you more in the next issue. PCOPY! editors can be contacted via the forum at
ASCII-World either in posts on the forum or via PM.

To send us articles, write our Editor In Chief at:
mystikshadows@ascii-world.com

So then, hope you liked it and see you next time... Happy Coding!


PCOPY! Issue 10



Copyright © Stéphane Richard (MystikShadows) and contributors, 2006.
All rights reserved. Our layout is based somewhat on QBE.