







                                C L F

                          Clipper Formatter

                   Version 2000.02 (Februar 2000)







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


                             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 1996-2000 by B. Stofko Bratislava
                         All Rights reserved

1.   Introduction

     If  you are  working with  modern methods  of programming,  it is
normal  that your  program will  consist of  more than  one module. If
modules  are small  there is  no need  for cross-reference  listing of
variables and the program can be written easily.

     In  my  primary  programming  language  FORCE  I  usually make no
distinction between  IF THEN ELSE  and If Then  Else or iF  tHen ELse.
This type  of writing can  make work and  life very easy,  I can think
more about programming and less about the SHIFT key.

     However, after some time my  program appears strange and not easy
to modify. This is  a time when it is necessary to  have a program for
source code  reformatting. This program can  clarify everything for me
and I can take  a break to see through the window  what the weather is
doing today.

     In the CLIPPER programming  language the situation is complicated
by the  use of Hungarian  style for variable  names. Numeric variables
should be written as nCount,  nTotal and character variables cName and
cCity.

     Well it is not  bad, but my old program cannot do  this. ( all my
variables begin with a capital letter ) and I must write a new one. My
new program CLF  is easy and short because names  of variables are not
changed !

     I  know from  my own  experience  that  is not  easy to  persuade
a programmer to use  someone else's program. However, to  try and show
it to people who are always  editing source code to well-designed form
is hopeless.

  My principle is

      A PROGRAM MAY NOT BE WORKING,
      BUT THE SOURCE CODE MUST BE WELL-DESIGNED.

     It is  easier to get a  neatly laid-out program to  work than one
that is not.

2.   Start of program

     Program CLF will start with the message :

 CLIPPER source file reformatter        FREEWARE B.Stofko/H.Kasinski

 Syntax: CLF <filename> [options]

 Options: /S    DBASE comment lines
 Options: /C    C style comment lines
 Options: /G    generate graphic output to file filename.lst

 Output:        the same filename !!!

If you want to reformat the program  MAIN.PRG, simply type :

                            CLF MAIN.PRG
 
                                                          CLF 1 of 3

     The  default  indent  after  the  command  IF  is two characters.
I think this is best because following lines will not then be too long
for an 80 characters wide display.

     Switch  /S forces  generation of  comment lines  before and after
keywords PROCEDURE and FUNCTION.

     Example of badly structured CLIPPER source code :


procedure prva

  if x = 1
  y = 1
 else
  y =2
     endif

     function druha(dlzka)

  for i := 1 TO  10
    ? i
        next
                         return space(dlzka) + "!"

     This text is  deliberately badly written. You can  find this text
in file CLF_TST.OLD. Please make a copy ( without renaming ) from this
file to file CLF_TST.PRG . This file can then be reformatted with CLF.

     After reformatting, the source code will be modified as follows:

*-------------
PROCEDURE prva
*-------------

IF x = 1
  y = 1
ELSE
  y =2
ENDIF

*--------------------
FUNCTION druha(dlzka)
*--------------------

FOR i := 1 TO  10
  ? i
NEXT
return space(dlzka) + "!"

                            W A R N I N G

           CLF writes over the original source code file.
           You should use CLF with care.

     If you  write a big program  with many IF THEN  ELSE and DO ENDDO
commands,  the  next  possibility  -  to  generate  graphically marked
commands - can be valuable. I am often lost in this situation, but CLF
has helped me. Try using CLF with your source files with switch /G .
 
                                                          CLF 2 of 3

     In new versions  of Clipper is possible to  use C style comments.
Use switch /C if you want to have

// -----------
PROCEDURE prva
// -----------

     With this switch will be all  *--- comments in program changed to
/--- too . On the other hand  is not neccesary to use switchs manually.
Store small .BAT file in directory mentioned in PATH as CLF.EXE too.

     Here is the file CLIFO.BAT

     @echo off
     clf %1 /C

Now call CLF as

CLIFO program.prg

and you have switch /C forever !

3.   File summary

CLF    .EXE     CLIPPER source code reformatting program

CLF    .602     manual in Slovak language, special format

CLF    .TXT     manual in Slovak language, ASCII file

CLF_TST.OLD     badly formatted source code

CLF_ENG.TXT     summary in English, ASCII text file

CLF_DUT.TXT     summary in Dutch, ASCII text file


4.   Program registration

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

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

        <BranoStofko@RocketMail.com> or <bstofko@yahoo.com>

     If you are able translate this  text to your own language, please
send me a copy as Email attachment.

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

                                * * *
 
                                                          CLF 3 of 3