Article ID: 153200
Article Last Modified on 12/1/2003
CLEAR
SET TALK OFF
x=0
@ 1,10 SAY "Please enter a positive integer" GET x
READ
x=ABS(x)
FOR i=2 to x-1
IF MOD(x,i)=0
@2,10 SAY "The number "+ ALLTRIM(STR(x))+ " is not prime."
RETURN
ENDIF
ENDFOR
@ 2,10 SAY "The number "+ ALLTRIM(STR(x))+ " is prime."
SET TALK ON
While this program uses the READ statement for backward compatibility with
FoxPro 2.x versions, the basic algorithm may be used in a form within
Visual FoxPro.
Additional query words: VFoxWin VFoxMac
Keywords: KB153200