

               DESIGNING FOCAL PROGRAMS IN OTHER LANGUAGES
               -------------------------------------------



Some times is better to design a program in your favorite language
and later translate it to FOCAL.



I am providing here a example. The goal is to write a program for
find the Fibonacci numbers.



The first two numbers of Fibonnacci are 1 and 1. The following numbers
are the sum of last two previous numbers.



So the secuence is:

1,1,2,3,5,8,13,21,34,55,89, ...

The first Fibonnacci number is 1
The second is 1
The third is  2
The fourth is 3
The fifth is  5

and so on ...



I designed the program for calculate a fibonacci number in Foxpro.
The source for this program is in FIB1.PRG



I tested it in Foxpro until it was OK. Later I edited each line of
the source writing at left the FOCAL commands and at right the
Foxpro commands.



This could be seen in FIB2.PRG



Later, I used FREEFOCAL for the translation to FIB3.PRG and
PRGTORAW (with HP41UC) for creating FIB3.RAW



FREEFOCAL FIB2.PRG FIB3.PRG
PRGTORAW FIB3



At last, I imported the program to V41 and SIM41.



Then I tested it in the emulators. The behavior of the
program was right.





