Jump to content

Gord P

Members
  • Content Count

    63
  • Joined

  • Last visited

Community Reputation

5 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Gord P

    TFileStream vs ifstream/ofstream

    Yes I recognize asking which is the best way can be tricky and subjective. I was just trying to make sure I wasn't using something that was generally considered obsolete, and as far as I can tell it isn't. Thanks for your comment and good point on encoding.
  2. Gord P

    TFileStream vs ifstream/ofstream

    I came across this article by Yilmaz Yoru on the Embarcadero C++Builder Community site: How To Read And Write Text Files In A Modern C++ App - March 28, 2022 In the article he only talks about ofstream and ifstream. No mention of TFileStream. However, in an article two years earlier (Windows File Operations in Modern C++) he does seem to promote TFileStream. I guess there is no real must-do way. I suppose sticking with the fstream methods is more portable.
  3. I am updated an older C++Builder program. In it I use ifstream and ofstream for reading and writing text files, which then get parsed to extract various pieces of data. It works well enough but I wonder if I should be using TFileStream going forward. What are the advantages, if any, of using TFileStream?
  4. Thanks for that Uwe! I will take a look at that.
  5. Thanks Uwe. I should have put in a request a long time ago for it. I tried going back in to see if someone else had put a request in for that but couldn't login even though it said the site was in "read only" mode until the migration was completed. Currently, to ensure the user has entered a proper float value (allowing for 1.0E10 type of input) I simply handle it after the fact (i.e. after some OK button or CALC button or whatever has been clicked) by using TryStrToFloat() on the contents of the Text string from a basic TEdit and displaying a message if it is not a valid float. I would like to be able to do the checking while the value is being entered similar to what TNumberBox does in how it restricts the user to only using valid characters - except allowing for 'e' or 'E'. One challenge I see with that is that someone might incorrectly enter an 'e' at the end of the number (eg. "1.234E") which is not a valid float. Might have to just check OnExit but that might lead to awkward behavior. Anyway, just thinking out loud. Thanks again for checking.
  6. I have not installed version 12 yet, but I am wondering if the TNumberBox control is still unable to recognize 'e' or 'E' (for exponent) when entering a number in the box when the mode is set to nbmFloat.
  7. It is obviously doable - eg. GLScene that Shineworld previously quoted. (Then you might ask why not use that - but that has its own issues, which is why I think Shineworld specified "Embarcadero managed ... (Sorry if I am putting words in your mouth)). Also, The pro version of TChart handles 3D fine. Personally I am looking for 3D chart capabilities but at this point don't want to shell out dollars for a yearly subscription for the pro version.
  8. He specified for VCL. And I second that. (although I recognize posting wishes here is next to useless - but it is interesting to see what people are looking for).
  9. Gord P

    C++Builder 12 - Windows only?

    As usual, I can never make these webinars because of commitments. Look forward to the replay though.
  10. Gord P

    C++Builder 12 - Windows only?

    I will go with that 🙂
  11. I read this poking around on the Discord site from Ian Barker: That's interesting. Doesn't affect me at the moment because I currently only target Windows, plus I don't use the latest version until at least one update or a couple patches are out. But, it does seem like a regression in the feature set of C++Builder nonetheless.
  12. Rad Studio Wiki is up and running for me
  13. Gord P

    Debugger gives wrong value for long double

    I suspected that. That was nice about using the 80 bit doubles. From what I understood, there wasn't a huge performance hit. I was about test all that out, but now I think I will stick with the doubles for now.
  14. Gord P

    Debugger gives wrong value for long double

    Thanks no I haven't. There also the Neslib.Multiprecision Library that I haven't checked into either.
  15. Gord P

    Debugger gives wrong value for long double

    The number I quoted is the actual (true) value for 1/7. But yes, in a binary system you don't get that. Which is why I used TExtended80Rec to see what the value in the long double variable equated to. The debugger does not display the value that the variable actually contains to the precision it should be able to (and could if it used something akin to sprintf()) - as per my first post. Yes, that is unfortunate and is what I was referring to in my second post. That is a good question, and one I was trying to sort out. It is not a matter so much of whether it is insufficient, but whether things could be improved with additional precision. I have been using doubles forever and it has been fine. But there are cases where there is numerical instability and I wonder if more precision would help. But, there are always ways to get around it and because of the previous point, those will have to suffice.
×