Beispielcode


Die Kodebeispiele enthalten englische Kommentare und Bezeichner, da sich dies aufgrund der zunehmenden Internationalisierung der Projekt-Teams als sinnvoll herausgestellt hat.

Für C++

/********************************************************************/
/* Function:     Gets the unique user number for a given user name. */
/* Author:       John Doe                                           */
/* Parameter:    par_UserName - Name the affected user              */
/* Return Value: Unique number for the affected user                */
/*               If the user is unknown 0 will be returned          */
/* History:      28 Dec 1999 - JD - Function created                */
/*               05 May 2000 - JD - Plausibility check included     */
/********************************************************************/  
int GetUserNumber(string par_UserName)
{
   UserClass UserClassPtr;  // Pointer to user object we need for getting 
                            // the user number
   // Create an user object
   UserClassPtr = UserClass(par_UserName);

   // Check if the user correct
   if (UserClassPtr != Null)
   {
      // Return the number of the user
      return UserClassPtr.GetUserNumber();
   }
   else
   {
      // Return 0 ==> User unknown
      return 0;
   }
}  // End of function GetUserNumber()