beginner's questions

New to FreeBASIC? Post your questions here.
ron
Posts: 5
Joined: Jun 02, 2006 19:16

beginner's questions

Postby ron » Jun 02, 2006 20:09

Hi I've just heard of FreeBASIC for the first time. Was wondering, whether like QBASIC it also supports the classic BASIC programming format (i.e. procedural programming in one single block of code incorporating all subs and functions, and GOTOs, in user-specified numerical progression, e.g.

10 ...
20 ...
25 ...
30 ...
40 ...
REM
REM
50 ...
100 ...
101 ...

Also, I assume FB makes 32-bit Windows executables which are not subject to DOS limit of 64k?

I've downloaded the WIKI documentation but if there's any more (tutorials, etc.) I would be grateful for a link.

Thanks
Pritchard
Posts: 5455
Joined: Sep 12, 2005 20:06
Location: Ohio, USA

Postby Pritchard » Jun 02, 2006 20:16

FB supports just about everything QB did, except the unnecessary crap.

Was wondering, whether like QBASIC it also supports the classic BASIC programming format
Yup. Most of it. It supports it, and most source can be ported directly from QB to FB with almost no problems at all. FB's a big step from QB though, and people have finally learned to code properly.
Also, I assume FB makes 32-bit Windows executables which are not subject to DOS limit of 64k?
Yes :P
I've downloaded the WIKI documentation but if there's any more (tutorials, etc.) I would be grateful for a link.
If you know QB, you basically know FB :P
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Jun 02, 2006 20:36

Yes, ron. However, it's never to late to learn good programming practices ;).
stylin
Posts: 1253
Joined: Nov 06, 2005 5:19

Postby stylin » Jun 02, 2006 20:56

Pritchard wrote:
I've downloaded the WIKI documentation but if there's any more (tutorials, etc.) I would be grateful for a link.
If you know QB, you basically know FB :P

Not entirely. It may be more accurate to describe FreeBASIC as being a hybrid of QB and C, with an emphasis on backward compatible QB syntax. FreeBASIC currently supports pointer and function pointer datatypes (with an indefinite amount of indirection). FreeBASIC is probably used most effectively by using C-like programming techniques - and in the not-too distant future, C++-like techniques.

Even with the new language elements, however, FreeBASIC does mostly stick to QB-style syntax, so the transition should not be abrupt at all, especially if you're already familiar with some of the lower-level concepts. (the wiki has a list describing the differences between QB and FreeBASIC)

http://www.qbasicnews.com and its forums are also a good resource for FreeBASIC programming help, advice and news. You'll likely get helpful responses there as well.

If you have an IRC client, enter #FreeBASIC, or the german #FreeBASIC.de. There's usually a host of people there knowledgeable enough to be able to assist you.

Thanks for becoming part of the community, and good luck in your adventures. :)
VirusScanner
Posts: 775
Joined: Jul 01, 2005 18:45

Postby VirusScanner » Jun 02, 2006 23:33

I wouldn't exactly say a hybrid between QB and C, because almost none of the syntax is borrowed from C, only the features.

Pritchard wrote:FB supports just about everything QB did, except the unnecessary crap.

I think line numbers are unnecessary crap, but maybe that's just my opinion...
Pritchard
Posts: 5455
Joined: Sep 12, 2005 20:06
Location: Ohio, USA

Postby Pritchard » Jun 03, 2006 3:05

VirusScanner wrote:I think line numbers are unnecessary crap, but maybe that's just my opinion...
16-bit stuff is unnecessary. Maybe I should have been more specific.
Fragmeister
Posts: 545
Joined: Nov 08, 2005 14:36

Postby Fragmeister » Jun 03, 2006 3:15

VirusScanner wrote:I wouldn't exactly say a hybrid between QB and C, because almost none of the syntax is borrowed from C, only the features.

... and the entire C runtime library...

And yeah, I agree that line numbers are pretty useless. If you must use goto, text labels are easier to follow than #s.
ron
Posts: 5
Joined: Jun 02, 2006 19:16

Postby ron » Jun 03, 2006 13:48

Thanks to everyone for the help. Had a look through the help file, and FB does seem to be the ticket. I worked through K&R 2nd edition and the GNU C manual a couple of months ago, so the C stuff clicked.
I don't need to use line numbers when programming, but for some reason it seems to make things easier, perhaps because I find other modern high-level languages just look like a sprawling mess (i.e. C). I started BASIC programming early, back in the 80s on an Amstrad, and so I'm just used to the numbered lines. I even find assembly language (Z80 and x86 HLA) less frustrating than paragraphed tabs. As I'm only programming for myself, in a non-paid capacity, perhaps I'm more at liberty than others to have these likes and dislikes.
rdc
Posts: 1713
Joined: May 27, 2005 17:22
Location: Texas, USA
Contact:

Postby rdc » Jun 03, 2006 13:53

Fragmeister wrote:... and the entire C runtime library...


Not all of the functions in the CRT are available in FB, so there really is only a subset of the C library available, at least under Windows which uses the MS C runtime.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Jun 03, 2006 15:57

MSVCRT.DLL exports ~755 functions, and the v0.15b header files prototype ~565.
Shadowwolf
Posts: 341
Joined: May 27, 2005 7:01
Location: Canada
Contact:

Postby Shadowwolf » Jun 03, 2006 21:36

stylin didn't mean syntax he meant the overriding philosophy that FB has taken.
Fragmeister
Posts: 545
Joined: Nov 08, 2005 14:36

Postby Fragmeister » Jun 04, 2006 1:53

MichaelW wrote:MSVCRT.DLL exports ~755 functions, and the v0.15b header files prototype ~565.

I stand corrected. So, fb borrows a large portion of the CRT.
rdc
Posts: 1713
Joined: May 27, 2005 17:22
Location: Texas, USA
Contact:

Postby rdc » Jun 04, 2006 3:16

Actually many of the functions included in the bi files don't work in FB. Take a look at math.bi and you'll get link errors for many of the functions. v1c said that these functions are inline asm and would have to be hand-coded in order to work with FB.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Jun 04, 2006 7:43

Yes, when I tested math.bi I found that only the first 38 of the 178 functions included are actually exported from msvcrt.dll. Of the 140 that are not exported, and judging from a spot check only, some are not documented (here), and many are specialized for data types other than double.
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Postby relsoft » Jun 05, 2006 6:58

VirusScanner wrote:I wouldn't exactly say a hybrid between QB and C, because almost none of the syntax is borrowed from C, only the features.

Pritchard wrote:FB supports just about everything QB did, except the unnecessary crap.

I think line numbers are unnecessary crap, but maybe that's just my opinion...


Line numbers are a necessity to me, since some programs of mine would not wrk without them. :*)

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 1 guest