Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. PeterBelow

    HoursBetween

    That's just like HoursBetween works, the return value is an integer, so the difference is rounded to the next full hour. Use MinutesBetween and divide the result by 60 if you want the difference to be in fractional hours.
  3. Henry Olive

    HoursBetween

    Thank you so much Tom, Stano Stano, i know TDateTimePicker is good solution but i want to learn to get time difference between 2 strings
  4. Stano

    HoursBetween

    Why do you use TEdit and not TTimePicker etc.? They are intended for this purpose. It's a big mistake for me!
  5. toms

    HoursBetween

    Maybe use StrToTime()
  6. Henry Olive

    HoursBetween

    Good Day, Delphi 10.3 procedure TForm2.Button1Click(Sender: TObject); var ST,ET : TDateTime; Diff : Double; begin ST := StrToDateTime (Edit1.Text); // Text = 08:00 ET := StrToDateTime (Edit2.Text); // Text = 11:30 Diff := HoursBetween(ST,ET); Edit3.Text := FloatToStr(Diff); The result of above proc is 3 i was expecting 3,5 Thank You end;
  7. Today
  8. I have given up the D5 code. I started from beginning by selecting Multi-Device Application. But I still nead the function to list directory and files, and I have not found any examples for that until now.
  9. Some observations : { V8.65 look for absolute URL sent by proxy } I := Pos('://', FPath); if (I = 4) or (I = 5) then begin FPath := Copy(FPath, I + 3, 99999); // strip http:// I := Pos('/', FPath); // start of path if (I > 1) then FPath := Copy(FPath, I, 999999); // strip host end; Magic numbers 99999 and 999999 to be replaced with actual expected FPath extract length ? else begin { see if we have access to file, but don't read it yet } TempStream := TFileStream.Create(FDocument, fmOpenRead + fmShareDenyWrite); TempStream.Destroy; OK := TRUE; end; Destroy is called even if .Create fails and the global code section is a nonsense as always returns OK = TRUE whatever the access rights
  10. robertjohns

    ListView Items additions

    Thanks a lot problem solved
  11. Kyle_Katarn31

    Exception in TCustomSmtpClient.Destroy;

    Code comes from ICS TCustomSmtpClient.Destroy; Compiled with D7 Not fully reproductible but there might be something rotten here. anyway I agree that simply calling .free or FreeAndNil would be a wiser option here
  12. David Heffernan

    Exception in TCustomSmtpClient.Destroy;

    If that code is from a destructor it's bizarre. Just call Free on each instance variable. But that may not be the issue, it would only be an issue if there were stale references in one of those instance variables. The issue may be a double free of the object. Or something else. Debugging required.
  13. Hello When running a software of mine in ReactOS i'm getting rare Delphi exception "Delphi Exception at address: 0049F658". Using IDR I identified that this corresponds to TCustomSmtpClient.Destroy; Looking at the code i'm surprised to see that the "safe destroy" pattern is used for FHdrLines and FAuthTypesSupported but NOT for FMailMessage and FRcptName, while all 4 of them are TStrings created in the constructor. Is it intentionnal ? if Assigned(FHdrLines) then begin FHdrLines.Destroy; FHdrLines := nil; end; if Assigned(FAuthTypesSupported) then begin FAuthTypesSupported.Destroy; FAuthTypesSupported := nil; end; FMailMessage.Destroy; FRcptName.Destroy; same in TFingerCli.Destroy; TDnsQuery.Destroy; TCustomPop3Cli.Destroy; Similar issue with TFormDataAnalyser.PartSaveDataToFile, TFormDataItem.SaveToFile, TIcsFtpMulti.IntDownOne, OverbyteIcsFtpMultiW, OverbyteIcsFtpSrv, OverbyteIcsFtpSrvW where .Destroy is called while .Free would be expected Same for OverbyteIcsFtpCli.pas (3 occurences of FModeZStream.Destroy; instead of FModeZStream.Free;) ... global check to be done.
  14. toufik

    FMX and Excel application

    is there any free component or demos to how manipulate an excel file on android ..? i just want to import some values and export it again
  15. robertjohns

    ListView Items additions

    Thanks again for your reply . loading from file it is easy but I need it from 2 memo lines and it seems harder to achieve it especially for me May some will come out with solution and help me here
  16. Yesterday
  17. Pat Foley

    ListView Items additions

    The clues did not include that Memo1.Lines equates to crL: StringList using ctL[0] for caption. The ctL.commatext is used for the subitems. again viewstyle is vsReport set with F11 object injector.
  18. robertjohns

    ListView Items additions

    Thanks for reply SL.LoadFromFile('Logger11.csv'); but the I am seeking help about using Memo1 lines as Listview Caption and Memo2 lines as Listview subitem
  19. Pat Foley

    Newbee: FMX: Can't find DirectoryListBox or FileListBox

    Best to leave that D5 code behind. FMX code can be earned by running the example samples for FMX. The FMX code has an OpenDialog component that might give you start.
  20. mytbo

    Json create Array

    With mORMot you can write it as follows: ShowMessage(Utf8ToString(VariantSaveJson( _Obj(['registration_ids', _Arr(['crX7c-...']), 'notification', _Obj(['title', 'Hi', 'body', 'Notification test'])])))); The function _Obj() uses name-value pairs. The description of _Obj() can be found in the help here and for _Arr() here. Information about TDocVariant documents can be found here. With best regards Thomas
  21. Pat Foley

    ListView Items additions

    Be sure View is report Here's 11.1 vintage clues on a project I am working on Allistair has a video on strUtils that showed similar stuff. procedure TForm3.Button3Click(Sender: TObject); var tvCol: TListColumn; Vi: TListView; li: TListItem; begin var SL := TStringList.Create; var ctL := TStringList.Create; SL.LoadFromFile('Logger11.csv'); LV.Clear; for var R := 0 to SL.Count - 1 do begin ctL.CommaText := SL.Strings[R]; if R = 0 then for var K := 0 to ctL.Count - 1 do begin tvCol := LV.Columns.add; tvCol.Caption := ctL[K]; tvCol.Width := 120; end else begin li := LV.items.add; li.Caption := ctL[0]; ctL.Delete(0); li.SubItems.CommaText := (ctL.CommaText); end; end; SL.Free; ctL.Free; end;
  22. robertjohns

    ListView Items additions

    I need to add Listview items from 2 Memo's , I am using Delphi 10.2 Tokyo Memo1 lines are as line1 line2 line3 line4 line5 Memo2 lines are as something1 something2 something3 something4 something5 Need to add these 2 Memo lines into Listview Listview Caption = Memo1 lines Listview SubItem = Memo2 lines Need help to achieve this Thanks in advance
  23. stijnsanders

    Json create Array

    So much code! Are you willing to try out a different JSON solution? When I was writing my very bare-bones connector to MongoDB, I was really into the Variant type, and really disliked long lists of overloads for all of the types. So I created my own JSON solution, that heavily uses the Variant type, and offers a really concise syntax. The above would look like this: JSON(['registration_ids',VarArrayOf(['crX...']),'notification',JSON(['title','Hi','body','Notification test'])])
  24. Pardon, it is l"DirectoryListBox or FileListBox."
  25. I an totally new to RAD, and have installed RAD 11.2. I want to convert a project from Delphi5 to RAD 11.2 in Multi-Device App. as it can rotate an Image. I therefor started a new app. but I can not find anything like ListBox or FileListBox. Is there no procedure or function in RAD 11.2 to do the job? Is there another way i FMX to do it?
  26. I don't see other posts regarding this so it makes me wonder. I was previously developing on Delphi 10.4 when some of my customers reported that after upgrading to Monterey 12.6, their applications that I made stopped opening. After being told I need to upgrade to Delphi 11.2, I did, and was able to debug my apps. I discovered that none of the .bmp files that my program was attempting to load and display worked. And my app had about a hundred of them on screen at one time. They were small files, under 6kb each. The message just said they could not be loaded. I also noticed, on my Mac laptop running 12.6 and an M1 chip, that I could not even view the .bmp files in Viewer. Very strange indeed. The message said they were damaged and something else, but basically they could not be viewed. When I converted these files to .gif images, they loaded just fine and that was my solution. Has anyone else seen this? Better yet, does anyone have an app running on Monterey 12.6 that does load .bmp files and display them? I have searched online for anything on this and so far have come up with nothing. It seems to be system-wide and Mac-Monterey 12.6-wide (works fine on earlier Monterey and other versions). Thanks~! Robert
  27. Another frustrating Rad Studio upgrade attempt....
  28. I recently added a IcsBuiltWith function to ICS to keep track of how I'm building the samples, there are RTL variables that can be checked for recent compilers: {$IFDEF VER350} Result := '11.0'; {$IF Declared(RTLVersion111)}Result := '11.1';{$IFEND} {$IF Declared(RTLVersion112)}Result := '11.2';{$IFEND} // both declared {$ENDIF} {$IFDEF VER340} Result = '10.4'; {$IF Declared(RTLVersion1041)}Result := '10.41';{$IFEND} {$IF Declared(RTLVersion1042)}Result := '10.42';{$IFEND} // both declared {$ENDIF} Angus
  1. Load more activity
×