Is FB QB in disguise?

The forum for all of your Freebasic needs!

Moderators: Pete, Mods

dinokilla
Coder
Posts: 12
Joined: Mon Jan 07, 2008 6:56 pm

Is FB QB in disguise?

Post by dinokilla »

Can I compile QB code in FB or is it alot different? I used to program in QB awhile back and lately I've been programming in C++. I decided I just want to make some simple 2d side scrollers and rpgs now so...I know QB is very good for that, is FB the same? Or better???
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Most of normal QB will compile in FB. Older versions of FB are better for it though, as the compiler's gotten kind of convoluted lately. Anyways, it's pretty easy to make simple games in FB because of its powerful built-in graphics library that works similar to QB only 10000x better. Some things don't quite work right (such as DRAW) but a serious game programmer isn't going to use that archaic function anyways. But for blitting, it's ace. You get extra options too, such as "automasking", alpha blending, and true color, high resolution screen modes...all things you needed libraries for in QB.

Oh and I should warn you...there's a few people on this forum who have a hatred for FB. Pay no attention to them, as they are merely trolls looking for a snack.
dinokilla
Coder
Posts: 12
Joined: Mon Jan 07, 2008 6:56 pm

Post by dinokilla »

Wow that sounds good, Does it have documentation with it explaining the differences with qbasic? I wouldn't be using the DRAW function but definately blitting and general sprite stuff. I've always known QB was slow but I'm not trying to make money or anything I just like programming for the fun of it and QB has always made that easy so if FB has similar ease of programming with a bit more speed/functionality that sounds sweet. I like your little video you have in place of your avatar. :D Can't quite make out what he's saying though...HAHA Yea there will always be people that talk trash about the particular language you are learning. If I took other peoples advice there would be no good language to program in at all. Anyways, thanks for your input...I know I could have looked it up myself but I've been on Pete's site here checking out all the stuff and brushing up on my QB syntax lol. I will definately give FB a try.
bungytheworm
Veteran
Posts: 288
Joined: Sat Feb 18, 2006 4:02 pm

Post by bungytheworm »

There is pretty decently explained differences between QB and FB at the wiki http://www.freebasic.net/wiki/wikka.php ... gFullIndex
Example, in draw there reads Differences from QB: QB used the special pointer keyword VARPTR$ with the Xp command..
I am not 100% aware how update wiki is bot havent got much problems with it this far.

And as Nodtveidt told, be warned. Here are bitter QB peoples around. Gladly, there are only few and most of QB users are cool and friendly peoples.
dinokilla
Coder
Posts: 12
Joined: Mon Jan 07, 2008 6:56 pm

Post by dinokilla »

wow I was expecting a slightly updated dos compiler but wow...32bit integers and pointers, it's working it's way toward C, I can see why QB purists might not like it... Alot more up to date than I ever expected though! Is there an IDE that anyone would recommend? I don't NEED one but...if there is a decent one...
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

FBedit is pretty good, I've heard. The only one I ever used was FBIDE, which is now apparently quite outdated. I code everything in Notepad nowadays anyways. :)
bungytheworm
Veteran
Posts: 288
Joined: Sat Feb 18, 2006 4:02 pm

Post by bungytheworm »

dinokilla wrote:Is there an IDE that anyone would recommend? I don't NEED one but...if there is a decent one...
I use simple but neat one; http://www.gnome.org/projects/gedit/ ;)
coderJeff
Coder
Posts: 16
Joined: Tue Jan 08, 2008 8:14 am

Post by coderJeff »

Nodtveidt wrote:Most of normal QB will compile in FB. Older versions of FB are better for it though, as the compiler's gotten kind of convoluted lately.
Below are portions of the compiler change log that specifically target QB compatibility related issues since the addition of "-lang qb" in version 0.17.

