Jump to content

zinpub

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. zinpub

    FastMM5 LogFile Absent

    Yes procedure TForm4.btnClick(Sender: TObject); begin TStringList.Create; end; FastMM4 catches them.
  2. Can't get log file from FastMM5... Maybe someone can explain what I'm doing wrong? Delphi 11 program Project4; uses FastMM5, System.StartUpCopy, FMX.Forms, SysUtils, Unit4 in 'Unit4.pas' {Form4}; {$R *.res} begin FastMM_LogToFileEvents := [mmetDebugBlockDoubleFree, mmetDebugBlockReallocOfFreedBlock, mmetDebugBlockHeaderCorruption, mmetDebugBlockFooterCorruption, mmetDebugBlockModifiedAfterFree, mmetVirtualMethodCallOnFreedObject, mmetAnotherThirdPartyMemoryManagerAlreadyInstalled, mmetCannotInstallAfterDefaultMemoryManagerHasBeenUsed, mmetCannotSwitchToSharedMemoryManagerWithLivePointers]; FastMM_SetEventLogFilename('D:\log.txt'); FastMM_EnterDebugMode; ReportMemoryLeaksOnShutdown := True; Application.Initialize; Application.CreateForm(TForm4, Form4); Application.Run; end.
  3. Well, the transformation of the "any - possible" date is not a task for one function 🙂
  4. function TForm7.StrToDateFrmt(const iFormat, iDateStr: string): TDateTime; var AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word; aPos: Integer; procedure InitVars; begin AYear := 1; AMonth := 1; ADay := 1; AHour := 0; AMinute := 0; ASecond := 0; AMilliSecond := 0; end; function GetPart(const iPart: Char): Word; var aYCnt: Integer; begin Result := 0; aYCnt := 0; while (aPos <= High(iFormat)) and (iFormat.Chars[aPos + aYCnt] = iPart) do inc(aYCnt); Result := StrToInt(iDateStr.Substring(aPos, aYCnt)); aPos := aPos + aYCnt; end; begin InitVars; aPos := 0; while aPos <= High(iFormat) do begin case iFormat.Chars[aPos] of 'Y': AYear := GetPart('Y'); 'M': AMonth := GetPart('M'); 'D': ADay := GetPart('D'); 'H': AHour := GetPart('H'); 'N': AMinute := GetPart('N'); 'S': ASecond := GetPart('S'); 'Z': AMilliSecond := GetPart('Z'); else inc(aPos); end; end; Result := EncodeDateTime(AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond); end;
  5. zinpub

    Delete Error With Delphi and Access Table

    just saw ! Your SQL is 'ID Delete from Ledger ..... ' 🙂
  6. zinpub

    Delete Error With Delphi and Access Table

    Much better use ParamByName
  7. zinpub

    Delete Error With Delphi and Access Table

    Is there space before "Where" or after "Ledger" ? Try print in one string .... const sSql = "Delete from Ledger where LedgerDate between %s and %s"; Query.Sql.Text:= Format(sSql, ['01.01.2019', '01.01.2019']);
  8. zinpub

    Releasing memory devoted to arrays

    FieldByName raise Exception if there are no fields with such names. FindField return nil
×