De curand mam imprietenit cu fostul admin al acestui forum "Rock" si mia aratat cateva chestii interesante despre variabile si am zis sa vi le impartasesc si voua. Este vorba despre Hungarian Notation. Iam vazut cateva coduri mai noi si a inceput sa foloseasca aceste prefixe desii eu nu prea inteleg ce e cu ele dar totusi mi sa parut folositor. Cum mia spus si el, poate ati vazut si voi cum arata codul lui Slice, toate variabilele au un prefix si acum miam dat seama ca nu e la intamplare. Un exemplu { // Put all the benchmarking code inside a block so we can use it multiple times without "variable already exist" errors.
new
iMeasureTime = %0, // Number of milliseconds to run the code
iCount = 0, // Number of time the code was executed
iTick = GetTickCount( ), // Current tick
iStartTick, // The tick when the benchmarking started
bool:bWarmup = true // Warmup?
;
do { } while ( iTick == GetTickCount( ) ); // Wait and start right after the tick counter goes up (for precision)
iTick = GetTickCount( );
iStartTick = iTick;
while ( iTick - iStartTick < iMeasureTime || bWarmup ) // While the execution time hasn't exceeded iMeasureTime or warmup
{
if ( bWarmup ) // If we're in a warmup..
{
if ( iTick - iStartTick >= iMeasureTime ) // ..and the time has passed
{
bWarmup = false; // No more warmup
iTick = GetTickCount( );
do { } while ( iTick == GetTickCount( ) ); // Wait for the next tick
iTick = GetTickCount( );
iStartTick = iTick;
iCount = 0; // Reset the counter since we just did the warmup
}
}
{
Mam uitat pe wikipedia in acel articol si i-ul ala vine de la
iSize : integer (Systems) or index (Apps) b-ul de la boolean si tot asa.