These updates were made throughout the version 0.17 up to version 0.18.4 (SVN):
- added the -lang command-line option, to allow language compatibility without keeping FB from progress, see the migrating.txt file (v1c)
- lang qb: DATA should be allowed inside compound-statements (v1c)
- lang qb: MKI/CVI now return 16-bit sized results (counting_pine)
- lang qb: INTEGER (%) and LONG (&) are now, respectively, 16- and 32-bit wide (v1c)
- lang qb: default numeric literals are now assumed to be INTEGER or SINGLE (v1c)
- lang qb: symbols with the same name as keywords are now allowed: dim left as integer: const dim$ = "" etc (v1c)
- lang qb: all data types and functions/keywords not present in QuickBASIC were removed (v1c)
- lang qb: SLEEP(n) expects seconds (feature request #1718012) (jeffm)
- lang qb: INKEY$ returns CHR$(0) as the extended character (feature request #1718012) (jeffm)
- SCREEN now follows the QB syntax in -lang qb (v1c)
- RND is now 100% compatible with QB in -lang qb mode (patch written by counting_pine)
- ERASE is now compatible with QB, that is when ERASE is called on a variable-length array, the bounds information is reset in addition to the data being destroyed (cha0s)
- -lang qb now skips UDT alignment by default (cha0s)
- LOCATE will now accept a full 5 args to be compatible with QB, however the final 2 args have no effect (cha0s)
- STR will now pad positive numbers with a single space, as in QB, but ONLY if -lang qb is used (cha0s)
- OPEN now is more compatible with QB, the file/device is parsed at runtime (cha0s)
- fixed #1790722 - INPUT wasn't prompting with a '?' if no prompt string was given (cha0s)
- lang qb: STICK(n) and STRIG(n) functions (jeffm)
- added error when NEXT var does not match FOR var (jeffm)
- added First version of COM/serial support for DOS, W.I.P. (jeffm)
- cursor support for INPUT/LINE INPUT in GFX modes (v1c)
- 'PCOPY [srcPg] [, dstPg]' and 'SCREEN [, activePg] [, visiblePg]' for non-graphic, console, screen 0 mode - for DOS and Windows only (v1c)

Although fbc-0.16 most certainly broke stuff, since version fbc-0.17 there has been an on going effort by all developers to improve QB compatibility. Of course some popular "Normal QB" won't compile, but the common issues are on the TODO list.

Last released version of fbc is 0.18.3.

EDIT:
The items listed in the changelog above were made in versions 0.17 through 0.18.4 (SVN).
Last edited by coderJeff on Tue Jan 08, 2008 6:08 pm, edited 1 time in total.
dinokilla
Coder
Posts: 12
Joined: Mon Jan 07, 2008 6:56 pm

Post by dinokilla »

Thanks for the info, I can't remember being this excited about a new compiler since I first began programming! I will check out some of those IDE's, although I'm getting along pretty well without one so far. Thanks for all the help! I'll be back eventually with a problem I'm sure. :D
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

FB is just C code in disguise! Learn C and there will be no compatability problems. But you will have to convert Basic code to the C language.

Why learn a language that is so constantly updated in the first place? Even Nod only uses the old, mostly QB compatible version of FB. Seems like FB changes every update nowadays. That means you may have to revise your code too! A recent update requires you to redo the libraries also.

Still King!,

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

Maybe FreeBasic should be split up in FreeBasic and FreeFutureBasic or something.

Basic was created to provide access for non-science students to computers. At the time, nearly all use of computers required writing custom software, which was something only scientists and mathematicians tended to do.

The eight design principles of BASIC were:

1. Be easy for beginners to use.
2. Be a general-purpose programming language.
3. Allow advanced features to be added for experts (while keeping the language simple for beginners).
4. Be interactive.
5. Provide clear and friendly error messages.
6. Respond quickly for small programs.
7. Not to require an understanding of computer hardware.
8. Shield the user from the operating system

Seems like were way past that. Don't get me wrong, I don't think FreeBasic is bad but C is just not Basic to me. Then we might as well call FreeBasic FreeC or sumfin.
Last edited by Seb McClouth on Wed Jan 09, 2008 1:18 am, edited 1 time in total.
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
coderJeff
Coder
Posts: 16
Joined: Tue Jan 08, 2008 8:14 am

Post by coderJeff »

seb, 1 2 3 4 5 6 6 7?
Thanks, http://en.wikipedia.org/wiki/BASIC_programming_language

burger2227, you are absolutely correct: Want to get a job in programming? *Basic* probably won't help. And yes, FreeBASIC libraries need to be recompiled due to name mangling bugs. Please send your cheques payable to "The FreeBASIC Development Team" immediately so we can finally pay the workers in our closed beta testing group and prevent this from happening again. Thanks.

Btw, the changes listed in my previous post were made throughout versions 0.17 through 0.18.4(SVN).
dinokilla
Coder
Posts: 12
Joined: Mon Jan 07, 2008 6:56 pm

Post by dinokilla »

FB might be close to C but it's not C. It's kinda like I wouldn't use a saw to pound in a nail and I wouldn't use a hammer to try and cut a piece of wood. In my opinion each language/compiler can be used for different things. C is great for alot of things but when I decided to go back to making some simple math tutor programs for my little sister and thinking about making some simple rpgs and sidescrollers I found myself creating a whole bunch of functions just to make programming the games easier. I remembered that QB had most of these functions already built in so...I bagged it and came here where on the main page I saw a reference to FB and inquired about it, and here I am. Computers are so fast these days, if I made a program in QB or FB and made the same program in C I don't think you would notice a HUGE difference in speed. I'm definately not an expert but thats just my viewpoint, why make something more difficult and time consuming than it has to be? If I was trying to make some commercial program and make money off it of course I wouldn't use basic y'know? Use the right tool for the job, each compiler and language has it's pro's and con's. Sometimes you can even mix different capabilities of languages together!! Why do people that dislike FB go into the FB forum anyways? Enough ranting for me hehehe.
coderJeff
Coder
Posts: 16
Joined: Tue Jan 08, 2008 8:14 am

Post by coderJeff »

dinokilla, if you want to get an idea of the differences between QBasic, QB45, FreeBASIC and its dialects you might find these tables useful:

http://www.execulink.com/~coder/fb/docs ... words.html
http://www.execulink.com/~coder/fb/docs ... ature.html

Each keyword links to the on-line wiki (FreeBASIC manual). Sorry, the tables are a few weeks old.
dinokilla
Coder
Posts: 12
Joined: Mon Jan 07, 2008 6:56 pm

Post by dinokilla »

Thanks for the info Jeff, the more info the better. :D FB seems pretty straight forward so far. I've been doing more experimenting than reading but as long as I can remember that I'm not programming in DOS I should be ok. I tried using the SCREEN function like old QB...oops. No seg/offset either lol. I haven't programmed in basic for so long it's hard to break the habit but as far as I can tell most of the changes are pretty beneficial. Thanks everyone for the help and info!! I think I'm hooked...
bungytheworm
Veteran
Posts: 288
Joined: Sat Feb 18, 2006 4:02 pm

Post by bungytheworm »

err...peoples who claims that FB is more C than BASIC should now go and learn some C.
And to remind, QB <> original concept of BASIC. It is closer to basic than FB but so what?
There is "BASIC" dialects out there which dont have even functions such as PRINT, DIM, INPUT, REM etc. and i dont see you peoples there messing around how that XXXbasic is not basic.

Dont you ever get tired for these?
SMC
Coder
Posts: 20
Joined: Wed Jan 09, 2008 2:34 pm

Post by SMC »

I use FB instead of C because it brings everything together in a nice and neat little package. For some reason once you get out of ANSI C everything wants to become complicated and convoluted. I also like being able to, quickly, get something on the screen to play around with like I can with FB. That being said, I'm also of the same opinion as Nodtveidt in that I don't bother with newer releases. (still using version .16)
bungytheworm
Veteran
Posts: 288
Joined: Sat Feb 18, 2006 4:02 pm

Post by bungytheworm »

coderJeff
Coder
Posts: 16
Joined: Tue Jan 08, 2008 8:14 am

Post by coderJeff »

DEF SEG is technically possible, but what is missing is the cross-platform emulation layer. (bios data area will be loads of work). More info:
http://www.freebasic.net/forum/viewtopic.php?t=10297

I can repsect that some users want to continue using older versions of FB that work for them, but imo advertising old versions of the compiler does not help the project in general. FBIDE is probably the biggest culprit since it has been abandoned at fbc-0.15 but continues to be a popular starting point for getting in to FB.

Latest version of fbc here:
http://www.freebasic.net/index.php/download

Serious question: if users are still using versions <= 0.16, what would it take to get them to try newer versions?
bungytheworm
Veteran
Posts: 288
Joined: Sat Feb 18, 2006 4:02 pm

Post by bungytheworm »

coderJeff wrote:Serious question: if users are still using versions <= 0.16, what would it take to get them to try newer versions?
Hi Jeff.

I guess music would be good example here. If i have bought all albums from BandX this far since i like them but then i hear few songs of their next release, and i dont like it why should i buy that album? And even if i get it for free, why should i listen it if i dont like that new music style?
Is the reason in me or in that album? Peoples are same, only thing that has changed is that music.

Personally im fine with latest versions but i do understand peoples who sticks at .15 or .16.
Post Reply