Controls ClearTextBox
Controls OpenTextBox

Button 1 Label PrimeNumber
Button PrimeNumber Color Green
Stop

Label PrimeNumber
	Variable Numeric n1 = 2
	Variable Numeric n2 = 2
	Variable Numeric isPrime = 1
	
	For v1 = 2 To Infinity
		
		
		n2 = 2
		isPrime = 1
		
		For v2 = 2 To n1-1
			If Mod(n1, n2) = 0
				isPrime = 0
				Exit
			EndIf
			
			n2 = n2 + 1
		Next
		
		If isPrime = 1
			Print n1 + " "
		EndIf
		
		n1 = n1 + 1
	Next
	
Return


