Begin
Pindex:=1;
SetLength(Prow,0);
While not(a=1) Do
Begin
SetLength(Prow,Pindex);
If (a mod PrimeTable[Pindex]) = 0 Then
Begin
a := a div PrimeTable[Pindex];
Inc(Prow[Pindex-1]);
End Else
Begin
Pindex := Pindex+1;
if (Pindex=CPrimeLast) Then
raise EFactorizeException.Create('Prime Index out of range. The number is too big to factorize');
End;
End;
result := Prow;
End;

i guezz i should make a thread that calculates primes while running and make a nice data structure to store it. anyway i'm stuck to the limit of high(cardinal), I'm working on a !!!BIG!!! number structure..

shurl i'll lose but this may be code that other may improve on, or just (re*)-steal and use.

Featured Post

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

A lot of questions regard threads in Delphi.
One of the more specific questions is how to show progress of the thread.
Updating a progressbar from inside a thread is a mistake.
A solution to this would be to send a synchronized message to the…

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech.
SAPI Installation
First you need to install the SAPI type library, th…