Danke für Deine Antwort
traderdoc.
Mal zur Illustration, hier die erste Funktion (die funktioniert - ich baue lieber alles in kleinen Schritten auf):
Code:
void CalcAud()
{
int CountWeaks=0, CountStrongs=0;
for(int j=0; j<ArrayRange(ApairAud,0); j++)
{
if( GetFrontName(ApairAud[j]) ==ApairClass[0]) //InThisPairNameItIsInFront
{
for(int i=0; i<ALoopLimit; i++) //SearchTheSStableForTheName
{
if(SSpairTable[i].SpairName == ApairAud[j] ) //FoundTheSStableName
{
if(SSpairTable[i].SpairPercMove>0) CountStrongs++; //0% is counted weak
else CountWeaks++;
}
SSpairTable[i].SpairStrongs=CountStrongs;
SSpairTable[i].SpairWeaks=CountWeaks;
}
}
if( GetBackName(ApairAud[j]) ==ApairClass[0]) //InThisPairNameItIsInBack
{
for(int i=0; i<ALoopLimit; i++) //SearchTheSStableForTheName
{
if(SSpairTable[i].SpairName == ApairAud[j] ) //FoundTheSStableName
{
if(SSpairTable[i].SpairPercMove<0) CountStrongs++;
else CountWeaks++; //0% is counted weak
}
SSpairTable[i].SpairStrongs=CountStrongs;
SSpairTable[i].SpairWeaks=CountWeaks;
}
}
}
}
Es wird das "kleine" Array untersucht, um die Ergebnisse in der großen Tabelle festzuhalten. (Mit diesen Tabellenwerten wird danach weiter gerechnet).
Ich hätte das jetzt gerne umgewandelt in eine allgemeine Funktion, etwa so:
Code:
void CalcStrongWeak(string ArrayName=??? , int ClassNo=0)
{
int CountWeaks=0, CountStrongs=0;
for(int j=0; j<ArrayRange(ArrayName,0); j++)
{
if( GetFrontName(ArrayName[j]) ==ApairClass[ClassNo])
{
for(int i=0; i<ALoopLimit; i++)
{
if(SSpairTable[i].SpairName == ArrayName[j] )
{
if(SSpairTable[i].SpairPercMove>0) CountStrongs++; //0% is counted weak
else CountWeaks++;
}
SSpairTable[i].SpairStrongs=CountStrongs;
SSpairTable[i].SpairWeaks=CountWeaks;
}
}
if( GetBackName(ArrayName[j]) ==ApairClass[ClassNo])
{
for(int i=0; i<ALoopLimit; i++)
{
if(SSpairTable[i].SpairName == ArrayName[j] )
{
if(SSpairTable[i].SpairPercMove<0) CountStrongs++;
else CountWeaks++; //0% is counted weak
}
SSpairTable[i].SpairStrongs=CountStrongs;
SSpairTable[i].SpairWeaks=CountWeaks;
}
}
}
}
Ich hoffe, jetzt ist klar wohin ich will. Danke. AVT