Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/30/24 in all areas

  1. I have created a unit, that is similar to String Interpolation. Of course real Interpolation would be a compiler feature. TStr('Hello, {0}! Today is {1:ddd}, it's {1:HH:mm} now.').Params(name, date); // Hello, Mark! Today is Wednesday, it's 19:40 now. Variables where automaticly detected and converted (automatic type inferrence via Generics), so no need for IntToStr, FloatToStrF... Here a short Description of the Format. It is similar to the Format Specifier of .Net. The Date Format is almost the same like in Delphi, but the other Specifier are different. but i think its a way better than the sprintf Convention that Delphi uses: Integer and Float where automaticly converted and formatted as needed: C for Currency (Number for Decimal Places) D for Integer (Number for prefixed Zeros) F for Double (Number for Decimal Places) Date can formatted with: dd = Day, MM=Month, yyyy=Year HH=Hour, mm=Minute, ss=Seconds there are further possibilities in the readme Readme: https://github.com/VoSs2o0o/NetFormat/blob/master/readme.md Code: https://github.com/VoSs2o0o/NetFormat/ Download: https://github.com/VoSs2o0o/NetFormat/releases Website in German with descriptive Content about the Code: https://www.cloud-9.de/entwicklung/delphi-besserer-format-befehl
  2. Uwe Raabe

    New and easy Format Command (OpenSource)

    Why not using the longer descriptive name for the declaration and then add a shorter type alias later. That way everyone can choose, while the more descriptive name is used by the IDE tooling.
  3. If the compiler optimization was worth a penny it would not matter which way the code was written and it would emit the best version regardless and depending on the situation where this function is being called and inlined - however, the compiler optimization is rather terrible so this might be some poor attempt to optimize for a certain situation where storing in two boolean variables creates less or no conditional jumps opposed to the short circuit evaluated combined expression with two comparisons.
  4. VoSs2o0o

    New and easy Format Command (OpenSource)

    Ok, that was valueable Input: @Vincent: 1) done 2) good Idea, it has VoTools as Prefix now 3) The Idea is, that it is short like an f"test" in Python, $"test" in CSharp or a STR."test" in Java, but i have made two changes: - have changed it from 'TStr' to 'Fstr' - have readded the TNetFormat.Str format of the older Version, for a more Delphi like syntax 4) there are a lot of files now, so it was a good idea to restructure it 5) added 🙂 @Anders See 3) above @All: I have a problem with the Generic<T> - Types, i cannot correctly detect 'nil': I have tried the following: default(T) == nil //cannot compile it T(nil) == nil //cannot compile it PPointer(@val1)^ <> nil // works, but not in DunitX //i use this at moment (no direct Pointer supported at moment): GetTypekind(T) == tkPointer //tkpointer is the type of nil, but alos of Pointers of course... ChangeLog: ### 28.01.2024: Version 3.0 - Old: TStr('Hallo {0} {1:D4} {2} {3}'). Params('Welt', 55, 7.7, testdate); - New: TStr -> FStr, and old Format readded, beause some People wants a more Delphi-Format like command: FStr('Hallo {0} {1:D4} {2} {3}'). Params('Welt', 55, 7.7, testdate); TNetFormat.TStr('Hallo {0} {1:D4} {2} {3}', 'Welt', 55, 7.7, testdate); - Namespace VTools added to avoid conficts - Hex-Format added ("X") - TFormatStettings Support - Tests added - 'writeln' to Example added, to also have an console output - some minors changes to README Readme: https://github.com/VoSs2o0o/NetFormat/blob/master/README.md Code: https://github.com/VoSs2o0o/NetFormat/ Download: https://github.com/VoSs2o0o/NetFormat/releases Website in German with descriptive Content about the Code: https://www.cloud-9.de/entwicklung/delphi-besserer-format-befehl
  5. Uwe Raabe

    Delphi 12 Welcome Page: Open Recent

    To be fair, it at least contains a simple question and thus seems pretty valid for this forum:
  6. Vincent Parrett

    New and easy Format Command (OpenSource)

    Yep, I'm too lazy to type all those 1's and 0's - life's too short for that!
  7. Vincent Parrett

    New and easy Format Command (OpenSource)

    Thanks for taking the feedback on board. Some comments 1) Move the Readme to the root folder of the repo, that way it shows on github when you vist the repo. 2) Change the Netformat to Source or Src 3) Move the .groupproj to the Source folder. This is probably personal taste, but FStr might be confusing in Delphi code - especially for those coming to a code base and not being familiar with this library - since F is typically used to prefix class Fields. I understand why making it short is attractive.
  8. Vincent Parrett

    New and easy Format Command (OpenSource)

    Nice! I love seeing people think outside the box. I use string interpolation a lot in c# and I really dislike using Format in delphi. Some suggestions 1) Unit Tests - using DUnitX - not just a test application. 2) Prefix the Netformat.pas name with a namespace, eg VoSs2o0o.NetFormat.pas - this will avoid the chance that the unit name conflicts with other libraries ( the unit name is a bit generic). 3) TStr is not a great name for this, perhaps TFormatStr or TStringFormat or something like that would be more descriptive. 4) Restructure the repo to be more organised - see https://www.finalbuilder.com/resources/blogs/advice-for-delphi-library-authors 5) Hex format would be useful. Anyway, Kudos on a great idea.
  9. Hmm, or use floppies to copy it from a friend... About 5300 pieces of 3,5"/1,44 MB needed 😉
  10. Uwe Raabe

    Delphi 12: Invalid class typecast

    I have uploaded a new beta version that allows to do some logging: MMX Beta Setup There is a new entry in MMX properties MMX Debugging: Enable log to file, close IDE, install CodeSite Tools and restart IDE. Then try the same as before to trigger the exception and look in the given folder for the log file.
  11. I have not help to offer but can confirm that F1 works fine for me (and did do "straight out of the box").
  12. limelect

    SSL connection

    Thanks, everybody I incorporated Indy.SChannel into my software and it works great And why not dll because what for if there is an option without them? I like to make my software without dll as much as possible.
  13. There was a discussion about this function already at this forum:
  14. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    I don't think they or anyone needs advice from AI.
  15. I just want to emphasize that the DocWiki is not only back again, but also seems to be pretty fast and stable now.
  16. Anders Melander

    New and easy Format Command (OpenSource)

    And maybe get rid of the leading T since it isn't really used as a type.
  17. Due to the supply chain disturbances, we had a 5 month delivery wait for servers and parts for a while, so I can relate to delays. The problems here are: - Lack of proper communication. "No news. Next update at ..." is better than silence! - Insufficient contingency planning? - Insufficient backup and recovery plans? - No plan B? There are many capable cloud hosting services that doesn't take forever to spin up a pack of servers. The cost might be high, sure - but so is the cost of losing the trust of your customers.
  18. I don't buy it, I don't think this is just hardware failure. My conspiracy theory is that it started with hardware failure and then they realized that the backup didn't backup for 20 years. No matter what hardware failure you have, it doesn't take two weeks to get it back up and running.
  19. Several hardware problems at the same moment? My imagination offers me something like this: (image found on the web, not from Emba!)
  20. LOL at the comments from @Ian Barker on the Delphi Community Discord - General Chat 😄
  21. Nobody - but they don't say anything. And since they have outages (QC, Getit) frequently, I'm willing to believe they have a lot of room for improvement.
  22. Don't worry; I figured out where they can get a replacement server!
  23. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    I am sure that everyone here has everything in duplicate, so when something dies they can replace it in an instance with minimal interruptions, especially if it dies over the weekend during the huge cold spell. Stuff happens, no matter how small or big the company is. Do I need to remind you that on one instance Facebook folks had to literally break into their server room because they got locked out of it. I am not going to defend the lack of official communication, this is something that needs to change, but this is also not something that people on lower hierarchy levels (meaning the ones that blog and communicate with us) can do on their own.
  24. I tremble for the day when a rogue regime decides to shut down the internet...
×