The Liberty Basic Newsletter - Issue #22 - Oct 98
  "The only stupid question is the one you don't ask"!


In this Issue:
               1)  Writing a program in LB
               2)  Have you YOU contributed lately

               ****************************
                                             

1)  Writing a program in LB

I think its time to get the newsletter back to some tutorials
to help the newer LBers.  With this in mind, the following

article is about the steps you go through to develop a program.

A professional programmer has his program fully planned before
he even writes a single line of code.  If fact, writing the 
code is the easy bit - its the planning stage where all the
details get sorted out that takes the time and effort.

But many LB programmers are self-taught hobbiests without
any formal training.  So to visualise an entire program, the
user interface, the functions needed, etc. is very difficult.

Additionally, people think differently.  Some people think
in a visual manner - and therefore have little difficulty in
imagining what the user interface will look like - but have
problems with planning the internals.  On the other hand, I
don't think visually - I think in terms of function - and
so I find it very hard to visualise the user interface - 
but I find it very easy to think about the functions that
I will need for for a program.

An LBer who is only just learning to how program may well 

have difficulty in both areas.  So, hopefully, this article
will help you start thinking in a 'programmer-type' manner.


STEP 1.

The first step you should go through is to write out in
plain English (or whatever your first language is) the
requirements of program.  You don't need to be too detailed
at this stage - maybe just a list of points for you to 
remember to take care of.  (Once again, an example of how 
people think differently.  I tend to use a list of important

points - but some others may prefer to use a narative type
style - use a style that YOU are comfortable with!).

Keep this document as a text file in the same directory where 
you are writing the program, and keep referring to it.  Also, 
as you get new ideas, update this document.  By the way, the 
document is called the "Program Specifications" or, in 
programmer-speak, it is referred to as "the specs".


STEP 2.

If you are a 'visual-thinker' try to imagine what the user

interface will look like.  Draw it on a piece of paper, 
or map it out using FreeForm (yes, I will get to doing a 
Newsletter on FF very soon).  

If you are a 'function thinker' - update your specs with 
a list of functions you think you will need.  eg:

Get User Input
Add Record to Database
Display Database Record
Update Database Record
etc

NOTE:  By functions I do not necessarily mean code that
will be activated by a GOSUB.  I just mean code that 
will be required to implement a specific action - how

it gets implemented is determined later.


By the way, in some ways, the visual thinkers have the edge
here, even if they don't know it.  By visualising the
User Interface, they tend to think about the Menu Options, 
Buttons, Listboxes, etc.  In reality - these components make
the list of functions that will be required by the program!


STEP 3.

Now, lets start doing some coding.

DON'T try to write your whole program in one go.  What we do
is simply write our functions one at time and test them as

we go.  Use the LB Default window (by NOT using the NoMainWin
command) to display test results.

As each function is written and tested, just add the next
function to the same source code - so that you are slowly
building your program as you go along.

And for the function-thinkers, don't worry about the user
interface at this stage - but slowly evolve the interface
as you add Buttons and menu items to be used to test your
functions.  The interface will probably look very messy

by the time you have written the program - but don't
worry - with the functions all working, its now a lot 
easier to come up with a interface design now that you can
see it all on the screen.  Means a little bit of rewriting,
but if the program is important - the effort is worth it.

The next issue will take some 'specs' and go through the process
of turning them into a program.


                        *************

2)  Have you YOU contributed lately

OK, don't get mad at me, I'm just on my hobby-horse again,
but please take the time to at least read this.

The LB community is a wonderful sharing group of people, 
giving their time, and in some cases, their money, to 
benefit all LBers.  But YOU can contribute too!!!  Even if you
are new to LB - there are things that you can do to be a truly 
ACTIVE member of the community.

a)  Have you registered your copy of Liberty Basic?

Carl provides LB without any nag-screens, timebombs, crippled

code, etc.  But it is shareware.  If you use it, you should
register your copy.  It doesn't matter whether you intend to
distribute programs - or just use LB for your own personal
fun and enjoyment.  If you use it - you should register -
otherwise you are cheating and depriving the author of his
rights to royalties.

b)  Have you 'clicked' an advert at LB Network?

The LB Network plays host to countless submissions of 
contributions by other LBers.  Plus they host a message board,

a chat room and give away FREE server space to any LBer who
wants to set up a LB site of their own.  This all costs money.
You can contribute to this wonderful site just by clicking an
advert banner on their main page.  You don't have to buy 
anything - just clicking the banner and viewing the sponsor
site generates a few cents of income for LBNetwork to help 
pay the bills.

c)  Have you Commented on an article in the LB Newsletter.

Alyce and I spend a great amount of time to produce these

newsletters - and we enjoy doing it.  But when we get a 
suggestion, a question, a correction, etc - we enjoy it 
even more.  Because that lets us know that we are producing
something that is being read and is of interest.  


So please - be ACTIVE - be a CONTRIBUTER - don't just be a TAKER.
               
--------------------------------------------------------------
 Newsletter written by: Brosco.
 Comments, requests or corrections mailto:brosco@orac.net.au


 Translated from Australian to English by an American:
 Alyce Watson -  Chief Editor.  Thanks Alyce.

--------------------------------------------------------------