Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/08/24 in all areas

  1. David Heffernan

    "Divided by zero" exception

    That's Embarcadero's fault. They've known how to fix this for at least 10 years, and my patched version of the RTL fixes it. That said, the real issue isn't really a language issue. It's a platform issue. It all stems from the way floating point is implemented on x86 and x86-64 hardware.
  2. I wonder why TIniFile.ReadString sets the maximum value size to 2047 without checking the actual value in the file and without limiting the value size in TIniFile.WriteString. Stackoverflow accepted the maximum allowed value to be 65,535 https://stackoverflow.com/questions/10507927/getprivateprofilestring-buffer-length https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofilestringw DWORD GetPrivateProfileStringW( [in] LPCWSTR lpAppName, [in] LPCWSTR lpKeyName, [in] LPCWSTR lpDefault, [out] LPWSTR lpReturnedString, [in] DWORD nSize, [in] LPCWSTR lpFileName ) ... If neither lpAppName nor lpKeyName is NULL and the supplied destination buffer is too small to hold the requested string, the string is truncated and followed by a null character, and the return value is equal to nSize minus one. But if the developers of System.IniFiles.TIniFile implemented a limit of 2047, then why did they do it only for TIniFile.ReadString (without throwing an exception when exceeded), but not for TIniFile.WriteString. unit System.IniFiles ... function TIniFile.ReadString(const Section, Ident, Default: string): string; var Buffer: array[0..2047] of Char; begin SetString(Result, Buffer, GetPrivateProfileString(MarshaledString(Section), MarshaledString(Ident), MarshaledString(Default), Buffer, Length(Buffer), MarshaledString(FFileName))); end; procedure TIniFile.WriteString(const Section, Ident, Value: string); begin if not WritePrivateProfileString(MarshaledString(Section), MarshaledString(Ident), MarshaledString(Value), MarshaledString(FFileName)) then raise EIniFileException.CreateResFmt(@SIniFileWriteError, [FileName]); end;
  3. You would have to draw cell content yourself (OnDrawCell event) to achieve that, but in my opinion such behaviour is a horrible idea in the first place. It would give a very uneven grid appearance and you will also have the problem that larger font sizes than the grid default will also require a bigger row hight to avoid text cut off at the bottom. Either adjust the column width or (more difficult) implement word wrap for cells with longer text. That also requires drawing the cell yourself and adjusting the row hight, which is tricky since it will trigger a redraw of the row and thus fire OnDrawCell again. An alternative is to use the grid with reasonable default font size and column autofit and place a panel or frame with individual edit and memo fields below it. Clicking on a grid row shows the content of the row in the individual controls of the panel, the content of which the user can scroll if required.
  4. Remy Lebeau

    "Divided by zero" exception

    https://docwiki.embarcadero.com/RADStudio/Athens/en/What's_New#Disabling_Floating-Point_Exceptions_on_All_Platforms
  5. Although, I just had to check because I thought it was a little old... are you sure the listing is right? 10.14 Mojave is an Intel OS released 2 years before the M1 machines. I'd expect it to be macOS 11 Big Sur at a minimum.
  6. Any Mac with Apple Silicon chips (M1, M2, etc.) can be upgraded to the latest macOS 15 Sequoia. Running that with Windows in Parallels should be fine for Alexandria (or Athens) — it's what I use. Just make sure you get a machine with plenty of RAM. Remember, the RAM in Apple Silicon Macs is all on-chip, so not upgradeable, and you will be running Windows on top of macOS. Although, I just had to check because I thought it was a little old... are you sure the listing is right? 10.14 Mojave is an Intel OS released 2 years before the M1 machines. I'd expect it to be macOS 11 Big Sur at a minimum. And... a MacBook Air are a little lightweight. It will run what you want but probably not as nippy as you'd hope for when under load.
  7. Rollo62

    Why Aren't You Using SQLite?

    Sqlite can be used in large, production-ready sites, you could have a look what Pieter Levels does with Sqlite, PHP, JQuery only, like back to the roots. https://news.ycombinator.com/item?id=23359023 https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.youtube.com/watch%3Fv%3DB-_P0d1el2k&ved=2ahUKEwjJxILl-PuIAxXFSPEDHTKKOr8QtwJ6BAgKEAI&usg=AOvVaw0ESb4TJ_wTRTzhSmsFX7ot
×