Visual FoxPro

Factorial of a Number in Visual FoxPro

 In this article, I will show you how to write a program using a Microsoft Visual Foxpro to ask the user  to give a number, and then the program will compute the factorial value of the given number by our user and  display the results on the screen. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following,, and
My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.
Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price.

Program Listing

* Object : Command1      Procedure: Click
* Created By Jake R. Pomperada, MAED-IT, MIT
*  /
* Microsoft Visual Foxpro 9.-
* Bacolod City, Negros Occidental, Philippines
   f = VAL(thisform.txtNumber.Text)
    LOCAL i, r

    r = 1
    FOR i = f TO 1 STEP -1
        r = r * i
thisform.label2.Caption = "The factorial value is " + LTRIM(STR(r)) + "."

* Object : Command2      Procedure: Click

thisform.txtNumber.value = ""
thisform.label2.Caption = ""