Jump to content

Bernard

Members
  • Content Count

    40
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bernard

  1. Bernard

    RAD Studio 11 Alexandria is now available

    Hi all, So I had been looking forward to some juicy update for this version of Delphi. Looking at the roadmap I thought they have this one in the bag for me. 2 things I was looking forward to were.. 1) Delphi Language Extensions for increasingly powerfull coding 2) Math performance improvements to increase your application speed Do these come in the form of later updates...
  2. Bernard

    RAD Studio 11 Alexandria is now available

    Has there been an improvement in maths performance?
  3. Bernard

    RAD Studio 11 Alexandria is now available

    Is there a list of language enhancements?
  4. Bernard

    Touch Screen VCL

    Hello Everyone, I have been moving to a keyboard mouse free interface on a machine. I have introduced a Touchscreen interface on a machine running Windows 10 Pro. Issue. On the screen there are a few buttons that jog motors. When you press the key it will not register unless you move (wiggle) your finger about on the screen. So the functionality (on touch screen with finger) I am looking for is... Press and hold button. Motor starts moving. Release button. Motor stops. Thank you.
  5. Bernard

    Touch Screen VCL

    Thank you both for the feedback. This info should help 🙂
  6. I came accross an issue when assigning values to an 'array of word' earlier This works var WordArray : TArray<Word>; begin setlength(WordArray, 10); WordArray := [0, 7323, 0, 7224, 0, 7124, 0, 7024, 0, 7004]; end; This works var WordArray : TArray<Word>; begin setlength(WordArray, 10); WordArray := [0, word(73232), 0, 7224, 0, 7124, 0, 7024, 0, 7004]; end; This does not work var WordArray : TArray<Word>; begin setlength(WordArray, 10); WordArray := [0, 73232, 0 ,7224, 0, 7124, 0, 7024, 0, 7004]; end; [dcc32 Error] TestArray.pas(28): E1012 Constant expression violates subrange bounds Can someone explain why the above code is not accepted. For curious reasons. I am stupid I see why I was outside the max range of Word.
  7. I did not know that. Makes sense. Thanks
  8. Bernard

    Inch representation format in TEdit like controls

    I have a half baked component that accepts metric or imperial. Half baked because in metric mode it works in mm only In Imperial mode it works in inches only. It does not display fraction format but accepts it so these are all valid input 6'3" 5m23cm 1 1/5M 3 1/2" 3' 1/2" 12ga If anyone wants to help improve the code let me know, and I will stick it on Github.
  9. Bernard

    Delphi 10.4.2 first impressions

    I am worried about missing VCL styles as I use the "Windows 10 Slate Gray" and designed icons to contrast nicely with the colors (not a graphics guy and I spent more time at this than I needed). Can anyone confirm it is in the latest install.
  10. Hi All, Is there a better way of doing the following, getting rid of the tPolarHelper, without changing to classes. tPolar2D = record Radius: Double; azimuth: Double; end; tPoint2D = record x: Double; y: Double; function ToPolar: tPolar2D; end; tPolarHelper = record helper for tPolar2D function ToCartesian: tPoint2D; end; I know if the above were classes then I could write tPoint2D = class; tPolar2D = class Radius: Double; azimuth: Double; function ToCartesian: tPoint2D; end; tPoint2D = class x: Double; y: Double; function ToPolar: tPolar2D; end; Thanks.
  11. Bernard

    Hex2Binary

    Nice one. 32bit release Pascal lookup (Stefan): 1449 64bit release Pascal lookup (Stefan): 1434
  12. Bernard

    Hex2Binary

    This has turned into a great thread for learning about speed improvements by simple tweaks. Using Sets instead of Case function HexToBinMahdi5(const HexValue: string): string; type TChar4 = array [0 .. 3] of Char; PChar4 = ^TChar4; const Table1: array ['0' .. '9'] of TChar4 = ('0000', '0001', '0010', '0011', '0100', '0101', '0110', '0111', '1000', '1001'); Table2: array ['a' .. 'f'] of TChar4 = ('1010', '1011', '1100', '1101', '1110', '1111'); Table3: array ['A' .. 'F'] of TChar4 = ('1010', '1011', '1100', '1101', '1110', '1111'); var HexDigit: Char; P: PChar4; begin SetLength(Result, Length(HexValue) * 4); P := PChar4(Result); for var i: integer := low(HexValue) to high( HexValue ) do begin if HexValue[i] in [ '0' .. '9'] then P^ := Table1[HexValue[i]] else if HexValue[i] in [ 'a' .. 'f'] then P^ := Table2[HexValue[i]] else if HexValue[i] in [ 'A' .. 'F'] then P^ := Table3[HexValue[i]] else raise EConvertError.CreateFmt('Invalid hex digit ''%s'' found in ''%s''', [HexDigit, HexValue]); Inc(P); end; end; Compiled 32bit Release Pascal lookup (Heff): 4091 Pascal lookup (Mahdi): 4107 Pascal lookup (Mahdi 3 Table): 4264 Pascal lookup (Mahdi 3 Table Set): 3665 Pascal lookup (Mahdi 3 Table Set Local Var loop): 2951
  13. Bernard

    Hex2Binary

    Speed up the HexToBinMahdi function by adding a 3rd table and removing any calculations function HexToBinMahdi(const HexValue: string): string; type TChar4 = array [0 .. 3] of Char; PChar4 = ^TChar4; const Table1: array ['0' .. '9'] of TChar4 = ('0000', '0001', '0010', '0011', '0100', '0101', '0110', '0111', '1000', '1001'); Table2: array ['a' .. 'f'] of TChar4 = ('1010', '1011', '1100', '1101', '1110', '1111'); Table3: array ['A' .. 'F'] of TChar4 = ('1010', '1011', '1100', '1101', '1110', '1111'); var HexDigit: Char; P: PChar4; begin SetLength(Result, Length(HexValue) * 4); P := PChar4(Result); for HexDigit in HexValue do begin case HexDigit of '0' .. '9': P^ := Table1[HexDigit]; 'a' .. 'f': P^ := Table2[HexDigit]; 'A' .. 'F': P^ := Table3[HexDigit]; else raise EConvertError.CreateFmt('Invalid hex digit ''%s'' found in ''%s''', [HexDigit, HexValue]); end; Inc(P); end; end; Pascal lookup (Heff): 5777 Pascal lookup (Mahdi): 5948 Pascal lookup (Mahdi 2): 5414 asm32: 6800 xmm: 6068
  14. Bernard

    Import .NET Assembly list is empty

    Thank you. Is this problem a that only impacts some installations?
  15. Bernard

    Import .NET Assembly list is empty

    I am having this issue in 10.4 update 1. Have you ever managed to find a resolution?
  16. Bernard

    Your RAD Studio 10.4 Sydney issues

    Found issue For anyone having this issue of the Toggle Switch giving issues. I have a funny feeling that it is not just me. Get an older copy from the latest community edition or your Rio install. Open the Bitmap Style Designer and open C:\Users\Public\Documents\Embarcadero\Studio\20.0\Styles\Windows10SlateGray.vsf Compare it to C:\Users\Public\Documents\Embarcadero\Studio\21.0\Styles\Windows10SlateGray.vsf If you look at the toggle switch in the latest update it is not correct. Hope this helps..
  17. Bernard

    Your RAD Studio 10.4 Sydney issues

    Just installed Delphi 10.4 on my main Windows 10 development machine and I still see the same issues. Has anyone else ran the sample in Windows 10 and found the same issues.
  18. Bernard

    Your RAD Studio 10.4 Sydney issues

    I have a customer base that run windows 7 PCs with machine control software on them. These machines require periodic software updates. Some of these guys who have the machines are not technical at all. They know how to turn machuines on and off and use the machine software. Some of them have no internet so updates are sent on USB. That is why Win 7 support is a requirement.
  19. Bernard

    Your RAD Studio 10.4 Sydney issues

    Hi All, Just got a chance to install Delphi 10.4 on my windows 7 Laptop and loaded up a sample. C:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\Object Pascal\VCL\ToggleSwitch I ran it and when I change the VCL style to Windows10Blue or Windows10Dark it displays incorrectly Anyone else got this. By the way thanks everyone for the great info on this site
  20. Is this different than Classes with forward declarations?
  21. I wonder if the solution could be a post processor that processed the forward declarations and created a helper file for the compiler to use during compilation time. Now the compiler could remain a single pass.
  22. Could you elaborate on why it is not possible?
  23. The class operators for records with calculations that fit my example are a great solution for this issue. Thanks for that.
  24. Does this get rid of the Circular reference issue? I have always found it starange that records have class functions instead of record functions. Feels funny naming a record function a class function. Its like when one of my young kids calls a poo a pee. I know that they were trying to say 🙂
×