List All Pages
I topped a rise and stood on the crest of the jagged mountain peak. Above me, the sky glowed like molten copper. Black clouds formed above the peak, twisting into lurid demon shapes before...
The program demonstrates using the And operator to mask values.
'And Operator
'Demonstrates using the And operator to mask values.
'*************************************************
'Declare...
Math is an essential part of programming, and FreeBasic has a rich set of arithmetic operators available. The following table lists the arithmetic operators. The operators will work on two or more...
Arrays are probably the single most useful programming construct that is available to you in FreeBasic. Many problems that you will try to solve with a programming solution involve data arranged in...
“Mr. Jones?”
Theodore heard someone calling his name, softly, from very far away. He looked but only saw a gray mist in every direction.
“Mr. Jones?” The voice called again, closer. He...
This program demonstrates a basic pointer data type.
'Basic Pointer
'Demonstrates a basic pointer data type.
'********************************************
'Create a pointer - doesn't point to...
This program illustrates binary numbers and shows how negative numbers are stored with a sign bit in binary form.
'Binary Numbers and Sign Bit
'Demonstrates binary numbers and shows the sign bit...
FreeBasic includes a number of operators that manipulate the bits of a number. The following table lists the bitwise operators in order of their precedence. That is, the first row has the highest...
I came across an old (1995) classic book Black Art of 3D Programming online. This book was written before DirectX or Open GL were available on personal computers and teaches you how to build a 3D...
This program demonstrates the use of Cast and data type conversion functions.
'Cast and Conversion
'Demostrates using Cast and data type conversion...
This is the code for the light cycle program listed in Chapter 2. I have preserved the C comments for reference into the C source. My changes are marked with RDC.
'Light.bas
'Example program...
The original code used Mode 13h of the VGA card which was 320x200 and 256 colors. In the conversion code I am using Screen 18 which is 640x480 and I am using 32bit color mode. Using 32bit colors...
There are times when creating a program that you may want to define an aggregate structure such as a personnel record, or an enemy in a game. While you can do this using individual data types, it...
You can contact Richard D. Clark via email:
rickclark58 [at] sbcglobal [dot] net
When you work with numbers there will come a time when you will need to convert a variable from one data type to another data type. In FreeBasic there are two types of data conversion. Implicit,...
This program demonstrates some of the CRT character functions.
'CRT Character Functions
'Demonstrates some of the CRT character...
This program demonstrates how to use a function pointer with the CRT QSort function.
'Function Pointers and QSort
'Demonstrates how to use a function pointer for the CRT QSort...
This program demonstrates the CRT Strtok function.
'CRT Strtok
'Demonstrates the CRT strtok function.
'*****************************************
#include once "crt.bi"
Dim As String tstr,...
“Thirty meters,” Wildman thought to himself, “just thirty meters to go.” His legs were aching as he ran down the narrow corridor toward a large crate filled room. The anti-grav boots he...
1: UAC Headquarters
“Are you sure it will be safe?” William Muse, UAC Chief Executive Officer asked the men gathered around the table. Muse was a good-looking man, his black hair touched with...
Introduction
A dynamic array in a type definition is a very useful feature, but FreeBasic doesn't support it. Or rather, it doesn't support it directly. However, you can create dynamic arrays by...
Blade slowly pushed open the metal door to the side entrance of the hangar and slipped inside. He drew his Smith & Wesson .44 Magnum, checking to make sure he had a full clip and stood by the...
The program uses the Eqv operator to test the equivalence of two statements.
'Eqv operator
'Demonstrates the Eqv operator and equivalence.
'**********************************************
#define...
The program demonstrates using the numeric conversion functions to explicitly convert between data types.
'Explicit Conversion
'Demonstrates explicitly converting data...
I have written some fan fiction over the years, mostly as writing exercises. Having a pre-built setting and/or characters to work from is both easy and hard; easy since the background has already...
If we look at the fact, we shall find that the great inventions of the age are not, with us at least, always produced in universities.
Charles Babbage
On this page you will find a list of...
This program demonstrates how to create and use a function pointer.
'Function Pointer
'Demonstrates how to create a function pointer.
'**************************************************
'Declare...
In order to use the new additions to the language, you will need to download the CVS version of the compiler located at http://ecowles.dyndns.org/fbdu/. You select the large version if you are...
Military Mining Station MN-1324
Peabody tried to wipe the sweat from his forehead, but only succeeded in smearing the grime that clung to his skin. “I’ll be glad when I get rotated out of this...
The program is the classic example used to test a successful compiler installation.
'Hello World Example
'Test Compile Example
'**************************************
Cls
Print "Hello World From...
The program demonstrates using the Declare statement and defining a function.
'Hello World 2
'This example demostrates using a Declare statement
'and function...
The program demonstrates using the HiWord and LoWord functions to store a screen location in a single uinteger.
'HiWord and LoWord Functions
'Demonstrates using the HiWord and LoWord...
“Man, that was a pretty decent turkey dinner,” Willy said. “See, Cookie can do some decent stuff if he tries.”
“I am amazed,” Sam said. “It was actually edible.”
“Hey, you want to...
If you are allowed to edit pages in this Site, simply click on edit button at the bottom of the page. This will open an editor with a toolbar pallette with options.
To create a link to a new page,...
This program demonstrates the implicit conversion from one data type to another data type.
'Implicit Conversion
'Demonstrates the implicit conversion between data...
This program demonstrates the differences between the Int and Fix functions.
'Int and Fix Functions
'Demonstrates the difference between Int and...
Controls structures allow you to change the flow of your program, to execute different parts of your program based on certain criteria and to iterate through code blocks. Control structures fall...
Introduction
Understanding pointers is crucial for programs that need both speed and flexibility. This article introduces the pointer data type and how to use a single pointer variable and memory...
Introduction
FreeBasic is moving towards implementing Object Oriented programming. While classes have not yet been added to the language, the Type definition has been extended to include some...
Please change this page according to your policy (configure first using Site Manager) and remove this note.
Who can join?
You can write here who can become a member of this site.
Join!
So you...
The program multiplies two numbers using the Log function.
'Log Function Example
'Multiplies two numbers using the log method.
'***********************************************
Const base10 =...
The Problem
One of the continuing problems of software design is managing complexity in large programs. The problem is easily defined: as a program grows, the number of interactions between code...
Introduction
In Part 1 I introduced the idea of program complexity. In this article, I take a deeper look at the problem.
What is Complexity?
First though, let me define complexity in relation to...
"On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of...
In addition to the arithmetical functions, FreeBasic has a rich set of mathematical functions. These functions are listed in the following table.
Function
Syntax
Comments
ABS (Absolute Value)
B...
Chuck, dressed in the white gown that all inmates of Poco State Mental Hospital wore to bed, gripped the motorist by the neck and slowly squeezed the life out of him. Looking down into the...
The intercom buzzed on Johnny Mercury’s desk. “Your two o’clock appointment is here,” Kelly, his receptionist, said.
“Send her in,” Johnny said, coming around to the front of his desk....
The program demonstrates how the Not operator functions.
'Not operator
'Demostrates using the Not operator
'*********************************************
Dim As Byte myByte = 5
'5 in decimal...
When starting out with a new programming language, one of the first things you should learn is the language’s data types. Virtually every program manipulates data, and to correctly manipulate...
This program demonstrates the compiler operator in evaluating expressions and how to force evaluation using parenthesis.
'Operator Precedence
'Demonstrates how the compiler uses operator...
The program demonstrates using the Or operator to store multiple
values within a single byte.
'Or Operator
'Demonstrates using the Or operator to store multiple
'values within a single...
The pointer data type is unique among the FreeBasic numeric data types. Instead of containing data, like the other numeric types, a pointer contains the memory address of data.
On a 32-bit system,...
Introduction
In this tutorial you will see how to use pointers with user-defined types as well as how to use pointers within a type definition. You should first read the introductory tutorial on...
This program demonstrates how to use a pointer-to-pointer varibale to create a two-dimensional array.
'Pointer-to-Pointer Example
'Demonstrates how to create a two-dimensional array
'using a...
Demonstrates how to multiply and divide by a power of 2 using the shr and shl operators.
'Shr and Shl Operators
'Demonstrates how to multiply and divide using
'the shr and shl...
Home
Tutorials
FreeBasic
Black Art 3D Programming
Essays
Programming
The Next (R)evolution in Computing
Managing Complexity Part 1
Managing Complexity Part 2
Managing Complexity Part...
Introduction
Polymorphism is a powerful tool in object-oriented program. A polymorphic method (Sub or Function) behaves differently depending on the definition of the object. For example, an animal...
Members:
Moderators
Admins
"Are you in Johnny?" Peterson asked me as I stared at my hand. I was holding four nines and the pot had grown to nearly the size of my paycheck. I had a good hand so I decided to play it for what...
The program demonstrates using static variables within a subroutine.
'Static Variables
'Demostrates using static variables in a subroutine
'************************************************
Sub...
Strange Worlds is an anthology of strange fiction that I am currently working on. When completed, it will be available in a print version on Lulu.com. These stories are works-in-progress which...
Strings are an essential part of programming, and proper manipulation of strings is an essential skill for any programmer. You will need to use strings in virtually every program you will write,...
Constants are values that do not change during the life of the program. Constants are like variables in that the name of the constant refers to the defined value, but unlike a variable, these...
The white-haired man picked up the toy soldier and held it out to Toby who took it from the shaking, bony fingers.
“Is it for me, Papa?” Toby asked.
“It is for you,” Papa answered.
Toby...
You can think of the If statement block as a question that requires a True or False answer. The answer determines which section of code your program will execute. Since computers only work with...
Modern computing has come a long way from the days of Babbage's Difference and Analytical Engines, which are thought by many to the true ancestors to the modern computer, even though neither...
Commander Ghin stood on a pile of rubble and surveyed what was left of the city. At one time this city had been a mighty metropolis, the people of this planet filling the streets, the tall...
The Select Case block can be viewed as an optimized If-ElseIf ladder, and works in much the same way. The standard Select Case can use any of the standard data types for <expression> and the...
Contact
This isn’t an article about the AFL-CIO, but about those strange data structures called unions. Unions are an efficient and powerful way to organize data, but strangely enough, I don’t see many...
Virtual Ink is the central repository for my writing and programming projects. Within these pages you will find my programming tutorials, essays and stories. Check out the menu on the left for a...
Water drips somewhere in the darkness: drip, pause, drip, pause, drip, pause—the sound pounds against my mind, maddening me, driving me to the edge of madness, yet the comfort of oblivion eludes...
According to Wikipedia, the world largest wiki site:
A Wiki ([ˈwiː.kiː] <wee-kee> or [ˈwɪ.kiː] <wick-ey>) is a type of website that allows users to add, remove, or otherwise edit...
This program demonstrates using the Xor operator to swap two variable values.
'Xor Operator
'This program demonstrates using the Xor operator
'to swap two variable...





