







                                V B F

                       Visual Basic Formatter

                      Version 98.05 (May 1998)







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


                             User manual











                 For friends of FREEWARE prepared by


                        Ing. Branislav Stofko

                           Trebisovska 21

                     821 01 B R A T I S L A V A

                              SLOVAKIA


              Copyright 1997-98 by B. Stofko Bratislava
                         All Rights reserved


1.   Introduction
     -------------

  If  you  are  working  with  modern  methods  at  programming, it is
normally  that your  program consist   from more  than one  module. If
modules  are  small  it  is  no  need  for  cross-reference listing of
variables and my program can be written easy.

  In  my  primary  programming  language   FORCE  I  make  usually  no
difference between IF THEN ELSE and If Then Else or iF tHen ELse. This
type  of writing  can make  a work   and life  much easy,  i can  more
thinking about programming and not about SHIFT key at keyboard.

  However, after some times show my  program strange and of course not
useful for next  modifications. This is a time  in, which is necessary
to have  a program for source  code reformatting. This program  can do
all things for  me and I am able  make a break to show  through window
how weather we have today.

  In  the programming  language VISUAL  BASIC is  the propper style of
writing important too.  But today I am not agree  to do this manually.
I now from  my practice that is  not easy to convince  a programmer to
use  a program  there was  not made  by its  own. However,  to show at
people there are every time editing source code to well looked form is
hopeless.

  My principle is

      A PROGRAMM MUST BE NOT WORKING,
      BUT THE SOURCE CODE MUST BE WELL LOOKING.

  It is more to possible to make well looking program to working as to
make opposite action.

2.   Start of program
     ----------------

     Program VBF will be started with message :

Visual Basic source file reformatter       FREEWARE B.Stofko

Syntax: VBF <filename> [options]

Options: /I:n  use increment of n blanks for indent, default = 3
Options: /S    generate comment lines before and after SUB or FUNCTION
Output:        the same filename !!!

  If you want to reformat program  MAIN.BAS, it is enough to type :

                            VBF MAIN.BAS

  Default indent after command IF is three characters. I think this is
optimally because following  lines will be not to  long for 80 charac-
ters wide display.

  Indent to 8 characters ( 1 Tabulator  ) is too big. But if you will,
you can type VBF MAIN.BAS/I:8 and this is all.
 
                                                          VBF 1 of 4

  Switch  /S force  generation of  comments before  and after keywords
PROCEDURE and FUNCTION. You can reformat files with extension .FRM to.
Don't forget to store source code in ASCII format for this reason.

  Example of bad structured VISUAL BASIC source code :

Function GetDiskSpace (DriveNum As Integer) As Integer
 ' Returns the total and available disk space for the specified drive
 ' driveNum specifies which drive (0 = default, 1 = A, 2 = B, etc.)
 '
' 08-25-97 08:07am prva verzia
'
Dim AX_Flag As Integer
Dim BX_Free As Integer
Dim CX_Cluster As Integer
Dim DX_Total As Integer
Dim BytesPerCluster As Single
'
' Request drive allocation information from DOS services
  AX_Flag = BSGetDiskSize(DriveNum, BX_Free, CX_Cluster, DX_Total)
' Test for error condition
            If AX_Flag <> -1 Then
' Calculate free and total space
      BytesPerCluster = AX_Flag
   BytesPerCluster = BytesPerCluster * CX_Cluster
     TotalSpace = (DX_Total And &HFFFF&) * BytesPerCluster
   FreeSpace = (BX_Free And &HFFFF&) * BytesPerCluster
   '
   'Indicate success
                 GetDiskSpace = True
Else
'Indicate error
                   GetDiskSpace = False
   End If

           End Function

  This text is deliberate bad written.  You can find this text in file
VBF_TEST.OLD. Please make a copy ( not rename ) from this file to file
VBF_TEST.BAS . This file can be after reformatted with VBF.

  After reformatting, will be source code modified following :

'-----------------------------------------------------
Function GetDiskSpace (DriveNum As Integer) As Integer
'-----------------------------------------------------
' Returns the total and available disk space for the specified drive
' driveNum specifies which drive (0 = default, 1 = A, 2 = B, etc.)
'
' 08-25-97 08:07am prva verzia
'
Dim AX_Flag As Integer
Dim BX_Free As Integer
Dim CX_Cluster As Integer
Dim DX_Total As Integer
Dim BytesPerCluster As Single
'
' Request drive allocation information from DOS services
AX_Flag = BSGetDiskSize(DriveNum, BX_Free, CX_Cluster, DX_Total)
 
                                                          VBF 2 of 4

' Test for error condition
If AX_Flag <> -1 Then
   ' Calculate free and total space
   BytesPerCluster = AX_Flag
   BytesPerCluster = BytesPerCluster * CX_Cluster
   TotalSpace = (DX_Total And &HFFFF&) * BytesPerCluster
   FreeSpace = (BX_Free And &HFFFF&) * BytesPerCluster
   '
   'Indicate success
   GetDiskSpace = True
Else
   'Indicate error
   GetDiskSpace = False
End If

End Function
                            W A R N I N G
                           ===============

           VBF write  over the original  source code file.
           You should therefore using VBF carefully.

3.   File summary
     ------------

VBF    .PRG     source code of VBF program

VBF    .EXE     source code reformatting program

VBF    .602     manual in Slovak language, special format

VBF    .TXT     manual in Slovak language, ASCII file

VBF_TST.OLD     bad formatted source code

VBF_ENG.TXT     summary in English, ASCII text file

VBF_ESP.TXT     summary in Spanish, ASCII text file
                (translated by DarkMaP: DarkMaP@HotMail.Com)

In this version are removed bugs with Public Sub and Do Until .


4.   Program registration
     --------------------

  This program  is FREEWARE . You  must not pay any  registration fee.
However, if you send my postcard I  am happy. This type of software is
called as CARDWARE.

  And if you really like this program, why not contact the editors of
your  favorite  computer  magazine  or  newspaper,  or web sities that
rewiew software and tell them abou it  ! That's a great way to make my
work better known.

  If you have any question, you can reach me at Email address :

  <BranoStofko@RocketMail.com> or <BranoStofko@Mailexcite.com>
 
                                                          VBF 3 of 4

  You have not only VBF.EXE but source code too. Maybe you are able to
modify  this source  code for  other compiler  as PASCAL,  C or  maybe
VISUAL  BASIC. Good  luck and   please send  me your  modifications by
Email.

  If you  are able  translate this  text to  your own  language,
please send my a copy by Email.

  The  author of  this program  accepts no  responsibility for damages
resulting from its use and makes no warranty or representation, either
express or implied, including but not limited to, any implied warranty
of merchantability  or fitness for a  particular purpose. This program
is provided  "AS IS", and you,  its user, assume all  risks when using
it.

  This program was made with  database compiler FORCE. This product is
similar  to CLIPPER  but he  can  make  a smaller  EXE file.  FORCE is
a product of :

                 Sophco, Inc.
                 P.O. Box 7430
                 Boulder, Colorado 80306-7430
                 (303) 444-1542

                                * * *
 
                                                          VBF 4 of 4