Jump to content

Lars Fosdal

Administrators
  • Content Count

    3524
  • Joined

  • Last visited

  • Days Won

    116

Posts posted by Lars Fosdal


  1. On 12/6/2024 at 2:38 PM, David Heffernan said:

    I actually don't know how that is interpreted by the compiler 

    It is at least interpreted correctly with regards to type and type size.

    32-bit  SizeOf(Type(1))
    1       Byte
    1       UInt8
    1       Int8
    1       ShortInt
    2       Word
    2       Int16
    2       UInt16
    2       SmallInt
    4       FixedInt
    4       FixedUInt
    4       Integer
    4       Cardinal
    4       NativeInt
    4       NativeUInt
    8       Int64
    8       UInt64

     

    64-bit  SizeOf(Type(1))
    1       Byte
    1       UInt8
    1       Int8
    1       ShortInt
    2       Word
    2       Int16
    2       UInt16
    2       SmallInt

    4       FixedInt
    4       FixedUInt
    4       Integer
    4       Cardinal
    8       NativeInt
    8       NativeUInt
    8       Int64
    8       UInt64

     

    program TypeCastSizeOf;
    
    {$APPTYPE CONSOLE}
    
    {$R *.res}
    
    uses
      System.SysUtils;
    
    begin
    {$ifdef CPU32Bits}
      Write('32-bit');
    {$else}
      Write('64-bit');
    {$endif}
      Writeln('  SizeOf(Type(1))');
      try
        try
          Writeln(SizeOf(Byte(1)),^I'Byte');
          Writeln(SizeOf(UInt8(1)),^I'UInt8');
          Writeln(SizeOf(Int8(1)),^I'Int8');
          Writeln(SizeOf(ShortInt(1)),^I'ShortInt');
          Writeln(SizeOf(Word(1)),^I'Word');
          Writeln(SizeOf(Int16(1)),^I'Int16');
          Writeln(SizeOf(UInt16(1)),^I'UInt16');
          Writeln(SizeOf(SmallInt(1)),^I'SmallInt');
          Writeln(SizeOf(FixedInt(1)),^I'FixedInt');
          Writeln(SizeOf(FixedUInt(1)),^I'FixedUInt');
          Writeln(SizeOf(Integer(1)),^I'Integer');
          Writeln(SizeOf(Cardinal(1)),^I'Cardinal');
          Writeln(SizeOf(NativeInt(1)),^I'NativeInt');
          Writeln(SizeOf(NativeInt(1)),^I'NativeUInt');
          Writeln(SizeOf(Int64(1)),^I'Int64');
          Writeln(SizeOf(UInt64(1)),^I'UInt64');
    
        except
          on E: Exception do
            Writeln(E.ClassName, ': ', E.Message);
        end;
      finally
        Readln;
      end;
    end.


     


  2. If you need to produce executable code for MacOS and iOS - you need stuff that is NOT out-of-warranty, i.e. the Mx generation of CPUs.

    I built all my computers myself from 1984 until 2008. After that, it has been laptops and mini PCs.
    I bought an MBP M1 Pro when it came out, and it and later models using the Mx platform, cannot be upgraded. You have to pay the Apple tax on more memory and more storage.


  3. 9 minutes ago, David Schwartz said:

    "average consmers"

    Average consumers of hardware, then. Not all programmers tinker with hardware. And, if they bought a newer Apple device, they wouldn't typically be able to do so, as not all programmers are handy with soldering tools. Those of us that are, would probably be reluctant to void the warranty of their new devices. 

    • Like 1

  4. On 11/15/2024 at 11:59 PM, David Schwartz said:

    My suggestion is to buy an Intel-based Mac Mini with an i7, 256GB or more of SSD.

    Intel Macs are going the way of the Dodo. It is all about ARM for Apple now.

     

    The Apple Tax refers to the premium you pay if upgrading from the base spec of an Mx based device. The cost is ridiculous. You could buy a second device for the price of the upgrades.

     

    Edit: ...and your average consumer cannot upgrade the device by themselves.


  5. I don't use the EL dialog nor do I capture screenshots. 

    @Attila Kovacs But, in EL Options, under dialog: 
    image.png.8b36470d4beb232f1456728cee00d5f5.png
    it looks like you can make screenshots mandatory?
    Disclaimer - I haven't tested it.

    Edit: Well, reading the docs says it doesn't work that way - and that there are GDPR pitfalls if not asking for consent.
    https://www.eurekalog.com/help/eurekalog/index.php?bug_report_screenshot.php

     


  6. Does it always fail on the same parameter?

    I'd probably do it like this, but it depends on the declaration and description of the GetOptParameter method.

      var
        FNameOut: AnsiString;
      begin
        ...
        FNameOut := UTF8Encode(ParamName);
        if FDSBase.GetOptParameter(0, FieldNo, @FNameOut, ParamType,  ...
×