Jump to content

Virgo

Members
  • Content Count

    86
  • Joined

  • Last visited

Everything posted by Virgo

  1. Virgo

    MAP2PDB - Profiling with VTune

    Is map file format different in older delphi versions? With Delphi 5 and Delphi XP map files it always fails with "Overlapping segments".
  2. Virgo

    Something is Killing my application

    If application needs to be run at computer startup and even when user is not logged in, then I would suggest creating Windows service.
  3. Virgo

    Something is Killing my application

    The reason I asked about how the program is started, that when it is started with Task Scheduler (sometimes programs use Task Scheduler to start program at user login) then there is check mark at trigger properties "Stop task if it runs longer than:" which defaults to 3 days. Maybe it is accidentally checked (it is not checked by default).
  4. Virgo

    Something is Killing my application

    How is the program started originally?
  5. Virgo

    Update hidden file

    Right. And fpc allows in objfpc mode multiple constructors without overload, which explains why TFileStream in fpc has two constructors (2 parameters and 3 parameters), but does not allow creating TFileStream with THandleStream constructor.
  6. Virgo

    Update hidden file

    So it appears, that calling TFileStream.Create with handle parameter works because, TFIleStream has constructors with overload; That is something, that I newer knew. Works in all Delphi ja FPC versions. Just in FPC TFileStream constructors are not with overload;
  7. Virgo

    Update hidden file

    Strange. Passing handle to TFIleStream.Create does not work in Delphi 5, but works in Delphi XE. It also does not compile in FPC 3.2.0. And I do not understand, why it compiles with Delphi XE. After all, TComponent.Create; does not compile....
  8. If UseLastKnownVersion is True, then try installing also libpython3.X-dev package. Or set UseLastKnownVersion to false and assign DllPath and DllName
  9. libvlc_media_tracks_release( LTracksPtr, LCount ); should be correct In get function tracks is var parameter. Which is pointer. So that LTracksPtr itself is required parameter for release. You can also always add types Plibvlc_media_track_t = ^libvlc_media_track_t; PPlibvlc_media_track_t = ^Plibvlc_media_track_t; and then functions would be function libvlc_media_tracks_get(p_md : libvlc_media_t_ptr; var tracks : PPlibvlc_media_track_t ) : LongWord; cdecl; procedure libvlc_media_tracks_release(tracks : PPlibvlc_media_track_t ; i_count : LongWord ); cdecl;
  10. Virgo

    Macro substitution in Locate

    What is the actual question? That is what locate function does. You pass fieldname and search value at runtime and it searches.
  11. Virgo

    Delph ERP Help

    Bpl is basically just dll file with different extension (Borland Pascal Library). You cannot edit those in notepad. If SQL is in resources, then you might be able to change that resource with resource editor (if bpl is not digitally signed). But then your query will only ever return first 100 records.
  12. So it is different in different Delphi versions.... In Delphi XE StringReplace does not use Pos... Instead it uses SysUtils.AnsiPos. But on possible reasons why on negative cases (search string is not found) StringReplace is slower to return then checking with Post before (just in case sensitive version and on Delphi XE): Multiple functions calls to find position of search string (StringReplace->AnsiPos->StrPosLen->StrLComp String concatenation always.
  13. Yes. Those used AnsiPos that calls AnsiStrPos, which has PChar parameters. And then ends up calling StrLen on both strings. Which basically means multiple full string scans. But Unicode version does not have such obvious problem.
  14. That speed difference probably depends also on Delphi version. Looking at the code ansi versions of Delphi would have been much slower on those negative cases. In Unicode version I do not see any obvious problems.
  15. Virgo

    Sql Delete

    You cannot join in delete statement.
  16. Virgo

    Sql Update

    There is not alias I on assignment... So the error is correct. Replace I.CURRATE with select to get correct value.. Maybe? SELECT I.CURRATE FROM INVOICE I WHERE I.RNO = ID.RNO
  17. Virgo

    Filter on InternalCalc field

    Ok, so it is dependant of actual TDataSet descendant. Anyway, did some reading and for Interbase/Firebirdsql fields declared in server as COMPUTED BY fields are also InternalCalc fields in Delphi (with IBX and components forked from it). Basically very specific usage.
  18. Virgo

    Filter on InternalCalc field

    I just managed to get InternalCalc field in my older version of Delphi and there it still behaves as normal calculated field in filters and sorting (not working). Maybe it depends on particular TDataSet descendant having support for this.
  19. Virgo

    Filter on InternalCalc field

    You could try adding somethin like following to select (example is for Firebirdsql, mod is different in MSSQL CASE WHEN EXTRACT(MONTH FROM DATEFIELD) < 4 THEN CAST(EXTRACT(YEAR FROM DATEFIELD) - 1 AS CHAR(4)) || '-' || CAST(MOD((EXTRACT(YEAR FROM DATEFIELD)), 100) AS CHAR(2)) WHEN EXTRACT(MONTH FROM DATEFIELD) > 4 THEN CAST(EXTRACT(YEAR FROM DATEFIELD) AS CHAR(4)) || '-' || CAST(MOD((EXTRACT(YEAR FROM DATEFIELD)+1), 100) AS CHAR(2)) WHEN EXTRACT(MONTH FROM DATEFIELD) = 4 THEN CASE WHEN EXTRACT(DAY FROM DATEFIELD) < 7 THEN CAST(EXTRACT(YEAR FROM DATEFIELD) - 1 AS CHAR(4)) || '-' || CAST(MOD((EXTRACT(YEAR FROM DATEFIELD)), 100) AS CHAR(2)) WHEN EXTRACT(DAY FROM DATEFIELD) >= 7 THEN CAST(EXTRACT(YEAR FROM DATEFIELD) AS CHAR(4)) || '-' || CAST(MOD((EXTRACT(YEAR FROM DATEFIELD)+1), 100) AS CHAR(2)) END ELSE NULL END cTaxYear But that does gives 2006-7 instead of 2006-07....
  20. Virgo

    Filter on InternalCalc field

    Ok, documentation seems to indicate, that InternalCalc fields are supposed to work, like you describe. But in my testing in older Delphi version I cannot manually add them to dataset (unlike calculated fields)...
  21. Virgo

    Filter on InternalCalc field

    In original SQL query?
  22. Virgo

    Filter on InternalCalc field

    How is this field calculated? Because if it is calculated in OnCalcField event, then it is not really InternalCalc field.
  23. Virgo

    Problem with FPC

    But also, from if (P = nil) or (PyBytes_AsStringAndSize(presult, P, Len) < 0) then begin "(p = nil) or" should be removed, because P is uninitialized, which only means, that it causes error, when P happens coincidentally initialize to nil.
  24. Virgo

    Problem with FPC

    After reading Python documentation I do not understand, how it can work in Delphi. Move _stream := TMemoryStream.Create(); try _stream.Write(P^, Len); _stream.Position := 0; Image1.Picture.Graphic.LoadFromStream(_stream); finally _stream.Free; end; before finally Py_XDECREF(pResult); end; P will be reference to internal buffer in pResult and Py_XDECREF(pResult); frees that memory.
  25. Virgo

    Problem with FPC

    Right, there was or, so p value was red herring. Although (p=nil) check is invalid anyway, because value of p is undefined there.
×