Jump to content

Virgo

Members
  • Content Count

    106
  • Joined

  • Last visited

Everything posted by Virgo

  1. 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;
  2. 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....
  3. If UseLastKnownVersion is True, then try installing also libpython3.X-dev package. Or set UseLastKnownVersion to false and assign DllPath and DllName
  4. 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;
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. Virgo

    Sql Delete

    You cannot join in delete statement.
  11. 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
  12. 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.
  13. 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.
  14. 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....
  15. 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)...
  16. Virgo

    Filter on InternalCalc field

    In original SQL query?
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. Virgo

    Problem with FPC

    Looking original code in unit1.pas from git: value of P is undefined there, because it is never initialized. What happens, if you add p := nil; at the beginning of Button2Click?
  22. Virgo

    Delphi XE Zebra scanner

    Barcode scanner? Those are usually just USB keyboards. Or are Zebra ones different?
  23. Since it is plain http you can use Wireshark to check, what is different in network request comparing browser and you program.
  24. Virgo

    TButton : How to display the assigned Popup Menu?

    Right... Did not check the FMX part.
  25. Virgo

    TButton : How to display the assigned Popup Menu?

    But what about TButton.DropDownMenu ? I think, that this is intended for what you are trying to achieve.
×