AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Hilfe beim Übersetzten von C in Delphi

Ein Thema von simjoh · begonnen am 23. Mär 2007 · letzter Beitrag vom 1. Apr 2007
 
simjoh

Registriert seit: 13. Nov 2006
Ort: Asslar
99 Beiträge
 
Delphi 7 Enterprise
 
#11

Re: Hilfe beim Übersetzten von C in Delphi

  Alt 23. Mär 2007, 13:59
Die gesamte Funktion sieht so aus:

Delphi-Quellcode:
   bool WriteHandHistoryLog(const char* TableName,const char* HandNumber,
      const char* Buffer,const unsigned int BufferLen)
   {   // This function writes the Buffer out to the given logfile.
      // It writes in binary mode exactly BufferLen bytes.
      // NOTE: If HandNumber is NULL, then we wont print the hand start prefix.
      // Returns true on success, else false.

      // Used to make the full filename.
      char NewName[MAX_STRING];

      // Output filestream.
      ofstream OutFile;

      // Make the new name.
      sprintf_s(NewName,"%s.%s",TableName,GL_Extention);

      // Attempt to open the logfile.
      OutFile.open(NewName,ios::app|ios::binary);
      if (OutFile.fail())
         return false;                  // Failed to open the file.

      // First we need to write the prefix string for new hand.
      if (HandNumber!=NULL)
         OutFile << "Game #" << HandNumber << " starts." << endl << endl;

      // v0.06: If we have been asked to add the 6-max tag, then do so here.
      //        ### NOT really a good place to do this... ###
      if (GL_Add6MaxTag==true) {
         int RMIndex=GetIndexToNextSubString(Buffer," (Real Money)",BufferLen);
         if (RMIndex>=0) {
            OutFile.write(Buffer,RMIndex);
            OutFile.write(" (6 max)",strlen(" (6 max)"));   // Add the 6-max tag.
            OutFile.write(Buffer+RMIndex,BufferLen-RMIndex);
         }

         else {
            OutFile.write(Buffer,BufferLen);   // If can't find, just write as normal.
         }

      }
      else {

         // Write the rest of the buffer.
         OutFile.write(Buffer,BufferLen);
      }


      // Close the file.
      OutFile.close();

      // If we got here, then all ok.
      return true;

   } // End WriteHandHistoryLog.
Scheiße, dass ich so gar keine Ahnung von C hab.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:30 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz