27 June 2010

A GFA-BASIC32 Forum

I'm joining a forum now.

http://gb32.proboards.com/

The administrator Detlef Peters AKA 'Joshy' convinced me of the relevance of this forum. He has created plug-ins, DLLs, libraries to be used with Basic4GL, but he thinks this language is dead and no longer supported. He also thinks that quite some Basic4GL users might switch to GFA-BASIC 32. They are welcome and might need technical support. Joshy seems knowledgeable and serious, and therefore I decided to join, although I don't like forums, I prefer mailing lists, but what the heck I'll give it a try.

I will check in as much as possible, but will limit myself to answering GFA-BASIC 32 related questions and problems. General Windows programming issues should be solved by studying (VB) books and other samples. For me, it is no longer opportune to answer questions like "what is the difference between ByVal and ByRef?" The internet is full with good explanations. I will go into questions of why you should use ByRef explicitly in non-event Sub subroutines

13 June 2010

Exe without runtime?

One of the questions I got is:

"There is a possibility that my program e.g. "name.g32" run as "name.exe" after compiling without using "GfaWin32.Ocx" ?
If yes, can you give me instructions for this please ?

At the first beta introduction of GFA-BASIC 32 back in 1998 we asked the same question. Why wouldn't it be possible to statically link the necessary code into the EXE? That would give us a slightly larger EXE, but the result would be one file. There are two reasons why this isn't possible.

  1. The entire interface of a GFA-BASIC 32 program is encapsulated in to COM objects. All COM objects are related to each other and thus the stand-alone EXE would increase with about 500 KBytes. GFA simply choose to put the code in a single (in contrast with VB!) OCX runtime. Putting OLE/COM stuff in a DLL is common to all programming languages.
  2. The Windows OS is capable of sharing one instance of a DLL with multiple EXEs. Not only your EXE depends on the runtime, but the IDE does as well. All instances of your programs and all instances of GFA-BASIC 32 IDEs share this one DLL. 

Mailinglist off-line

It seems the gfa@liebenstein.de mailinglist is currently offline. I hope this will be fixed soon, otherwise we will have to look for an alternative. For the moment, if you have urgent questions you can ask me at gfabasic32@gmail.com.

10 June 2010

New 'old-GFABASIC 32- samples'

Harald Bonsel posted me the following:

"I found an old directory of GFA ftp://ftp.gfa.net/pub/gfa/

. May be you out the link on your  Google page?"

It turned out that the old site contains some never published samples. so check it out.

 

Be a game-programmer!

I've ported MiniB3d (a library, originally developed for BlitzMax, http://blitzbasic.com/ ) to a DLL that can be used in FreeBasic, or GFA Basic.

Another FreeBasic user, named super-castle, made include files to use it in GFA basic.
http://www.freebasic.net/forum/viewtopic.php?t=15794
http://www.freebasic.net/forum/viewtopic.php?t=15409

MiniB3D features:
- simple access to OpenGL graphic.
- primitives like CreateCube, CreateCone, CreateSphere...
- animated models
- collisions
- quaternion-based rotations (very useful for flight simulation)
- LOD terrains
- and much more.

I hope that you may find it useful.
Bye!
Angelo Rosina
angros47@yahoo.it;

06 June 2010

An introduction by Troy H. Cheek

On Apr 13, 2009, Troy H.Cheek wrote on his blog about GFA-BASIC: "While there are websites just chock full of VB, QB, and even GFA programming goodness, most of them seem to assume a level of knowledge that your average enthusiast (or even an above average one such as myself) just doesn't have yet. It's all well and good to fill a GFA-BASIC 32 Stuff blog full of articles about "ANSI API functions and RichEdit" and "GetFirstVisible method not implemented", but I'll be the first to admit that I'm not sure what any of that stuff means. Heck, much of "Pointer and Gfa_Var object" was over my head. I guess what I'm asking is this: Where are the websites for down and dirty little GFA BASIC programs? You know, the type that the average man on the street (well, geek in the lab) is actually going to write?"

Well, Troy wrote a series on one: "Roll Your Own GFA BASIC Program 1"

Swap two characters

I am a bad typist. I often hit the wrong keys on my keyboard. I never learned to type using 10 fingers, I only use one finger a time. The faster I type the more errors I make. It turns out however, that two kind of errors show up most frequent.
The first error concerns hitting the wrong key. Most often I hit the key next to the key I want to press. I have to go back to the position have to delete the character and retype the correct letter. I cannot speed up this kind of restoring.
The second typing error I often make is hitting keys in an incorrect order. An incorrectly spelled keyword in GFA-BASIC 32 marks the source code line in "error-state" after hitting [Enter]. That is the moment I realize I mistyped something. For instance:
Locla Bool fCommentLine
This kind of error is very easy to correct. Put the caret between the l and the a and then hit Ctrl-T. This swaps the two characters at either side of the caret.